diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-07-20 16:07:06 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-07-20 16:07:06 +0400 |
commit | 9bc06fea2eac12cc46028fcdd630d291a76b68ae (patch) | |
tree | 345e96d9bbddce7fb6e6dfbfc7410ad715744d3b /src/map.h | |
parent | 2ee290157978cf154cbd1b060c4367b4da3e6fec (diff) | |
download | rspamd-9bc06fea2eac12cc46028fcdd630d291a76b68ae.tar.gz rspamd-9bc06fea2eac12cc46028fcdd630d291a76b68ae.zip |
Rework http chunked encoding parsing.
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -42,17 +42,17 @@ struct http_map_data { gchar *path; gchar *host; time_t last_checked; - gboolean chunked; - u_char read_buf[BUFSIZ]; + gshort chunked; + gchar read_buf[BUFSIZ]; guint32 rlen; guint32 chunk; - guint32 chunk_read; + guint32 chunk_remain; }; /** * Callback types */ -typedef u_char* (*map_cb_t)(memory_pool_t *pool, u_char *chunk, size_t len, struct map_cb_data *data); +typedef gchar* (*map_cb_t)(memory_pool_t *pool, gchar *chunk, size_t len, struct map_cb_data *data); typedef void (*map_fin_cb_t)(memory_pool_t *pool, struct map_cb_data *data); /** @@ -97,24 +97,24 @@ typedef void (*insert_func) (gpointer st, gconstpointer key, /** * Radix list is a list like ip/mask */ -u_char* read_radix_list (memory_pool_t *pool, u_char *chunk, size_t len, struct map_cb_data *data); +gchar* read_radix_list (memory_pool_t *pool, gchar *chunk, size_t len, struct map_cb_data *data); void fin_radix_list (memory_pool_t *pool, struct map_cb_data *data); /** * Host list is an ordinal list of hosts or domains */ -u_char* read_host_list (memory_pool_t *pool, u_char *chunk, size_t len, struct map_cb_data *data); +gchar* read_host_list (memory_pool_t *pool, gchar *chunk, size_t len, struct map_cb_data *data); void fin_host_list (memory_pool_t *pool, struct map_cb_data *data); /** * Kv list is an ordinal list of keys and values separated by whitespace */ -u_char* read_kv_list (memory_pool_t *pool, u_char *chunk, size_t len, struct map_cb_data *data); +gchar* read_kv_list (memory_pool_t *pool, gchar *chunk, size_t len, struct map_cb_data *data); void fin_kv_list (memory_pool_t *pool, struct map_cb_data *data); /** * FSM for lists parsing (support comments, blank lines and partial replies) */ -u_char * abstract_parse_list (memory_pool_t * pool, u_char * chunk, size_t len, struct map_cb_data *data, insert_func func); +gchar * abstract_parse_list (memory_pool_t * pool, gchar * chunk, size_t len, struct map_cb_data *data, insert_func func); #endif |