From 93d57fabe23687d0e0bddb6739b1795d6fe92e3f Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 27 Jan 2016 13:45:10 +0300 Subject: [PATCH] Remove overloads of HTTPClient::begin which take const char* Since the data is stored as Strings internally, these methods do not serve as an optimisation --- .../src/ESP8266HTTPClient.cpp | 27 ++----------------- .../ESP8266HTTPClient/src/ESP8266HTTPClient.h | 5 +--- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index fd11c0360..d39511140 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -78,15 +78,6 @@ HTTPClient::~HTTPClient() { } } -/** - * phasing the url for all needed informations - * @param url const char * - * @param httpsFingerprint const char * - */ -void HTTPClient::begin(const char *url, const char * httpsFingerprint) { - begin(String(url), String(httpsFingerprint)); -} - /** * phasing the url for all needed informations * @param url String @@ -158,18 +149,7 @@ void HTTPClient::begin(String url, String httpsFingerprint) { } -/** - * begin - * @param host const char * - * @param port uint16_t - * @param url const char * - * @param https bool - * @param httpsFingerprint const char * - */ -void HTTPClient::begin(const char *host, uint16_t port, const char * url, bool https, const char * httpsFingerprint) { - - DEBUG_HTTPCLIENT("[HTTP-Client][begin] host: %s port:%d url: %s https: %d httpsFingerprint: %s\n", host, port, url, https, httpsFingerprint); - +void HTTPClient::begin(String host, uint16_t port, String url, bool https, String httpsFingerprint) { _host = host; _port = port; _url = url; @@ -181,10 +161,7 @@ void HTTPClient::begin(const char *host, uint16_t port, const char * url, bool h _Headers = ""; -} - -void HTTPClient::begin(String host, uint16_t port, String url, bool https, String httpsFingerprint) { - begin(host.c_str(), port, url.c_str(), https, httpsFingerprint.c_str()); + DEBUG_HTTPCLIENT("[HTTP-Client][begin] host: %s port:%d url: %s https: %d httpsFingerprint: %s\n", host, port, url, https, httpsFingerprint); } /** diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h index 0b865c2a6..c83f482df 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h @@ -125,14 +125,11 @@ class HTTPClient { HTTPClient(); ~HTTPClient(); - void begin(const char *url, const char * httpsFingerprint = ""); void begin(String url, String httpsFingerprint = ""); - - void begin(const char *host, uint16_t port, const char * url = "/", bool https = false, const char * httpsFingerprint = ""); void begin(String host, uint16_t port, String url = "/", bool https = false, String httpsFingerprint = ""); void end(void); - + bool connected(void); void setReuse(bool reuse); /// keep-alive