Page 1 of 1

SendToHTTP broken (fix suggested?)

Posted: 09 Sep 2018, 11:05
by FtW64
I'm using the 20180908 build of ESPEasy-mega, compiling with PlatformIO: normal_ESP8266_4096.

I have noticed that SendToHTTP (in a rule) does make a TCP connection to the specified host:port, but no data is actually transmitted over TCP. The command just opens a new TCP connection (Syn, Syn-Ack, Ack), then closes the connection. There is no actual HTTP request.

Could this be due to the fact the src/Commands/HTTP.c file (line 27) should read:

Code: Select all

if (client.connect(host.c_str(), port_int) != 0) {
instead of (the current code):

Code: Select all

if (client.connect(host.c_str(), port_int) != 1) {
(sorry, I have no idea how to report this on github, etc).

When I change the code, recompile and test, SendToHTTP seems to work fine for me...

Re: SendToHTTP broken (fix suggested?)

Posted: 09 Sep 2018, 21:50
by TD-er
I guess you're right.
I will make a fix and also have a look at all other occurrences of client.connect.

Thanks for reporting.