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.
Dependents: SalesforceInterface df-2014-heroku-thermostat-k64f SalesforceInterface
Fork of HTTPClient by
Revision 31:0675a342e45c, committed 2014-08-27
- Comitter:
- ansond
- Date:
- Wed Aug 27 21:19:58 2014 +0000
- Parent:
- 30:6fef375c94e6
- Child:
- 32:d9db238bb8a3
- Commit message:
- updates
Changed in this revision
| HTTPClient.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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 ;
}
