HTTPClient
Fork of HTTPClient by
Diff: HTTPClient.cpp
- Revision:
- 19:1211b05ba323
- Parent:
- 18:277279a1891e
--- a/HTTPClient.cpp Wed May 07 16:48:10 2014 +0000 +++ b/HTTPClient.cpp Fri Oct 10 09:41:01 2014 +0000 @@ -41,6 +41,7 @@ #define MAX(x,y) (((x)>(y))?(x):(y)) #define CHUNK_SIZE 256 +#define KEYVALUE_SIZE 48 #include <cstring> @@ -364,14 +365,14 @@ buf[crlfPos] = '\0'; - char key[32]; - char value[32]; + char key[KEYVALUE_SIZE]; + char value[KEYVALUE_SIZE]; //key[31] = '\0'; //value[31] = '\0'; - memset(key, 0, 32); - memset(value, 0, 32); + memset(key, 0, KEYVALUE_SIZE); + memset(value, 0, KEYVALUE_SIZE); //int n = sscanf(buf, "%31[^:]: %31[^\r\n]", key, value); @@ -381,14 +382,14 @@ if(keyEnd != NULL) { *keyEnd = '\0'; - if(strlen(buf) < 32) + if(strlen(buf) < KEYVALUE_SIZE) { strcpy(key, buf); n++; char* valueStart = keyEnd + 2; if( (valueStart - buf) < crlfPos ) { - if(strlen(valueStart) < 32) + if(strlen(valueStart) < KEYVALUE_SIZE) { strcpy(value, valueStart); n++;