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: Car_Bon_car_module
Fork of HTTPClient by
Revision 21:d33f7e1ce811, committed 2014-02-09
- Comitter:
- WiredHome
- Date:
- Sun Feb 09 22:25:28 2014 +0000
- Parent:
- 20:4ea5255c1b04
- Child:
- 22:f6a3fcf48751
- Commit message:
- Revise interface to Basic Auth credentials so it will cache them locally
Changed in this revision
| HTTPClient.cpp | Show annotated file Show diff for this revision Revisions of this file |
| HTTPClient.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/HTTPClient.cpp Sun Feb 02 16:47:06 2014 +0000
+++ b/HTTPClient.cpp Sun Feb 09 22:25:28 2014 +0000
@@ -58,8 +58,19 @@
void HTTPClient::basicAuth(const char* user, const char* password) //Basic Authentification
{
+ #if 1
+ if (m_basicAuthUser)
+ free(m_basicAuthUser);
+ m_basicAuthUser = (char *)malloc(strlen(user)+1);
+ strcpy(m_basicAuthUser, user);
+ if (m_basicAuthPassword)
+ free(m_basicAuthPassword);
+ m_basicAuthPassword = (char *)malloc(strlen(password)+1);
+ strcpy(m_basicAuthPassword, password);
+ #else
m_basicAuthUser = user;
m_basicAuthPassword = password;
+ #endif
}
void HTTPClient::customHeaders(const char **headers, size_t pairs)
--- a/HTTPClient.h Sun Feb 02 16:47:06 2014 +0000
+++ b/HTTPClient.h Sun Feb 09 22:25:28 2014 +0000
@@ -168,8 +168,8 @@
int m_timeout;
- const char* m_basicAuthUser;
- const char* m_basicAuthPassword;
+ char* m_basicAuthUser;
+ char* m_basicAuthPassword;
const char** m_customHeaders;
size_t m_nCustomHeaders;
int m_httpResponseCode;
