Giter Site home page Giter Site logo

Comments (6)

khoih-prog avatar khoih-prog commented on May 30, 2024

Hi @SeeliSoft-CH

Thanks for reporting the issue.

But sorry that no one can do anything, until you provide the complete MRE so that we can duplicate the issue.

Please do more tests to prove this is actually a bug of the library or just in your use-case (code / server, etc.)

BR,

from asynchttprequest_generic.

SeeliSoft-CH avatar SeeliSoft-CH commented on May 30, 2024

Hi @khoih-prog
I created a sample project to illustrate the problem.
Bug-Demo.txt
Serial Monitor Output.txt

In this sample the call is performed at every 5 seconds. Every second call returns in a 400 bad request error (hostname header is missing).
What I can already take ahead: the issue exactly always happens when it prints "already connected".

If I change the intervall to 10 seconds, the issue won't appear, as it will always open a new connection.

[AHTTP] open( GET , url = http://www.seelisoft.net/test.html
[AHTTP] open: connecting to hostname = www.seelisoft.net:80
HTTP code: 200

[AHTTP] open( GET , url = http://www.seelisoft.net/test.html
[AHTTP] open: already connected
HTTP code: 400

That is what apache complains about:
AH00569: client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23)
I'm not sure if only hostname header is not sent or no headers at all (user-agent, etc).

Hope that helps.

from asynchttprequest_generic.

khoih-prog avatar khoih-prog commented on May 30, 2024

HI @SeeliSoft-CH

Sorry I couldn't duplicate the issue using the example with 5s request interval, even with more complex site, Check the debug terminal with timestamps.

http://worldtimeapi.org/api/timezone/America/Toronto.txt

Possibly something wrong ( not compatible / slow network , etc.) of your http site. Try to investigate and fix.

Good Luck,

Terminal

22:15:09.158 -> Starting AsyncHTTPRequest_ESP using ESP32_DEV
22:15:09.158 -> AsyncHTTPRequest_Generic v1.10.1
22:15:09.257 -> Connecting to WiFi SSID: HueNet1
22:15:09.755 -> .......
22:15:12.775 -> AsyncHTTPRequest @ IP : 192.168.2.80
22:15:12.775 -> [AHTTP] open( GET , url = http://worldtimeapi.org/api/timezone/America/Toronto.txt
22:15:12.775 -> [AHTTP] open: connecting to hostname = worldtimeapi.org:80
22:15:12.775 -> [AHTTP] _client->connecting to worldtimeapi.org , 80
22:15:12.775 -> [AHTTP] client.connect OK to worldtimeapi.org , 80
22:15:13.073 -> [AHTTP] 
22:15:13.073 -> **************************************
22:15:13.073 -> [AHTTP] Response Code =  HTTP OK
22:15:13.073 -> 
22:15:13.073 -> **************************************
22:15:13.073 -> abbreviation: EST
22:15:13.073 -> client_ip: 65.110.220.219
22:15:13.073 -> datetime: 2022-11-09T22:15:12.992905-05:00
22:15:13.073 -> day_of_week: 3
22:15:13.073 -> day_of_year: 313
22:15:13.073 -> dst: false
22:15:13.073 -> dst_from: 
22:15:13.107 -> dst_offset: 0
22:15:13.107 -> dst_until: 
22:15:13.107 -> raw_offset: -18000
22:15:13.107 -> timezone: America/Toronto
22:15:13.107 -> unixtime: 1668050112
22:15:13.107 -> utc_datetime: 2022-11-10T03:15:12.992905+00:00
22:15:13.107 -> utc_offset: -05:00
22:15:13.107 -> week_number: 45
22:15:13.107 -> **************************************
22:15:17.753 -> [AHTTP] open( GET , url = http://worldtimeapi.org/api/timezone/America/Toronto.txt
22:15:17.753 -> [AHTTP] open: already connected
22:15:18.085 -> [AHTTP] 
22:15:18.085 -> **************************************
22:15:18.085 -> [AHTTP] Response Code =  HTTP OK
22:15:18.085 -> 
22:15:18.085 -> **************************************
22:15:18.085 -> abbreviation: EST
22:15:18.085 -> client_ip: 65.110.220.219
22:15:18.085 -> datetime: 2022-11-09T22:15:17.987679-05:00
22:15:18.085 -> day_of_week: 3
22:15:18.085 -> day_of_year: 313
22:15:18.085 -> dst: false
22:15:18.085 -> dst_from: 
22:15:18.085 -> dst_offset: 0
22:15:18.085 -> dst_until: 
22:15:18.085 -> raw_offset: -18000
22:15:18.085 -> timezone: America/Toronto
22:15:18.085 -> unixtime: 1668050117
22:15:18.085 -> utc_datetime: 2022-11-10T03:15:17.987679+00:00
22:15:18.085 -> utc_offset: -05:00
22:15:18.085 -> week_number: 45
22:15:18.085 -> **************************************
22:15:22.762 -> [AHTTP] open( GET , url = http://worldtimeapi.org/api/timezone/America/Toronto.txt
22:15:22.762 -> [AHTTP] open: already connected
22:15:22.762 -> H[AHTTP] 
22:15:23.127 -> **************************************
22:15:23.127 -> [AHTTP] Response Code =  HTTP OK
22:15:23.127 -> 
22:15:23.127 -> **************************************
22:15:23.127 -> abbreviation: EST
22:15:23.127 -> client_ip: 65.110.220.219
22:15:23.127 -> datetime: 2022-11-09T22:15:23.038722-05:00
22:15:23.127 -> day_of_week: 3
22:15:23.127 -> day_of_year: 313
22:15:23.127 -> dst: false
22:15:23.127 -> dst_from: 
22:15:23.160 -> dst_offset: 0
22:15:23.160 -> dst_until: 
22:15:23.160 -> raw_offset: -18000
22:15:23.160 -> timezone: America/Toronto
22:15:23.160 -> unixtime: 1668050123
22:15:23.160 -> utc_datetime: 2022-11-10T03:15:23.038722+00:00
22:15:23.160 -> utc_offset: -05:00
22:15:23.160 -> week_number: 45
22:15:23.160 -> **************************************
22:15:27.768 -> [AHTTP] open( GET , url = http://worldtimeapi.org/api/timezone/America/Toronto.txt
22:15:27.768 -> [AHTTP] open: already connected
22:15:28.067 -> [AHTTP] 
22:15:28.067 -> **************************************
22:15:28.067 -> [AHTTP] Response Code =  HTTP OK
22:15:28.067 -> 
22:15:28.067 -> **************************************
22:15:28.067 -> abbreviation: EST
22:15:28.067 -> client_ip: 65.110.220.219
22:15:28.067 -> datetime: 2022-11-09T22:15:27.990358-05:00
22:15:28.067 -> day_of_week: 3
22:15:28.067 -> day_of_year: 313
22:15:28.067 -> dst: false
22:15:28.067 -> dst_from: 
22:15:28.100 -> dst_offset: 0
22:15:28.100 -> dst_until: 
22:15:28.100 -> raw_offset: -18000
22:15:28.100 -> timezone: America/Toronto
22:15:28.100 -> unixtime: 1668050127
22:15:28.100 -> utc_datetime: 2022-11-10T03:15:27.990358+00:00
22:15:28.100 -> utc_offset: -05:00
22:15:28.100 -> week_number: 45
22:15:28.100 -> **************************************


from asynchttprequest_generic.

khoih-prog avatar khoih-prog commented on May 30, 2024

HI @SeeliSoft-CH

Anyway, I'll create and release a new version to default to resend headers, etc. after already connected, to avoid error with new Apache Webserver

The test is OK with 5s between request now, w/o Bad Requests

23:11:33.395 -> Starting AsyncHTTPRequest_ESP using ESP32_DEV
23:11:33.395 -> AsyncHTTPRequest_Generic v1.10.2
23:11:33.494 -> Connecting to WiFi SSID: HueNet1
23:11:33.992 -> ...
23:11:35.020 -> AsyncHTTPRequest @ IP : 192.168.2.80
23:11:35.020 -> [AHTTP] open( GET , url = http://www.seelisoft.net/test.html
23:11:35.020 -> [AHTTP] open: connecting to hostname = www.seelisoft.net:80
23:11:35.020 -> [AHTTP] _client->connecting to www.seelisoft.net , 80
23:11:35.020 -> [AHTTP] client.connect OK to www.seelisoft.net , 80
23:11:35.451 -> [AHTTP] 
23:11:35.451 -> **************************************
23:11:35.451 -> [AHTTP] Response Code =  HTTP OK
23:11:35.451 -> 
23:11:35.451 -> **************************************
23:11:35.451 -> OK!
23:11:35.451 -> **************************************
23:11:40.029 -> [AHTTP] open( GET , url = http://www.seelisoft.net/test.html
23:11:40.029 -> [AHTTP] open: connecting to hostname = www.seelisoft.net:80
23:11:40.460 -> [AHTTP] 
23:11:40.460 -> **************************************
23:11:40.460 -> [AHTTP] Response Code =  HTTP OK
23:11:40.460 -> 
23:11:40.460 -> **************************************
23:11:40.460 -> OK!
23:11:40.460 -> **************************************
23:11:45.004 -> [AHTTP] open( GET , url = http://www.seelisoft.net/test.html
23:11:45.004 -> [AHTTP] open: connecting to hostname = www.seelisoft.net:80
23:11:45.004 -> H[AHTTP] 
23:11:45.468 -> **************************************
23:11:45.468 -> [AHTTP] Response Code =  HTTP OK
23:11:45.468 -> 
23:11:45.468 -> **************************************
23:11:45.468 -> OK!
23:11:45.468 -> **************************************
23:11:50.013 -> [AHTTP] open( GET , url = http://www.seelisoft.net/test.html
23:11:50.013 -> [AHTTP] open: connecting to hostname = www.seelisoft.net:80
23:11:50.511 -> [AHTTP] 
23:11:50.511 -> **************************************
23:11:50.511 -> [AHTTP] Response Code =  HTTP OK
23:11:50.511 -> 
23:11:50.511 -> **************************************
23:11:50.511 -> OK!
23:11:50.511 -> **************************************
23:11:55.020 -> [AHTTP] open( GET , url = http://www.seelisoft.net/test.html
23:11:55.020 -> [AHTTP] open: connecting to hostname = www.seelisoft.net:80
23:11:55.020 -> H[AHTTP] 
23:11:55.518 -> **************************************
23:11:55.518 -> [AHTTP] Response Code =  HTTP OK
23:11:55.518 -> 
23:11:55.518 -> **************************************
23:11:55.518 -> OK!
23:11:55.518 -> **************************************
23:12:00.028 -> [AHTTP] open( GET , url = http://www.seelisoft.net/test.html
23:12:00.028 -> [AHTTP] open: connecting to hostname = www.seelisoft.net:80
23:12:00.426 -> [AHTTP] 
23:12:00.426 -> **************************************
23:12:00.426 -> [AHTTP] Response Code =  HTTP OK
23:12:00.426 -> 
23:12:00.426 -> **************************************
23:12:00.426 -> OK!
23:12:00.426 -> **************************************

from asynchttprequest_generic.

khoih-prog avatar khoih-prog commented on May 30, 2024

Hi @SeeliSoft-CH

The new AsyncHTTPRequest_Generic v1.10.2 has just been published. Your contribution is noted in Contributions and Thanks

Please test and report more bugs.

Best Regards,


Releases v1.10.2

  1. Default to reconnect to the same host:port after connected for new HTTP sites. Check Host/Headers not always sent with 1.10.1 #44
  2. Update Packages' Patches

from asynchttprequest_generic.

SeeliSoft-CH avatar SeeliSoft-CH commented on May 30, 2024

Many many thanks! I can confirm it's working fine.

from asynchttprequest_generic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.