-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
receive buffer cleanups #1449
receive buffer cleanups #1449
Conversation
@bagder, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jrn, @dfandrich and @captain-caveman2k to be potential reviewers. |
b24b269
to
8330532
Compare
Test 1060 fails miserably if we allow the receive buffer to be smaller than about 16K, so I'm now considering either
|
It feels lame to limit the ability to set the receive buffer size because we need a buffer for |
Do you think there might be some logic issue in CONNECT that contributes to this, in other words a bug that is just separate from this issue? Say you make a separate buffer, and host foo sends an even larger amount than 1060, then maybe CONNECT would still fail? |
Yes, that's for sure. The CONNECT code is written to work with a fixed-size buffer and if the response is larger than so, it will break. So yes, that's a separate issue that should be worked on separately. But I would also expect that it is a very rare happening to see such big response to a CONNECT. |
8330532
to
412492e
Compare
Don't clobber the receive buffer.
The buffer is needed to receive FTP, HTTP CONNECT responses etc so already at this size things risk breaking and smaller is certainly not wise.
... instead of clobbering the download buffer.
Removes the need for CURL_BUFSIZE
To make it suitably independent of the receive buffer and its flexible size.
It was a wrong assumption that it could do that!
... to properly use the dynamically set buffer size!
The buffer can have other sizes.
412492e
to
b3caf9b
Compare
Here's a series of 18 smallish commits that cleans up buffer use all over libcurl. I want to make sure the receive buffer is only used for actually receiving data, and ultimately make sure our different buffers don't all reuse
BUFSIZE
so that we can have the buffers shrink/grow more independently and controlled.Changes include:
buffer_size
is always set and represents the current buffer size lengthbuffer_size
variable everywhere instead ofBUFSIZE
for receive buffer length since we've asked for a buffer of that size. Accessing the receive buffer beyondbuffer_size
should be a mistake/error.And since the buffer is actually used to receive data and some of our code cannot handle streaming data completely, the receive buffer must have a certain size to still let libcurl function properly. One patch in this set thus sets the minimum
buffer_size
to be 1024.