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.
Diff: HTTPClient.cpp
- Revision:
- 19:a0d9edb403e5
- Parent:
- 18:277279a1891e
- Child:
- 20:f94e8df3b95d
--- a/HTTPClient.cpp Wed May 07 16:48:10 2014 +0000
+++ b/HTTPClient.cpp Fri Mar 20 14:17:14 2015 +0000
@@ -41,6 +41,7 @@
#define MAX(x,y) (((x)>(y))?(x):(y))
#define CHUNK_SIZE 256
+#define BUF_SIZE 128
#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++;