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 HTTPClient by
Revision 19:57e8fcee7331, committed 2015-01-28
- Comitter:
- dmitryp
- Date:
- Wed Jan 28 11:37:55 2015 +0000
- Parent:
- 18:277279a1891e
- Commit message:
- Added support for Vodafone K4606, for details refer to http://atmega.magictale.com/2215/hacking-vodafone-k4606-3g-hsdpa-usb-modem/
Changed in this revision
HTTPClient.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/HTTPClient.cpp Wed May 07 16:48:10 2014 +0000 +++ b/HTTPClient.cpp Wed Jan 28 11:37:55 2015 +0000 @@ -33,6 +33,8 @@ #endif +#define KEY_VAL_BUF_SIZE 60 + #define HTTP_PORT 80 #define OK 0 @@ -364,14 +366,14 @@ buf[crlfPos] = '\0'; - char key[32]; - char value[32]; + char key[KEY_VAL_BUF_SIZE]; + char value[KEY_VAL_BUF_SIZE]; //key[31] = '\0'; //value[31] = '\0'; - memset(key, 0, 32); - memset(value, 0, 32); + memset(key, 0, KEY_VAL_BUF_SIZE); + memset(value, 0, KEY_VAL_BUF_SIZE); //int n = sscanf(buf, "%31[^:]: %31[^\r\n]", key, value); @@ -380,15 +382,22 @@ char* keyEnd = strchr(buf, ':'); if(keyEnd != NULL) { +//DBG("Test01 : %u\n", strlen(buf)); + *keyEnd = '\0'; - if(strlen(buf) < 32) + +//DBG("Test02 : %u\n", strlen(buf)); + + if(strlen(buf) < KEY_VAL_BUF_SIZE) { strcpy(key, buf); n++; char* valueStart = keyEnd + 2; + +//DBG("Test03 : %u, %u\n", valueStart - buf, crlfPos); if( (valueStart - buf) < crlfPos ) { - if(strlen(valueStart) < 32) + if(strlen(valueStart) < KEY_VAL_BUF_SIZE) { strcpy(value, valueStart); n++;