* sanitize ob_httpetaghandler
[m6w6/ext-http] / php_http_api.h
index de7714c34a3a667d3ea5011990e48f0605762408..f28e30b9371657f6d698533266174265042c7ed8 100644 (file)
 #define PHP_HTTP_API_H
 
 #ifdef PHP_WIN32
-#define PHP_HTTP_API __declspec(dllexport)
+#      define PHP_HTTP_API __declspec(dllexport)
 #else
-#define PHP_HTTP_API
+#      define PHP_HTTP_API
 #endif
 
 #ifndef ZEND_ENGINE_2
-#include "php_http_build_query.h"
+#      include "php_http_build_query.h"
 #endif
 
 /* make functions that return SUCCESS|FAILURE more obvious */
@@ -46,6 +46,9 @@ typedef enum {
 } http_send_mode;
 /* }}} */
 
+/* CR LF */
+#define HTTP_CRLF "\r\n"
+
 /* max URI length */
 #define HTTP_URI_MAXLEN 2048
 
@@ -108,6 +111,9 @@ PHP_HTTP_API inline zval *_http_get_server_var(const char *key TSRMLS_DC);
 #define http_ob_etaghandler(o, l, ho, hl, m) _http_ob_etaghandler((o), (l), (ho), (hl), (m) TSRMLS_CC)
 PHP_HTTP_API void _http_ob_etaghandler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC);
 
+#define http_start_ob_handler(f, h, s, e) _http_start_ob_handler((f), (h), (s), (e) TSRMLS_CC)
+PHP_HTTP_API STATUS _http_start_ob_handler(php_output_handler_func_t handler_func, char *handler_name, uint chunk_size, zend_bool erase TSRMLS_DC);
+
 #define http_modified_match(entry, modified) _http_modified_match((entry), (modified) TSRMLS_CC)
 PHP_HTTP_API int _http_modified_match(const char *entry, const time_t t TSRMLS_DC);
 
@@ -152,8 +158,11 @@ PHP_HTTP_API STATUS _http_chunked_decode(const char *encoded, const size_t encod
 #define http_split_response(r, h, b) _http_split_response((r), (h), (b) TSRMLS_CC)
 PHP_HTTP_API STATUS _http_split_response(const zval *zresponse, zval *zheaders, zval *zbody TSRMLS_DC);
 
-#define http_parse_header(h, l, a) _http_parse_header((h), (l), (a) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_parse_header(char *header, long header_len, zval *array TSRMLS_DC);
+#define http_parse_headers(h, l, a) _http_parse_headers((h), (l), (a) TSRMLS_CC)
+PHP_HTTP_API STATUS _http_parse_headers(char *header, int header_len, zval *array TSRMLS_DC);
+
+#define http_get_request_headers(h) _http_get_request_headers((h) TSRMLS_CC)
+PHP_HTTP_API void _http_get_request_headers(zval *array TSRMLS_DC);
 
 /* {{{ HAVE_CURL */
 #ifdef HTTP_HAVE_CURL
@@ -177,7 +186,7 @@ PHP_HTTP_API STATUS _http_post_array(const char *URL, HashTable *postarray, Hash
 PHP_HTTP_API STATUS _http_auth_credentials(char **user, char **pass TSRMLS_DC);
 
 #define http_auth_header(t, r) _http_auth_header((t), (r) TSRMLS_CC)
-PHP_HTTP_API void _http_auth_header(const char *type, const char *realm TSRMLS_DC);
+PHP_HTTP_API STATUS _http_auth_header(const char *type, const char *realm TSRMLS_DC);
 
 /* }}} */