You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the new async core implementation, one thread is responsible for driving all of curl's functions. This includes streaming the request body. If the request body is not in memory and attempting to read from it blocks, then the entire agent thread is blocked and all requests will be effectively paused. This is obviously not good.
Devise a way to guarantee the ability to read the response body without blocking. Once we can do that, we can implement this in the following manner:
In the read callback, attempt to read without blocking. If the input stream would block, pause the request.
When the input stream becomes ready, unpause the request.
We should use well-established means of async I/O if possible. For example, if the input stream is a file, reading a file asynchronously is a can of worms not worth the effort (AIO, IOCP, thread pools).
One possible solution would be to simply copy the entire request body into memory up front.
The text was updated successfully, but these errors were encountered:
In the new async core implementation, one thread is responsible for driving all of curl's functions. This includes streaming the request body. If the request body is not in memory and attempting to read from it blocks, then the entire agent thread is blocked and all requests will be effectively paused. This is obviously not good.
Devise a way to guarantee the ability to read the response body without blocking. Once we can do that, we can implement this in the following manner:
read
callback, attempt to read without blocking. If the input stream would block, pause the request.We should use well-established means of async I/O if possible. For example, if the input stream is a file, reading a file asynchronously is a can of worms not worth the effort (AIO, IOCP, thread pools).
One possible solution would be to simply copy the entire request body into memory up front.
The text was updated successfully, but these errors were encountered: