PHP_ARG_ENABLE([http], [whether to enable extended HTTP support],
[ --enable-http Enable extended HTTP support])
-PHP_ARG_WITH([http-curl-requests], [wheter to enable cURL HTTP requests],
+PHP_ARG_WITH([http-curl-requests], [whether to enable cURL HTTP requests],
[ --with-http-curl-requests[=CURLDIR]
With cURL HTTP request support])
PHP_ARG_WITH([http-mhash-etags], [whether to enable mhash ETag generator],
{
const char *e_ptr;
char *d_ptr;
+ long rest;
*decoded_len = 0;
*decoded = ecalloc(1, encoded_len);
d_ptr = *decoded;
e_ptr = encoded;
- while (((e_ptr - encoded) - encoded_len) > 0) {
- size_t chunk_len = 0, EOL_len = 0;
- int eol_mismatch = 0;
+ while ((rest = encoded + encoded_len - e_ptr) > 0) {
+ long chunk_len = 0;
+ int EOL_len = 0, eol_mismatch = 0;
char *n_ptr;
chunk_len = strtol(e_ptr, &n_ptr, 16);
/* check if:
* - we could not read in chunk size
+ * - we got a negative chunk size
+ * - chunk size is greater then remaining size
* - chunk size is not followed by (CR)LF|NUL
*/
- if ((n_ptr == e_ptr) || (*n_ptr && (eol_mismatch = n_ptr != http_locate_eol(e_ptr, &EOL_len)))) {
+ if ( (n_ptr == e_ptr) || (chunk_len < 0) || (chunk_len > rest) ||
+ (*n_ptr && (eol_mismatch = (n_ptr != http_locate_eol(e_ptr, &EOL_len))))) {
/* don't fail on apperently not encoded data */
if (e_ptr == encoded) {
memcpy(*decoded, encoded, encoded_len);
while (*++ptr && !isdigit(*ptr));
- quality = strtod(ptr, NULL);
+ quality = atof(ptr);
identifier = estrndup(Z_STRVAL_PP(entry), separator - Z_STRVAL_PP(entry));
} else {
quality = 1000.0 - i++;
o = ecalloc(1, sizeof(http_message_object));
o->zo.ce = ce;
- o->message = NULL;
- o->parent.handle = 0;
- o->parent.handlers = NULL;
if (msg) {
o->message = msg;
o = ecalloc(1, sizeof(http_request_object));
o->zo.ce = ce;
o->ch = curl_easy_init();
- o->pool = NULL;
phpstr_init(&o->history);
phpstr_init(&o->request);
o->zo.ce = ce;
http_request_pool_init(&o->pool);
- o->iterator.pos = 0;
ALLOC_HASHTABLE(OBJ_PROP(o));
zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
#ifdef HTTP_HAVE_MHASH
# include <mhash.h>
#endif
+#ifdef HTTP_HAVE_MAGIC
+# include <magic.h>
+#endif
ZEND_EXTERN_MODULE_GLOBALS(http);
+ Added supported ETag hash algrithms to php_info() output
+ Added ETag hashing through PHPs CRC32() implementation
+ Added new language/charset negotiator
-+ Added HttpMessage::setBody()
-+ Added HttpRequest raw post data support
* Changed HttpMessage::toString([include_parent = true]) to false
* Renamed HTTP_GET etc. constants to HTTP_METH_GET
}
#define http_locate_eol _http_locate_eol
-static inline const char *_http_locate_eol(const char *line, size_t *eol_len)
+static inline const char *_http_locate_eol(const char *line, int *eol_len)
{
const char *eol = strpbrk(line, "\r\n");