X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_info_api.c;h=793acd11be56a941d88cc4a669c88726ef502695;hp=ec238fb4f937a727796aeefd82cf07eff1a46253;hb=e2d31d8ae762ed3acb0ef5ec21edfcc94293dfaf;hpb=f41f0417afd1d0ad0609fde76a99d907117ed669 diff --git a/http_info_api.c b/http_info_api.c index ec238fb..793acd1 100644 --- a/http_info_api.c +++ b/http_info_api.c @@ -55,6 +55,28 @@ PHP_HTTP_API void _http_info_dtor(http_info *i) } } +#if !defined(ZEND_ENGINE_2) +inline char *php_memnstr(char *h, char *n, size_t n_len, char *e) +{ + char *p; + + if (e > h && n_len > 0) { + while (h != e) { + if (*h == *n) { + for (p = n; *p == h[p-n]; ++p) { + if (p == n+n_len-1) { + return h; + } + } + } + ++h; + } + } + + return NULL; +} +#endif + PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info, zend_bool silent TSRMLS_DC) { const char *end, *http;