[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 60/254: pingpong: use the set buffer size
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 60/254: pingpong: use the set buffer size |
Date: |
Sat, 17 Jun 2017 16:51:32 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit b8191e975faa7810ed3d858205b0b3f0d297f0b2
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Apr 25 00:50:04 2017 +0200
pingpong: use the set buffer size
---
lib/pingpong.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/lib/pingpong.c b/lib/pingpong.c
index b833fcd4c..5ed79b718 100644
--- a/lib/pingpong.c
+++ b/lib/pingpong.c
@@ -286,7 +286,8 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
/* number of bytes in the current line, so far */
perline = (ssize_t)(ptr-pp->linestart_resp);
- while((pp->nread_resp<BUFSIZE) && (keepon && !result)) {
+ while((pp->nread_resp < (size_t)data->set.buffer_size) &&
+ (keepon && !result)) {
if(pp->cache) {
/* we had data in the "cache", copy that instead of doing an actual
@@ -296,7 +297,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
* it would have been populated with something of size int to begin
* with, even though its datatype may be larger than an int.
*/
- DEBUGASSERT((ptr+pp->cache_size) <= (buf+BUFSIZE+1));
+ DEBUGASSERT((ptr+pp->cache_size) <= (buf+data->set.buffer_size+1));
memcpy(ptr, pp->cache, pp->cache_size);
gotbytes = (ssize_t)pp->cache_size;
free(pp->cache); /* free the cache */
@@ -308,8 +309,10 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
enum protection_level prot = conn->data_prot;
conn->data_prot = PROT_CLEAR;
#endif
- DEBUGASSERT((ptr+BUFSIZE-pp->nread_resp) <= (buf+BUFSIZE+1));
- result = Curl_read(conn, sockfd, ptr, BUFSIZE-pp->nread_resp,
+ DEBUGASSERT((ptr + data->set.buffer_size - pp->nread_resp) <=
+ (buf + data->set.buffer_size + 1));
+ result = Curl_read(conn, sockfd, ptr,
+ data->set.buffer_size - pp->nread_resp,
&gotbytes);
#ifdef HAVE_GSSAPI
DEBUGASSERT(prot > PROT_NONE && prot < PROT_LAST);
@@ -402,7 +405,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
}
else if(keepon) {
- if((perline == gotbytes) && (gotbytes > BUFSIZE/2)) {
+ if((perline == gotbytes) && (gotbytes > data->set.buffer_size/2)) {
/* We got an excessive line without newlines and we need to deal
with it. We keep the first bytes of the line then we throw
away the rest. */
@@ -414,7 +417,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
interested in the first piece */
clipamount = 40;
}
- else if(pp->nread_resp > BUFSIZE/2) {
+ else if(pp->nread_resp > (size_t)data->set.buffer_size/2) {
/* We got a large chunk of data and there's potentially still
trailing data to take care of, so we put any such part in the
"cache", clear the buffer to make space and restart. */
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 173/254: TODO: 6.4 is done, send telnet data in chunks, (continued)
- [GNUnet-SVN] [gnurl] 173/254: TODO: 6.4 is done, send telnet data in chunks, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 221/254: BINDINGS: add Ring binding, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 216/254: x509asn1: fix implicit-fallthrough warning with GCC 7, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 179/254: mbedtls: fix variable shadow warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 246/254: FindWin32CACert: Use a temporary buffer on the stack, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 232/254: README.md: show the coverall coverage on github, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 106/254: tool_parsecfg: fix -Wcast-qual warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 64/254: unit1606: do not print/access buffer, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 135/254: tests: added missing keywords "chunked Transfer-Encoding", gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 242/254: lib1521: fix compiler warnings on the use of bad 'long' values, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 60/254: pingpong: use the set buffer size,
gnunet <=
- [GNUnet-SVN] [gnurl] 236/254: configure: fix link with librtmp when specifying path, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 127/254: formdata: fix -Wcomma warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 147/254: oauth2-bearer.d: mention the <token> argument, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 122/254: tests: removed redundant --trace-ascii arguments, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 174/254: runtests.pl: removed unused arguments to valgrindparse, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 128/254: cookie_interface: fix -Wcomma warning, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 123/254: tests: make test file names more unique, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 116/254: rand: treat fake entropy the same regardless of endianness, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 161/254: memdebug: fix compilation failure, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 145/254: curl_sasl: fix build error with CURL_DISABLE_CRYPTO_AUTH + USE_NTLM, gnunet, 2017/06/17