SendToHTTP broken (fix suggested?)

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Normal user
Posts: 1
Joined: 17 May 2016, 20:27

SendToHTTP broken (fix suggested?)

#1 Post by FtW64 » 09 Sep 2018, 11:05

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...

Core team member
Posts: 1268
Joined: 01 Sep 2017, 22:13
Location: the Netherlands

Re: SendToHTTP broken (fix suggested?)

#2 Post by TD-er » 09 Sep 2018, 21:50

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests