alexcrichton / curl-rust

Rust bindings to libcurl
MIT License
1k stars 234 forks source link

Use CURLOPT_TIMEOUT if timeout too big #495

Closed LorenzoLeonardo closed 1 year ago

LorenzoLeonardo commented 1 year ago

i32 has a max of 2147483647, if the timeout duration is too big, it causes an overflow.

LorenzoLeonardo commented 1 year ago

Hello @alexcrichton and @sagebind kindly review this change. Thank you very much

alexcrichton commented 1 year ago

Thanks! I left a few other follow up thoughts on https://github.com/alexcrichton/curl-rust/pull/497 to handle a few more edge cases here, and if those are applied here too I can merge. If you're up for it I'd also appreciate test which assert the error cases here too.

LorenzoLeonardo commented 1 year ago

It seems there are test error not related to the change.

LorenzoLeonardo commented 1 year ago

it is ok now

alexcrichton commented 1 year ago

Ah I think this needs a rebase but otherwise looks good!

LorenzoLeonardo commented 1 year ago

rebasing and fixing conflict done.