X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_api.h;h=c84331a2379361dfad6150c6c625aa97107cb8a3;hp=a6f19ebb53e58ab9c255bac4025c7c43e5ead217;hb=3f47fc4cd2911b718b155de4e37752db9fa4f8c8;hpb=a6b4fe496b44ab45fbc84d0b491ce7322e7532f7 diff --git a/php_http_api.h b/php_http_api.h index a6f19eb..c84331a 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -57,7 +57,11 @@ extern void _http_error_ex(long type TSRMLS_DC, long code, const char *format, . http_error(HE_NOTICE, HTTP_E_MESSAGE_TYPE, "HttpMessage is not of type HTTP_MSG_REQUEST"); \ action; \ } - +#define HTTP_CHECK_GZIP_LEVEL(level, action) \ + if (level < -1 || level > 9) { \ + http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid compression level (-1 to 9): %d", level); \ + action; \ + } #define http_log(f, i, m) _http_log_ex((f), (i), (m) TSRMLS_CC) extern void http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC);