Skip to content

Commit 967f1bb

Browse files
committed
Update state on connect
1 parent 9b83da4 commit 967f1bb

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Diff for: src/HttpClient.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -858,5 +858,18 @@ int HttpClient::readHeader()
858858
return c;
859859
}
860860

861+
int HttpClient::connect(IPAddress ip, uint16_t port) {
862+
this->iServerName = NULL;
863+
this->iServerAddress = ip;
864+
this-> iServerPort = port;
865+
return iClient->connect(ip, port);
866+
};
867+
int HttpClient::connect(const char *host, uint16_t port) {
868+
this->iServerName = host;
869+
this->iServerAddress = IPAddress();
870+
this-> iServerPort = port;
871+
return iClient->connect(host, port);
872+
};
873+
861874

862875

Diff for: src/HttpClient.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ class HttpClient : public Client
310310
virtual void flush() { iClient->flush(); };
311311

312312
// Inherited from Client
313-
virtual int connect(IPAddress ip, uint16_t port) { return iClient->connect(ip, port); };
314-
virtual int connect(const char *host, uint16_t port) { return iClient->connect(host, port); };
313+
virtual int connect(IPAddress ip, uint16_t port);
314+
virtual int connect(const char *host, uint16_t port);
315315
virtual void stop();
316316
virtual uint8_t connected() { return iClient->connected(); };
317317
virtual operator bool() { return bool(iClient); };

0 commit comments

Comments
 (0)