X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_negotiate.c;h=1535b86c67f1c077cb49cb8337b0e99113ea5a3d;hb=c225008cfbcf90259e4c97f240b1422ebce67c88;hp=f0526dc5a1bd9c3a5ab9899471dd7184b730dbab;hpb=7096ff6dbb61fd13b9b04ef86bfbece8fb4b2ea0;p=m6w6%2Fext-http 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 {