X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_api.h;h=d4fb508b82c9923cf150de5acb8dc8e340a34842;hp=105f3d1673c065a93c4facb1e54921dfea535eef;hb=cce1549bae21973d3950f1f52a054b09ac005a15;hpb=9d0eaae0af2de89a57be321c507e5a9956ba99f9 diff --git a/php_http_api.h b/php_http_api.h index 105f3d1..d4fb508 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -27,6 +27,14 @@ extern char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend #define http_error_ex _http_error_ex extern void _http_error_ex(long type, long code, const char *format, ...); +#define http_exit(s, h) http_exit_ex((s), (h), 1) +#define http_exit_ex(s, h, f) _http_exit_ex((s), (h), (f) TSRMLS_CC) +extern STATUS _http_exit_ex(int status, char *header, zend_bool free_header TSRMLS_DC); + +#define http_check_method(m) http_check_method_ex((m), HTTP_KNOWN_METHODS) +#define http_check_method_ex(m, a) _http_check_method_ex((m), (a)) +extern STATUS _http_check_method(const char *method, const char *methods); + #define HTTP_GSC(var, name, ret) HTTP_GSP(var, name, return ret) #define HTTP_GSP(var, name, ret) \ if (!(var = _http_get_server_var_ex(name, strlen(name)+1, 1 TSRMLS_CC))) { \ @@ -38,7 +46,7 @@ extern void _http_error_ex(long type, long code, const char *format, ...); PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zend_bool check TSRMLS_DC); #define http_chunked_decode(e, el, d, dl) _http_chunked_decode((e), (el), (d), (dl) TSRMLS_CC) -PHP_HTTP_API STATUS _http_chunked_decode(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC); +PHP_HTTP_API const char *_http_chunked_decode(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC); #define http_split_response(r, h, b) _http_split_response((r), (h), (b) TSRMLS_CC) PHP_HTTP_API STATUS _http_split_response(zval *response, zval *headers, zval *body TSRMLS_DC);