X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_message_api.c;h=64707254587b7b1b363c9859624f6cc6ea3e60cd;hb=bf7e7f73ea5db037b861f781e958f09a8af39b53;hp=b98db1709e2de2cc0c53df175a3b9b65dfc28ea3;hpb=2f39230d83bdf816dcae52c7e5a1b019347f0e7b;p=m6w6%2Fext-http diff --git a/http_message_api.c b/http_message_api.c index b98db17..6470725 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -265,7 +265,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char /* check for following messages */ if (continue_at && (continue_at < (message + message_length))) { - while (isspace(*continue_at)) ++continue_at; + while (HTTP_IS_CTYPE(space, *continue_at)) ++continue_at; if (continue_at < (message + message_length)) { http_message *next = NULL, *most = NULL; @@ -480,24 +480,14 @@ PHP_HTTP_API STATUS _http_message_send(http_message *message TSRMLS_DC) case HTTP_MSG_RESPONSE: { char *key; + uint len; ulong idx; zval **val; - HashPosition pos1; + HashPosition pos; - FOREACH_HASH_KEYVAL(pos1, &message->hdrs, key, idx, val) { + FOREACH_HASH_KEYLENVAL(pos, &message->hdrs, key, len, idx, val) { if (key) { - if (Z_TYPE_PP(val) == IS_ARRAY) { - zend_bool first = 1; - zval **data; - HashPosition pos2; - - FOREACH_VAL(pos2, *val, data) { - http_send_header_ex(key, strlen(key), Z_STRVAL_PP(data), Z_STRLEN_PP(data), first, NULL); - first = 0; - } - } else { - http_send_header_ex(key, strlen(key), Z_STRVAL_PP(val), Z_STRLEN_PP(val), 1, NULL); - } + http_send_header_zval_ex(key, len-1, val, 1); key = NULL; } }