PullRequest

Dependents:   CyaSSL-Twitter-OAuth4Tw TweetTest NetworkThermometer CyaSSL-Twitter-OAuth4Tw_arrange

Fork of HTTPClient by wolf SSL

Revision:
32:7bc63b8646f6
Parent:
31:7fd621b83b60
Child:
33:81e61bd85dae
--- a/HTTPClient.cpp	Fri Jun 26 00:39:47 2015 +0000
+++ b/HTTPClient.cpp	Wed Jul 08 14:42:32 2015 +0000
@@ -53,7 +53,8 @@
 #include "TCPSocketConnection.h"
 
 static  TCPSocketConnection m_sock;
-#define CHUNK_SIZE    256
+#define CHUNK_SIZE    384
+#define MAX_PATH_SIZE 448
 #define SEND_BUF_SIZE 512
 static char send_buf[SEND_BUF_SIZE] ;
 static char *send_buf_p ;
@@ -234,7 +235,7 @@
 
     char scheme[8];
     char host[32];
-    char path[160];
+    char path[MAX_PATH_SIZE];
 
     int ret ;
 
@@ -325,13 +326,18 @@
     send_buf_p = send_buf ; // Reset send buffer ;
 
     const char* meth = (method==HTTP_GET)?"GET":(method==HTTP_POST)?"POST":(method==HTTP_PUT)?"PUT":(method==HTTP_DELETE)?"DELETE":"";
-    snprintf(buf, sizeof(buf), "%s %s HTTP/1.1\r\nHost: %s\r\n", meth, path, host); //Write request
+    snprintf(buf, sizeof(buf), "%s ", meth); //Write request
     ret = send(buf);
     if(ret) {
         m_sock.close();
         ERR("Could not write request");
         return HTTP_CONN;
     }
+    ret = send(path);
+    CHECK_CONN_ERR(ret);
+    snprintf(buf, sizeof(buf), " HTTP/1.1\r\nHost: %s\r\n", host);
+    ret = send(buf);
+    CHECK_CONN_ERR(ret);
 
     wait(0.1) ;