Skip to content

Commit

Permalink
Bypass when POST length unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
kvic-z committed Dec 10, 2017
1 parent 76b42b8 commit 0063f76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions socket_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,11 @@ void* conn_handler( void *ptr )
int length = 0;
int post_buf_size = 0;
int wait_cnt = 0;
char *h = strstr(bufptr, "Content-Length: ");
char *h = strstr(bufptr, "Content-Length:");

h += strlen("Content-Length: ");
if (!h)
goto end_post;
h += strlen("Content-Length:");
length = atoi(strtok(h, "\r\n"));

log_msg(LGG_DEBUG, "POST socket: %d Content-Length: %d", new_fd, length);
Expand Down

0 comments on commit 0063f76

Please sign in to comment.