A HTTP Client library - increase receive buffer size
Dependents: Fx0Hackson_b Fx0Hackson HTTPClient_HelloWorld HTTPClient_POST ... more
Fork of HTTPClient by
Diff: HTTPClient.cpp
- Revision:
- 19:3c7789c521df
- Parent:
- 18:277279a1891e
- Child:
- 20:a0201b94b774
--- a/HTTPClient.cpp Wed May 07 16:48:10 2014 +0000 +++ b/HTTPClient.cpp Fri Jan 23 09:55:35 2015 +0000 @@ -41,6 +41,7 @@ #define MAX(x,y) (((x)>(y))?(x):(y)) #define CHUNK_SIZE 256 +#define BUF_SIZE 64 #include <cstring> @@ -364,14 +365,14 @@ buf[crlfPos] = '\0'; - char key[32]; - char value[32]; + char key[BUF_SIZE]; + char value[BUF_SIZE]; //key[31] = '\0'; //value[31] = '\0'; - memset(key, 0, 32); - memset(value, 0, 32); + memset(key, 0, BUF_SIZE); + memset(value, 0, BUF_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) < BUF_SIZE) { strcpy(key, buf); n++; char* valueStart = keyEnd + 2; if( (valueStart - buf) < crlfPos ) { - if(strlen(valueStart) < 32) + if(strlen(valueStart) < BUF_SIZE) { strcpy(value, valueStart); n++;