fix problem when finishing a chunked encoding stream
[m6w6/ext-http] / php_http_headers.c
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2010, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id: http_headers_api.c 300300 2010-06-09 07:29:35Z mike $ */
14
15 #include "php_http.h"
16
17 PHP_HTTP_API STATUS php_http_headers_parse(const char *header, size_t length, HashTable *headers, php_http_info_callback_t callback_func, void **callback_data TSRMLS_DC)
18 {
19 php_http_header_parser_t ctx;
20 php_http_buffer buf;
21
22 php_http_buffer_from_string_ex(&buf, header, length);
23 php_http_header_parser_init(&ctx TSRMLS_CC);
24 php_http_header_parser_parse(&ctx, &buf, PHP_HTTP_HEADER_PARSER_CLEANUP, headers, callback_func, callback_data);
25 php_http_header_parser_dtor(&ctx);
26 php_http_buffer_dtor(&buf);
27 /* FIXME */
28 return SUCCESS;
29 }
30
31 /*
32 * Local variables:
33 * tab-width: 4
34 * c-basic-offset: 4
35 * End:
36 * vim600: noet sw=4 ts=4 fdm=marker
37 * vim<600: noet sw=4 ts=4
38 */
39