X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_info_api.c;h=b1ffcbc4c8ea9372ef76d4e7e7d8c9025e7c109f;hp=6756b2c544e5fe52d92e3cb7d7e2612cffd2b3d6;hb=f0bcc141e62c022101d8d19c1d73e7b9ae41d0e9;hpb=e83a7438dc70ed96630887246a1d3aefcf155b1c diff --git a/http_info_api.c b/http_info_api.c index 6756b2c..b1ffcbc 100644 --- a/http_info_api.c +++ b/http_info_api.c @@ -15,17 +15,12 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include "php.h" #include "php_http.h" + #include "php_http_api.h" -#include "php_http_std_defs.h" #include "php_http_info_api.h" -#include - -ZEND_EXTERN_MODULE_GLOBALS(http); - PHP_HTTP_API void _http_info_default_callback(void **nothing, HashTable **headers, http_info *info TSRMLS_DC) { zval array; @@ -119,7 +114,7 @@ PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info, } /* is request */ - else { + else if (!http[lenof("HTTP/1.x")] || http[lenof("HTTP/1.x")] == '\r' || http[lenof("HTTP/1.x")] == '\n') { const char *url = strchr(pre_header, ' '); info->type = IS_HTTP_REQUEST; @@ -133,6 +128,11 @@ PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info, return SUCCESS; } + + /* some darn header containing HTTP/1.x */ + else { + return FAILURE; + } }