From: Michael Wallner Date: Mon, 19 Jan 2015 10:52:13 +0000 (+0100) Subject: typo X-Git-Tag: RELEASE_3_0_0_RC1~91 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c225008cfbcf90259e4c97f240b1422ebce67c88;p=m6w6%2Fext-http typo --- diff --git a/php_http_env.c b/php_http_env.c index a2c3227..239af98 100644 --- a/php_http_env.c +++ b/php_http_env.c @@ -137,7 +137,7 @@ char *php_http_env_get_request_header(const char *name_str, size_t name_len, siz request_headers = PHP_HTTP_G->env.request.headers; } - if ((zvalue == zend_symtable_str_find(request_headers, key, name_len))) { + if ((zvalue = zend_symtable_str_find(request_headers, key, name_len))) { zend_string *zs = zval_get_string(zvalue); val = estrndup(zs->val, zs->len); diff --git a/php_http_negotiate.c b/php_http_negotiate.c index f0526dc..1535b86 100644 --- a/php_http_negotiate.c +++ b/php_http_negotiate.c @@ -27,10 +27,10 @@ static int php_http_negotiate_sort(const void *first, const void *second TSRMLS_ #define M_SEC 2 #define M_ANY 1 #define M_NOT 0 -#define M_ALL -1 +#define M_ALL ~0 static inline unsigned php_http_negotiate_match(const char *param_str, size_t param_len, const char *supported_str, size_t supported_len, const char *sep_str, size_t sep_len) { - int match = M_NOT; + unsigned match = M_NOT; if (param_len == supported_len && !strncasecmp(param_str, supported_str, param_len)) { /* that was easy */ @@ -131,6 +131,10 @@ HashTable *php_http_negotiate(const char *value_str, size_t value_len, HashTable q = 1.0 - ++i / 100.0; } +#if 0 + fprintf(stderr, "Q: %s=%1.3f\n", key.key->val, q); +#endif + if (key.key) { add_assoc_double_ex(&arr, key.key->val, key.key->len, q); } else { diff --git a/tests/negotiate001.phpt b/tests/negotiate001.phpt index f628cdf..0e553f5 100644 --- a/tests/negotiate001.phpt +++ b/tests/negotiate001.phpt @@ -122,7 +122,7 @@ CUSTOM a.b: Array ( [a.b] => 0.9 - [c.e] => 0.1 [a.x] => 0.1 + [c.e] => 0.1 ) DONE