Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of HTTPServer by
Revision 17:032714af88a6, committed 2013-10-09
- Comitter:
- ollie8
- Date:
- Wed Oct 09 06:13:40 2013 +0000
- Parent:
- 16:cc3f5c53d0d5
- Commit message:
- Fixed bug in parsing of URL arguments
Changed in this revision
| HTTPConnection.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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;
}
}
}
