X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_headers_api.c;h=d573ab27b601aa4d0533cf9d28cc46b70b0adc9c;hp=5048266a8fddd949d3035295fb601cd71e5634fe;hb=d83edb65a0097de2d5baa1a9fd9dbcebed34cc79;hpb=0d925a2820b9d75b8e32c451fd400863e51e22fe diff --git a/http_headers_api.c b/http_headers_api.c index 5048266..d573ab2 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -254,16 +254,11 @@ PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header zval array; Z_ARRVAL(array) = headers; - header_len = body ? body - header : strlen(header) + 1; - -/* - if (header_len < 2 || ((!lflf) && (!crlfcrlf) && (!strchr(header, ':')))) { - fprintf(stderr, "header_len: %lu, lflf: %p, crlfcrlf: %p, ':': %p\n(%s)\n", - header_len, lflf, crlfcrlf, strchr(header, ':'), header); - http_error(HE_WARNING, HTTP_E_MALFORMED_HEADERS, "Cannot parse too short or malformed HTTP headers"); - return FAILURE; + if (body) { + header_len = body - header; + } else { + header_len = strlen(header) + 1; } -*/ line = header; while (header_len >= (size_t) (line - begin)) { @@ -290,16 +285,6 @@ PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header Z_ARRVAL(array) = headers; } else - /* - if ( (!strncmp(header, "HTTP/1.", lenof("HTTP/1."))) || - (!strncmp(line - lenof("HTTP/1.x" HTTP_CRLF) + value_len, "HTTP/1.", lenof("HTTP/1.")))) { - if (func) { - func(header, &headers, callback_data TSRMLS_CC); - Z_ARRVAL(array) = headers; - } - } else - */ - /* "header: value" pair */ if (colon) {