better

Fork of HTTPClient by Donatien Garnier

Revision:
20:b3dec7d44375
Parent:
19:4609f454f8a3
diff -r 4609f454f8a3 -r b3dec7d44375 HTTPClient.cpp
--- a/HTTPClient.cpp	Fri Jan 15 04:24:14 2016 +0000
+++ b/HTTPClient.cpp	Fri Jan 15 09:12:01 2016 +0000
@@ -57,13 +57,13 @@
 
 }
 
-#if 1
+
 void HTTPClient::basicAuth(const char* user, const char* password) //Basic Authentification
 {
   m_basicAuthUser = user;
   m_basicAuthPassword = password;
 }
-#endif
+
 
 HTTPResult HTTPClient::get(const char* url, IHTTPDataIn* pDataIn, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking
 {
@@ -127,7 +127,7 @@
   char scheme[8];
   uint16_t port;
   char host[32];
-  char path[64];
+  char path[512];
   //First we need to parse the url (http[s]://host[:port][/[path]]) -- HTTPS not supported (yet?)
   HTTPResult res = parseURL(url, scheme, sizeof(scheme), host, sizeof(host), &port, path, sizeof(path));
   if(res != HTTP_OK)
@@ -364,14 +364,14 @@
 
     buf[crlfPos] = '\0';
 
-    char key[32];
-    char value[32];
+    char key[128];
+    char value[128];
 
     //key[31] = '\0';
     //value[31] = '\0';
 
-    memset(key, 0, 32);
-    memset(value, 0, 32);
+    memset(key, 0, 128);
+    memset(value, 0, 128);
 
     //int n = sscanf(buf, "%31[^:]: %31[^\r\n]", key, value);
     
@@ -381,7 +381,7 @@
     if(keyEnd != NULL)
     {
       *keyEnd = '\0';
-      if(strlen(buf) < 32)
+      if(strlen(buf) < 128)
       {
         strcpy(key, buf);
         n++;