X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_message_api.c;h=64707254587b7b1b363c9859624f6cc6ea3e60cd;hb=d99c357cdbd70f155cb05668ca1273e89777dad1;hp=99bc01b30bc0b0a90ddd99989681672afb6e0f49;hpb=c40902a33546532405c17c6216c347874f8cb8ff;p=m6w6%2Fext-http diff --git a/http_message_api.c b/http_message_api.c index 99bc01b..6470725 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -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; } }