Skip to content
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

Fixed a typo, changed timeout_ms cancellation time to be < 0 #479

Closed
wants to merge 2 commits into from

Conversation

BobbedBob
Copy link
Contributor

@BobbedBob BobbedBob commented Jan 20, 2025

修复拼写错误,更改timer_function中取消计时器的条件为小于零。
更改为小于零-1还可以正常使用,而且若timeout是-1一之外的负数,程序不会报错。
Fixed a typo, changed timeout_ms cancellation time to be < 0.
-1 can still be used normally, and if timeout is a negative number is -1, the program will not throw an exception.

Fixed a typo, changed timeout_ms cancellation time to be <=0
@BobbedBob BobbedBob changed the title Fixed a typo, changed timeout_ms cancellation time to be <=0 Fixed a typo, changed timeout_ms cancellation time to be < 0 Jan 20, 2025
@lexiforest
Copy link
Owner

Do you have any link to the documentation or code example that explains why timeout can be a negative number other than -1.

@BobbedBob
Copy link
Contributor Author

No, but it is possible to pass such an argument to the function, and it can act as a safeguard for when that happens if there's some sort of error with calculations.

@lexiforest
Copy link
Owner

I don't think that there will be any other negative values passed to this callback function. Unless there is bug in the libcurl implementation, I think we should adhere to what the libcurl doc says:

A timeout_ms value of -1 passed to this callback means you should delete the timer. All other values are valid expire times in number of milliseconds.

If you want to fix the typo, please open a separate PR.

@BobbedBob BobbedBob closed this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants