Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
fix httpVersion retrieval on bigendian
Browse files Browse the repository at this point in the history
Conflicts:
	php_http_message.c
  • Loading branch information
remicollet authored and m6w6 committed Sep 9, 2014
1 parent 90af3a3 commit a5c998b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions php_http_message.c
Expand Up @@ -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);

Expand All @@ -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:
Expand Down

0 comments on commit a5c998b

Please sign in to comment.