X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_message.c;h=2c25aec7c7c431326302c999bce418be0fde8741;hb=ae3da9e40ac118dc77984bfe172aa0ddc0a49a48;hp=7dbf6085eb2b49004505ac5b1cbf413d66c66e12;hpb=32580f1d50d0481c9069b65ef30d0acd59ada3bb;p=m6w6%2Fext-http diff --git a/php_http_message.c b/php_http_message.c index 7dbf608..2c25aec 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -69,14 +69,6 @@ PHP_HTTP_API php_http_message_t *php_http_message_init_env(php_http_message_t *m if ((sval = php_http_env_get_server_var(ZEND_STRL("REQUEST_URI"), 1 TSRMLS_CC))) { message->http.info.request.url = estrdup(Z_STRVAL_P(sval)); } - if ((sval = php_http_env_get_server_var(ZEND_STRL("CONTENT_TYPE"), 1 TSRMLS_CC))) { - Z_ADDREF_P(sval); - zend_hash_update(&message->hdrs, "Content-Type", sizeof("Content-Type"), (void *) &sval, sizeof(zval *), NULL); - } - if ((sval = php_http_env_get_server_var(ZEND_STRL("CONTENT_LENGTH"), 1 TSRMLS_CC))) { - Z_ADDREF_P(sval); - zend_hash_update(&message->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &sval, sizeof(zval *), NULL); - } php_http_env_get_request_headers(&message->hdrs TSRMLS_CC); @@ -401,7 +393,6 @@ PHP_HTTP_API void php_http_message_to_callback(php_http_message_t *msg, php_http if (php_http_message_body_size(&msg->body)) { cb(cb_arg, ZEND_STRL(PHP_HTTP_CRLF)); php_http_message_body_to_callback(&msg->body, cb, cb_arg, 0, 0); - cb(cb_arg, ZEND_STRL(PHP_HTTP_CRLF)); } } @@ -415,7 +406,6 @@ PHP_HTTP_API void php_http_message_to_string(php_http_message_t *msg, char **str if (php_http_message_body_size(&msg->body)) { php_http_buffer_appends(&str, PHP_HTTP_CRLF); php_http_message_body_to_callback(&msg->body, (php_http_pass_callback_t) php_http_buffer_append, &str, 0, 0); - php_http_buffer_appends(&str, PHP_HTTP_CRLF); } data = php_http_buffer_data(&str, string, length); @@ -436,6 +426,7 @@ PHP_HTTP_API void php_http_message_serialize(php_http_message_t *message, char * do { php_http_message_to_string(message, &buf, &len); + php_http_buffer_prepends(&str, PHP_HTTP_CRLF); php_http_buffer_prepend(&str, buf, len); efree(buf); } while ((message = message->parent));