Team E1
Fork of HTTPServer by
Diff: HTTPConnection.cpp
- Revision:
- 17:032714af88a6
- Parent:
- 16:cc3f5c53d0d5
diff -r cc3f5c53d0d5 -r 032714af88a6 HTTPConnection.cpp --- a/HTTPConnection.cpp Sat Aug 17 16:17:55 2013 +0000 +++ b/HTTPConnection.cpp Wed Oct 09 06:13:40 2013 +0000 @@ -231,12 +231,10 @@ for (int i = 0; i < buflen ; i++) { if (args_start == -1) { // args section not yet found if (buffer[i] == '?') { // starts with a question mark, so got it - buffer[i] = 0; - args_start = i; // set the start of the args section + args_start = i+1; // set the start of the args section INFO("Argument section found !"); } - } - else { // search arg-value touples + } else { // search arg-value touples if (argname == NULL) { // arg-name found ? if (buffer[i] == '=') { // yes, separate the arg-name @@ -244,9 +242,10 @@ argname = &buffer[args_start]; value_start = i+1; INFO("Argument name %s", argname); + } else if (args_start == -2) { + args_start = i; } - } - else { // search for end of value + } else { // search for end of value if ((buffer[i] == '&') || (buffer[i] == 0) || (buffer[i] == '\r') || (buffer[i] == '\n')) { buffer[i] = 0; valuename = &buffer[value_start]; @@ -255,6 +254,7 @@ // reset all indicators argname = NULL; valuename = NULL; + args_start = -2; } } }