Got modem to work with MedSentry website. Includes minor change to a library file.

Dependencies:   CyaSSL

Dependents:   MTS-Socket

Fork of HTTPClient-SSL by MultiTech

Revision:
31:0675a342e45c
Parent:
30:6fef375c94e6
Child:
32:d9db238bb8a3
--- a/HTTPClient.cpp	Wed Aug 27 21:00:02 2014 +0000
+++ b/HTTPClient.cpp	Wed Aug 27 21:19:58 2014 +0000
@@ -331,7 +331,7 @@
     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 %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n", meth, path, host); //Write request
     ret = send(buf);
     if(ret) {
         m_sock.close();
@@ -343,8 +343,8 @@
 
     //Send default headers
     DBG("Sending headers");
-    if(m_basicAuthUser) {
-            bAuth() ; /* send out Basic Auth header */        
+    if(m_basicAuthUser && m_basicAuthPassword) {
+        bAuth() ; /* send out Basic Auth header */        
     }
     if( pDataOut != NULL ) {
         if( pDataOut->getIsChunked() ) {
@@ -509,7 +509,7 @@
             } else if( !strcmp(key, "Content-Type") ) {
                 pDataIn->setDataType(value);
             } else if( !strcmp(key, "location") && redirect_url) {
-                sscanf(buf, "%31[^:]: %128[^\r\n]", key, redirect_url);
+                sscanf(buf, "%40[^:]: %128[^\r\n]", key, redirect_url);
                 DBG("Redirect %s: %s", key, redirect_url) ;
                 redirect = 1 ;
             }