From: hno <> Date: Mon, 18 Oct 2004 18:16:22 +0000 (+0000) Subject: Bug #1000: Content gets corrupted during upload X-Git-Tag: SQUID_3_0_PRE4~1015 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95ac44e6e5c096f499ca1f5fe31cb8416b1d619d;p=thirdparty%2Fsquid.git Bug #1000: Content gets corrupted during upload --- diff --git a/src/client_side.cc b/src/client_side.cc index 9bc0ff07c7..89eb746472 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.672 2004/09/26 21:40:29 hno Exp $ + * $Id: client_side.cc,v 1.673 2004/10/18 12:16:22 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2431,8 +2431,14 @@ clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno, if (flag == COMM_OK) { if (size > 0) { + char *current_buf = conn->in.addressToReadInto(); kb_incr(&statCounter.client_http.kbytes_in, size); + + if (buf != current_buf) + xmemmove(current_buf, buf, size); + conn->in.notYetUsed += size; + conn->in.buf[conn->in.notYetUsed] = '\0'; /* Terminate the string */ } else if (size == 0) { debug(33, 5) ("clientReadRequest: FD %d closed?\n", fd);