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

340bb19 breaks intended usage of curl_multi_assign #8480

Closed
m6w6 opened this issue Feb 20, 2022 · 2 comments
Closed

340bb19 breaks intended usage of curl_multi_assign #8480

m6w6 opened this issue Feb 20, 2022 · 2 comments

Comments

@m6w6
Copy link
Contributor

@m6w6 m6w6 commented Feb 20, 2022

I did this

Watched CI break with curl 7.81.

Seriously, 340bb19 breaks the intended usage of curl_multi_assign.

Quoting docs:

In a typical application you allocate a struct or at least use some kind of semi-dynamic data for each socket that we must wait for action on when using the curl_multi_socket_action approach.

When our socket-callback gets called by libcurl and we get to know about yet another socket to wait for, we can use curl_multi_assign to point out the particular data so that when we get updates about this same socket again, we do not have to find the struct associated with this socket by ourselves.

I expected the following

curl_multi_assign to work from within callbacks.

Coincidentally, docs/examples/hiperfifo.c and docs/examples/multi-event.c are broken, too.

curl/libcurl version

7.81/master

operating system

POSIX

jay added a commit to jay/curl that referenced this issue Feb 20, 2022
Several years ago a change was made to block user callbacks from calling
back into the API when not supported (recursive calls). One of the calls
blocked was curl_multi_assign. Recently the blocking was extended to the
multi interface API, however curl_multi_assign may need to be called
from within those user callbacks (eg CURLMOPT_SOCKETFUNCTION).

I can't think of any callback where it would be unsafe to call
curl_multi_assign so I removed the restriction entirely.

Reported-by: Michael Wallner

Ref: curl@b46cfbc
Ref: curl@340bb19

Fixes curl#8480
Closes #xxxx
@jay
Copy link
Member

@jay jay commented Feb 20, 2022

try #8483

jay added a commit to jay/curl that referenced this issue Feb 20, 2022
Several years ago a change was made to block user callbacks from calling
back into the API when not supported (recursive calls). One of the calls
blocked was curl_multi_assign. Recently the blocking was extended to the
multi interface API, however curl_multi_assign may need to be called
from within those user callbacks (eg CURLMOPT_SOCKETFUNCTION).

I can't think of any callback where it would be unsafe to call
curl_multi_assign so I removed the restriction entirely.

Reported-by: Michael Wallner

Ref: curl@b46cfbc
Ref: curl@340bb19

Fixes curl#8480
Closes #xxxx
@jay
Copy link
Member

@jay jay commented Feb 21, 2022

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants