X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fphp_http_info.h;h=e1cce6fc6766a876591ee308af41f4e1ebad7515;hb=3c7b514d38d844b855d430fcbaed6dea67c9c17b;hp=4f02908446b6c0c430eb6bb39269f45967500b00;hpb=bdd6edb59194cda9e5fcb393c48ab4230fceb32a;p=m6w6%2Fext-http diff --git a/src/php_http_info.h b/src/php_http_info.h index 4f02908..e1cce6f 100644 --- a/src/php_http_info.h +++ b/src/php_http_info.h @@ -16,21 +16,6 @@ #include "php_http_version.h" #include "php_http_url.h" -#define PHP_HTTP_INFO_REQUEST_FMT_ARGS(_http_ptr, tmp, eol) "%s %s HTTP/%u.%u" eol, \ - (_http_ptr)->info.request.method?(_http_ptr)->info.request.method:"UNKNOWN", \ - (_http_ptr)->info.request.method&&!strcasecmp((_http_ptr)->info.request.method,"CONNECT")?( \ - (_http_ptr)->info.request.url?php_http_url_authority_to_string((_http_ptr)->info.request.url, &(tmp), NULL):"0"):( \ - (_http_ptr)->info.request.url?php_http_url_to_string((_http_ptr)->info.request.url, &(tmp), NULL, 0):"/"), \ - (_http_ptr)->version.major||(_http_ptr)->version.major?(_http_ptr)->version.major:1, \ - (_http_ptr)->version.major||(_http_ptr)->version.minor?(_http_ptr)->version.minor:1 - -#define PHP_HTTP_INFO_RESPONSE_FMT_ARGS(_http_ptr, tmp, eol) "HTTP/%u.%u %d%s%s" eol, \ - (_http_ptr)->version.major||(_http_ptr)->version.major?(_http_ptr)->version.major:1, \ - (_http_ptr)->version.major||(_http_ptr)->version.minor?(_http_ptr)->version.minor:1, \ - (_http_ptr)->info.response.code?(_http_ptr)->info.response.code:200, \ - (_http_ptr)->info.response.status&&*(_http_ptr)->info.response.status ? " ":"", \ - STR_PTR((_http_ptr)->info.response.status) - typedef struct php_http_info_data { union { /* GET /foo/bar */ @@ -60,6 +45,7 @@ typedef zend_bool (*php_http_info_callback_t)(void **callback_data, HashTable ** PHP_HTTP_API php_http_info_t *php_http_info_init(php_http_info_t *info TSRMLS_DC); PHP_HTTP_API php_http_info_t *php_http_info_parse(php_http_info_t *info, const char *pre_header TSRMLS_DC); +PHP_HTTP_API void php_http_info_to_string(php_http_info_t *info, char **str, size_t *len, const char *eol TSRMLS_DC); PHP_HTTP_API void php_http_info_dtor(php_http_info_t *info); PHP_HTTP_API void php_http_info_free(php_http_info_t **info);