-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http_GET vs http_client.get #715
Comments
Bonus: maybe |
I think this makes sense.
It could replace our own HTTP client implementation in |
The But: I experienced problems in the past with the number of open connections exceeding 1024. I was not able to find the cause. So for now I just used this SystemD config:
(you can achieve the same with |
Agreed.
I've encountered this error after sending multiple requests using HTTP pipelining (with |
Alright. |
MOTIS currently only uses |
Why are there two methods to perform HTTP calls?
http_client.get()
(defined in src/http_client.cc)http_GET()
(defined in src/http_req.cc)I wrote some code to test both: https://github.com/sncf-connect-tech/motis/blob/test-http/exe/main.cc#L143
The problem with
http_GET()
is that it does not support proxies.It's used for example in https://github.com/motis-project/motis/blob/master/src/rt_update.cc#L76.
We would like to use a proxy in that case, so using
http_client
would be handier.http_GET
does not seem used anywhere else.Would you be OK to replace
http_GET
byhttp_client.get()
insrc/rt_update.cc
,and use the
proxy
in the config file if it's set?Side notes:
Once compiled, the modified
motis
command in https://github.com/sncf-connect-tech/motis/tree/test-http can be used like this:The first command seems to "hang" in my environment.
Also, when launching a local Python HTTP server with
python -m http.server
(tested with Python 3.10 & 3.12),if I target
http://localhost:8000
intest-http_GET
instead ofhttps://httpbin.org/get
, I get this error:The text was updated successfully, but these errors were encountered: