From: Remi Collet Date: Wed, 3 Sep 2014 13:31:33 +0000 (+0200) Subject: fix httpVersion retrieval on bigendian X-Git-Tag: RELEASE_2_1_1~3 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=a5c998ba6ef2aaa080ee724ddfac5bfd9ef995c9;p=m6w6%2Fext-http fix httpVersion retrieval on bigendian Conflicts: php_http_message.c --- diff --git a/php_http_message.c b/php_http_message.c index 88def26..f7696da 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -941,6 +941,7 @@ static HashTable *php_http_message_object_get_props(zval *object TSRMLS_DC) HashTable *props = zend_get_std_object_handlers()->get_properties(object TSRMLS_CC); zval array, *parent, *body; char *version; + int verlen; PHP_HTTP_MESSAGE_OBJECT_INIT(obj); @@ -964,8 +965,9 @@ static HashTable *php_http_message_object_get_props(zval *object TSRMLS_DC) } \ } while(0) - ASSOC_PROP(long, "type", msg->type); - ASSOC_STRINGL_EX("httpVersion", version, spprintf(&version, 0, "%u.%u", msg->http.version.major, msg->http.version.minor), 0); + ASSOC_PROP(long, "type", obj->message->type); + verlen = spprintf(&version, 0, "%u.%u", obj->message->http.version.major, obj->message->http.version.minor); + ASSOC_STRINGL_EX("httpVersion", version, verlen, 0); switch (msg->type) { case PHP_HTTP_REQUEST: