osmcode / pyosmium

Python bindings for libosmium
https://osmcode.org/pyosmium
BSD 2-Clause "Simplified" License
317 stars 65 forks source link

Simplify handling of custom request parameters #215

Closed lonvia closed 2 years ago

lonvia commented 2 years ago

The requests library seems to ignore socket timeouts with the result that newer versions of the pyosmium tools may hang again on a bad network connection. There is no global parameter to set timeouts in requests, so the whole code needs to be rearranged a bit.

ReplicationServer now has an extra function set_request_parameter() with which extra parameters for requests.get() can be set. This is not only used for timeouts but also to hand in the cookies.

Overwriting the open_url() function should no longer be necessary. You can set proxies, authentication, certificates etc. all with the new function.