Fixed HTTP header key and value length.

Dependents:   SNIC-httpclient-example HTTPClient_HelloWorld

Fork of HTTPClient by Donatien Garnier

Revision:
20:f020c92bd1a2
Parent:
19:b09072f8c133
--- a/HTTPClient.cpp	Sun Oct 12 16:00:13 2014 +0000
+++ b/HTTPClient.cpp	Sat Nov 22 08:54:27 2014 +0000
@@ -42,7 +42,7 @@
 
 #define CHUNK_SIZE 256
 #define HEADER_KEY_MAXLENGTH   34
-#define HEADER_VALUE_MAXLENGTH 34
+#define HEADER_VALUE_MAXLENGTH 64
 
 #include <cstring>
 
@@ -281,8 +281,8 @@
   while( true )
   {
     crlfPtr = strstr(buf, "\r\n");
-  if(crlfPtr == NULL)
-  {
+    if(crlfPtr == NULL)
+    {
       if( trfLen < CHUNK_SIZE - 1 )
       {
         size_t newTrfLen;
@@ -295,8 +295,8 @@
       }
       else
       {
-    PRTCL_ERR();
-  }
+        PRTCL_ERR();
+      }
     }
     break;
   }
@@ -313,7 +313,7 @@
   if( sscanf(buf, "HTTP/%*d.%*d %d", &m_httpResponseCode) != 1 ) //Kludge for newlib nano
   {
     //Cannot match string, error
-    ERR("Not a correct HTTP answer : %s\n", buf);
+    ERR("Not a correct HTTP answer : %s", buf);
     PRTCL_ERR();
   }
 
@@ -400,7 +400,7 @@
     }
     if ( n == 2 )
     {
-      DBG("Read header : %s: %s\n", key, value);
+      DBG("Read header : %s: %s", key, value);
       if( !strcmp(key, "Content-Length") )
       {
         sscanf(value, "%d", &recvContentLength);