From 111fbe75d978a74c3aba074c942d8b2bd5f66223 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 13 Dec 2005 12:12:00 +0000 Subject: [PATCH] - some more relay stuff --- http_message_api.c | 4 ++-- http_request_body_api.c | 4 ++-- php_http_message_api.h | 2 ++ php_http_request_body_api.h | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/http_message_api.c b/http_message_api.c index cd9a951..65aeaf2 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -135,7 +135,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char return NULL; } - msg = http_message_init(msg); + msg = http_message_init_rel(msg, 0); if (SUCCESS != http_parse_headers_cb(message, &msg->hdrs, 1, (http_info_callback) http_message_info_callback, (void **) &msg)) { if (free_msg) { @@ -304,7 +304,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char http_message *next = NULL, *most = NULL; /* set current message to parent of most parent following messages and return deepest */ - if ((most = next = http_message_parse(continue_at, message + message_length - continue_at))) { + if ((most = next = http_message_parse_rel(NULL, continue_at, message + message_length - continue_at))) { while (most->parent) most = most->parent; most->parent = msg; msg = next; diff --git a/http_request_body_api.c b/http_request_body_api.c index 467726b..eb82c42 100644 --- a/http_request_body_api.c +++ b/http_request_body_api.c @@ -107,7 +107,7 @@ PHP_HTTP_API http_request_body *_http_request_body_fill(http_request_body *body, } } - return http_request_body_init_ex(body, HTTP_REQUEST_BODY_CURLPOST, http_post_data[0], 0, 1); + return http_request_body_init_rel(body, HTTP_REQUEST_BODY_CURLPOST, http_post_data[0], 0, 1); } else { char *encoded; @@ -118,7 +118,7 @@ PHP_HTTP_API http_request_body *_http_request_body_fill(http_request_body *body, return NULL; } - return http_request_body_init_ex(body, HTTP_REQUEST_BODY_CSTRING, encoded, encoded_len, 1); + return http_request_body_init_rel(body, HTTP_REQUEST_BODY_CSTRING, encoded, encoded_len, 1); } } /* }}} */ diff --git a/php_http_message_api.h b/php_http_message_api.h index 8ce8b4c..a8b7c21 100644 --- a/php_http_message_api.h +++ b/php_http_message_api.h @@ -42,6 +42,7 @@ struct _http_message { #define http_message_new() http_message_init_ex(NULL, 0) #define http_message_init(m) http_message_init_ex((m), 0) #define http_message_init_ex(m, t) _http_message_init_ex((m), (t) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define http_message_init_rel(m, t) _http_message_init_ex((m), (t) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC) PHP_HTTP_API http_message *_http_message_init_ex(http_message *m, http_message_type t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); #define http_message_set_type(m, t) _http_message_set_type((m), (t)) @@ -60,6 +61,7 @@ static inline zval *_http_message_header_ex(http_message *msg, char *key_str, si #define http_message_parse(m, l) http_message_parse_ex(NULL, (m), (l)) #define http_message_parse_ex(h, m, l) _http_message_parse_ex((h), (m), (l) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) +#define http_message_parse_rel(h, m, l) _http_message_parse_ex((h), (m), (l) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC TSRMLS_CC) PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char *message, size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); #define http_message_tostring(m, s, l) _http_message_tostring((m), (s), (l)) diff --git a/php_http_request_body_api.h b/php_http_request_body_api.h index 0dc1252..edff6e5 100644 --- a/php_http_request_body_api.h +++ b/php_http_request_body_api.h @@ -31,6 +31,7 @@ typedef struct { #define http_request_body_new() http_request_body_init(NULL) #define http_request_body_init(b) http_request_body_init_ex((b), 0, NULL, 0, 0) #define http_request_body_init_ex(b, t, d, l, f) _http_request_body_init_ex((b), (t), (d), (l), (f) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) +#define http_request_body_init_rel(b, t, d, l, f) _http_request_body_init_ex((b), (t), (d), (l), (f) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC TSRMLS_CC) PHP_HTTP_API http_request_body *_http_request_body_init_ex(http_request_body *body, int type, void *data, size_t len, zend_bool free ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC); #define http_request_body_fill(b, fields, files) _http_request_body_fill((b), (fields), (files) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) -- 2.30.2