aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/postprocessor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/postprocessor.c')
-rw-r--r--src/daemon/postprocessor.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/daemon/postprocessor.c b/src/daemon/postprocessor.c
index 60f09311..7cc11dde 100644
--- a/src/daemon/postprocessor.c
+++ b/src/daemon/postprocessor.c
@@ -172,22 +172,22 @@ struct MHD_PostProcessor
172 /** 172 /**
173 * Size of our buffer for the key. 173 * Size of our buffer for the key.
174 */ 174 */
175 unsigned int buffer_size; 175 size_t buffer_size;
176 176
177 /** 177 /**
178 * Current position in the key buffer. 178 * Current position in the key buffer.
179 */ 179 */
180 unsigned int buffer_pos; 180 size_t buffer_pos;
181 181
182 /** 182 /**
183 * Current position in xbuf. 183 * Current position in xbuf.
184 */ 184 */
185 unsigned int xbuf_pos; 185 size_t xbuf_pos;
186 186
187 /** 187 /**
188 * Current offset in the value being processed. 188 * Current offset in the value being processed.
189 */ 189 */
190 unsigned int value_offset; 190 uint64_t value_offset;
191 191
192 /** 192 /**
193 * strlen(boundary) -- if boundary != NULL. 193 * strlen(boundary) -- if boundary != NULL.
@@ -247,7 +247,7 @@ struct MHD_PostProcessor
247 */ 247 */
248struct MHD_PostProcessor * 248struct MHD_PostProcessor *
249MHD_create_post_processor (struct MHD_Connection *connection, 249MHD_create_post_processor (struct MHD_Connection *connection,
250 unsigned int buffer_size, 250 size_t buffer_size,
251 MHD_PostDataIterator ikvi, void *cls) 251 MHD_PostDataIterator ikvi, void *cls)
252{ 252{
253 struct MHD_PostProcessor *ret; 253 struct MHD_PostProcessor *ret;
@@ -304,13 +304,14 @@ MHD_create_post_processor (struct MHD_Connection *connection,
304 */ 304 */
305static int 305static int
306post_process_urlencoded (struct MHD_PostProcessor *pp, 306post_process_urlencoded (struct MHD_PostProcessor *pp,
307 const char *post_data, unsigned int post_data_len) 307 const char *post_data,
308 size_t post_data_len)
308{ 309{
309 unsigned int equals; 310 size_t equals;
310 unsigned int amper; 311 size_t amper;
311 unsigned int poff; 312 size_t poff;
312 unsigned int xoff; 313 size_t xoff;
313 unsigned int delta; 314 size_t delta;
314 int end_of_value_found; 315 int end_of_value_found;
315 char *buf; 316 char *buf;
316 char xbuf[XBUF_SIZE + 1]; 317 char xbuf[XBUF_SIZE + 1];
@@ -472,7 +473,7 @@ static int
472find_boundary (struct MHD_PostProcessor *pp, 473find_boundary (struct MHD_PostProcessor *pp,
473 const char *boundary, 474 const char *boundary,
474 size_t blen, 475 size_t blen,
475 unsigned int *ioffptr, 476 size_t *ioffptr,
476 enum PP_State next_state, enum PP_State next_dash_state) 477 enum PP_State next_state, enum PP_State next_dash_state)
477{ 478{
478 char *buf = (char *) &pp[1]; 479 char *buf = (char *) &pp[1];
@@ -554,10 +555,10 @@ try_get_value (const char *buf, const char *key, char **destination)
554 */ 555 */
555static int 556static int
556process_multipart_headers (struct MHD_PostProcessor *pp, 557process_multipart_headers (struct MHD_PostProcessor *pp,
557 unsigned int *ioffptr, enum PP_State next_state) 558 size_t *ioffptr, enum PP_State next_state)
558{ 559{
559 char *buf = (char *) &pp[1]; 560 char *buf = (char *) &pp[1];
560 unsigned int newline; 561 size_t newline;
561 562
562 newline = 0; 563 newline = 0;
563 while ((newline < pp->buffer_pos) && 564 while ((newline < pp->buffer_pos) &&
@@ -615,14 +616,14 @@ process_multipart_headers (struct MHD_PostProcessor *pp,
615 */ 616 */
616static int 617static int
617process_value_to_boundary (struct MHD_PostProcessor *pp, 618process_value_to_boundary (struct MHD_PostProcessor *pp,
618 unsigned int *ioffptr, 619 size_t *ioffptr,
619 const char *boundary, 620 const char *boundary,
620 size_t blen, 621 size_t blen,
621 enum PP_State next_state, 622 enum PP_State next_state,
622 enum PP_State next_dash_state) 623 enum PP_State next_dash_state)
623{ 624{
624 char *buf = (char *) &pp[1]; 625 char *buf = (char *) &pp[1];
625 unsigned int newline; 626 size_t newline;
626 627
627 /* all data in buf until the boundary 628 /* all data in buf until the boundary
628 (\r\n--+boundary) is part of the value */ 629 (\r\n--+boundary) is part of the value */
@@ -716,12 +717,13 @@ free_unmarked (struct MHD_PostProcessor *pp)
716 */ 717 */
717static int 718static int
718post_process_multipart (struct MHD_PostProcessor *pp, 719post_process_multipart (struct MHD_PostProcessor *pp,
719 const char *post_data, unsigned int post_data_len) 720 const char *post_data,
721 size_t post_data_len)
720{ 722{
721 char *buf; 723 char *buf;
722 unsigned int max; 724 size_t max;
723 unsigned int ioff; 725 size_t ioff;
724 unsigned int poff; 726 size_t poff;
725 int state_changed; 727 int state_changed;
726 728
727 buf = (char *) &pp[1]; 729 buf = (char *) &pp[1];
@@ -999,7 +1001,7 @@ END:
999 */ 1001 */
1000int 1002int
1001MHD_post_process (struct MHD_PostProcessor *pp, 1003MHD_post_process (struct MHD_PostProcessor *pp,
1002 const char *post_data, unsigned int post_data_len) 1004 const char *post_data, size_t post_data_len)
1003{ 1005{
1004 if (post_data_len == 0) 1006 if (post_data_len == 0)
1005 return MHD_YES; 1007 return MHD_YES;