cvs: pecl /http http_headers_api.c http_message_object.c

From: Date: Tue, 12 Apr 2005 20:29:11 +0000
Subject: cvs: pecl /http http_headers_api.c http_message_object.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-2981@lists.php.net to get a copy of this message
mike Tue Apr 12 16:29:11 2005 EDT Modified files: /pecl/http http_headers_api.c http_message_object.c Log: - no empty_string anymore http://cvs.php.net/diff.php/pecl/http/http_headers_api.c?r1=1.4&r2=1.5&ty=u Index: pecl/http/http_headers_api.c diff -u pecl/http/http_headers_api.c:1.4 pecl/http/http_headers_api.c:1.5 --- pecl/http/http_headers_api.c:1.4 Mon Apr 11 06:26:58 2005 +++ pecl/http/http_headers_api.c Tue Apr 12 16:29:08 2005 @@ -13,7 +13,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: http_headers_api.c,v 1.4 2005/04/11 10:26:58 mike Exp $ */ +/* $Id: http_headers_api.c,v 1.5 2005/04/12 20:29:08 mike Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -271,14 +271,14 @@ Z_ARRVAL(array) = headers; } } else - + /* "header: value" pair */ if (colon) { /* skip empty key */ if (header != colon) { zval **previous = NULL; - char *value = empty_string; + char *value; int keylen = colon - header; char *key = estrndup(header, keylen); @@ -296,6 +296,7 @@ if (value_len > 0) { value = estrndup(colon, value_len); } else { + value = estrdup(""); value_len = 0; } @@ -343,7 +344,7 @@ { zval array; Z_ARRVAL(array) = *headers; - + /* response */ if (!strncmp(http_line, "HTTP/1.", lenof("HTTP/1."))) { add_assoc_stringl(&array, "Response Status", http_line + lenof("HTTP/1.x "), line_length - lenof("HTTP/1.x \r\n"), 1); @@ -351,7 +352,7 @@ /* request */ if (!strncmp(http_line + line_length - lenof("HTTP/1.x\r\n"), "HTTP/1.", lenof("HTTP/1."))) { char *sep = strchr(http_line, ' '); - + add_assoc_stringl(&array, "Request Method", http_line, sep - http_line, 1); add_assoc_stringl(&array, "Request Uri", sep + 1, strstr(sep, "HTTP/1.") - sep + 1 + 1, 1); } http://cvs.php.net/diff.php/pecl/http/http_message_object.c?r1=1.4&r2=1.5&ty=u Index: pecl/http/http_message_object.c diff -u pecl/http/http_message_object.c:1.4 pecl/http/http_message_object.c:1.5 --- pecl/http/http_message_object.c:1.4 Tue Apr 12 16:17:35 2005 +++ pecl/http/http_message_object.c Tue Apr 12 16:29:08 2005 @@ -13,7 +13,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: http_message_object.c,v 1.4 2005/04/12 20:17:35 mike Exp $ */ +/* $Id: http_message_object.c,v 1.5 2005/04/12 20:29:08 mike Exp $ */ #ifdef HAVE_CONFIG_H @@ -173,7 +173,7 @@ if (msg->len) { RETVAL_STRINGL(msg->raw, msg->len, 1); } else { - RETVAL_STRINGL(empty_string, 0, 1); + RETVAL_STRINGL("", 0, 1); } } else { RETVAL_NULL(); @@ -327,7 +327,7 @@ int m_prop_len; \ Z_ARRVAL(array) = OBJ_PROP(obj); \ zend_mangle_property_name(&m_prop_name, &m_prop_len, "*", 1, name, lenof(name), 1); \ - add_assoc_stringl_ex(&array, m_prop_name, sizeof(name)+4, val, len, val != empty_string); \ + add_assoc_stringl_ex(&array, m_prop_name, sizeof(name)+4, val, len, 1); \ } zend_hash_clean(OBJ_PROP(obj)); @@ -354,16 +354,16 @@ case HTTP_MSG_RESPONSE: ASSOC_PROP(obj, double, "httpVersion", msg->info.response.http_version); ASSOC_PROP(obj, long, "responseCode", msg->info.response.code); - ASSOC_STRING(obj, "requestMethod", empty_string); - ASSOC_STRING(obj, "requestUri", empty_string); + ASSOC_STRING(obj, "requestMethod", ""); + ASSOC_STRING(obj, "requestUri", ""); break; case HTTP_MSG_NONE: default: ASSOC_PROP(obj, double, "httpVersion", 0.0); ASSOC_PROP(obj, long, "responseCode", 0); - ASSOC_STRING(obj, "requestMethod", empty_string); - ASSOC_STRING(obj, "requestUri", empty_string); + ASSOC_STRING(obj, "requestMethod", ""); + ASSOC_STRING(obj, "requestUri", ""); break; }

« previous php.pecl.cvs (#2981) next »