------------------------------------------------------------ revno: 10844 revision-id: squidadm@squid-cache.org-20100911001253-sdatbibumndwdvmq parent: rousskov@measurement-factory.com-20100910234755-m5mve1jt4u3ljp5b committer: Automatic source maintenance branch nick: trunk timestamp: Fri 2010-09-10 18:12:53 -0600 message: SourceFormat Enforcement ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squidadm@squid-cache.org-20100911001253-\ # sdatbibumndwdvmq # target_branch: http://www.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 4fc0769029e9ec7aef08f148c4cec0c5079af00d # timestamp: 2010-09-11 00:52:31 +0000 # source_branch: http://www.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: rousskov@measurement-factory.com-20100910234755-\ # m5mve1jt4u3ljp5b # # Begin patch === modified file 'src/HttpControlMsg.h' --- src/HttpControlMsg.h 2010-09-10 23:47:55 +0000 +++ src/HttpControlMsg.h 2010-09-11 00:12:53 +0000 @@ -10,14 +10,14 @@ class HttpControlMsg; -/* +/* * This API exists to throttle forwarding of 1xx messages from the server * side (Source == HttpStateData) to the client side (Sink == ConnStateData). * * Without throttling, Squid would have to drop some 1xx responses to * avoid DoS attacks that send many 1xx responses without reading them. * Dropping 1xx responses without violating HTTP is as complex as throttling. - */ + */ /// sends a single control message, notifying the Sink class HttpControlMsgSink: public virtual AsyncJob @@ -34,10 +34,10 @@ { public: typedef HttpMsgPointerT MsgPtr; - typedef AsyncCall::Pointer Callback; + typedef AsyncCall::Pointer Callback; HttpControlMsg(const MsgPtr &aReply, const Callback &aCallback): - reply(aReply), cbSuccess(aCallback) {} + reply(aReply), cbSuccess(aCallback) {} public: MsgPtr reply; ///< the 1xx message being forwarded === modified file 'src/Server.cc' --- src/Server.cc 2010-09-10 20:06:41 +0000 +++ src/Server.cc 2010-09-11 00:12:53 +0000 @@ -393,8 +393,7 @@ if (!requestBodySource->exhausted()) sendMoreRequestBody(); - else - if (receivedWholeRequestBody) + else if (receivedWholeRequestBody) doneSendingRequestBody(); else debugs(9,3, HERE << "waiting for body production end or abort"); === modified file 'src/client_side.cc' --- src/client_side.cc 2010-09-10 20:56:24 +0000 +++ src/client_side.cc 2010-09-11 00:12:53 +0000 @@ -2321,7 +2321,7 @@ return; // can accumulte more header data debugs(33, 3, "Request header is too large (" << in.notYetUsed << " > " << - Config.maxRequestHeaderSize << " bytes)"); + Config.maxRequestHeaderSize << " bytes)"); ClientSocketContext *context = parseHttpRequestAbort(this, "error:request-too-large"); clientStreamNode *node = context->getClientReplyContext(); @@ -2487,7 +2487,7 @@ // HTTP/1.1 requires chunking to be the last encoding if there is one unsupportedTe = te.size() && te != "identity"; } // else implied identity coding - + if (method == METHOD_TRACE || method == METHOD_OPTIONS) request->max_forwards = request->header.getInt64(HDR_MAX_FORWARDS); @@ -2544,7 +2544,7 @@ expectBody = chunked || request->content_length > 0; if (!context->mayUseConnection() && expectBody) { request->body_pipe = conn->expectRequestBody( - chunked ? -1 : request->content_length); + chunked ? -1 : request->content_length); // consume header early so that body pipe gets just the body connNoteUseOfBuffer(conn, http->req_sz); @@ -2552,7 +2552,7 @@ /* Is it too large? */ if (!chunked && // if chunked, we will check as we accumulate - clientIsRequestBodyTooLargeForPolicy(request->content_length)) { + clientIsRequestBodyTooLargeForPolicy(request->content_length)) { clientStreamNode *node = context->getClientReplyContext(); clientReplyContext *repContext = dynamic_cast(node->data.getRaw()); assert (repContext); @@ -2567,7 +2567,7 @@ // We may stop producing, comm_close, and/or call setReplyToError() // below, so quit on errors to avoid http->doCallouts() if (!conn->handleRequestBodyData()) - goto finish; + goto finish; if (!request->body_pipe->productionEnded()) conn->readSomeData(); @@ -2643,7 +2643,7 @@ // Loop while we have read bytes that are not needed for producing the body // On errors, bodyPipe may become nil, but readMoreRequests will be cleared while (conn->in.notYetUsed > 0 && !conn->bodyPipe && - conn->flags.readMoreRequests) { + conn->flags.readMoreRequests) { connStripBufferWhitespace (conn); /* Don't try to parse if the buffer is empty */ @@ -2925,7 +2925,7 @@ clientReplyContext *repContext = dynamic_cast(node->data.getRaw()); assert(repContext); const http_status scode = (error == ERR_TOO_BIG) ? - HTTP_REQUEST_ENTITY_TOO_LARGE : HTTP_BAD_REQUEST; + HTTP_REQUEST_ENTITY_TOO_LARGE : HTTP_BAD_REQUEST; repContext->setReplyToError(error, scode, repContext->http->request->method, repContext->http->uri, @@ -2935,7 +2935,7 @@ context->pullData(); } else { // close or otherwise we may get stuck as nobody will notice the error? - comm_reset_close(fd); + comm_reset_close(fd); } #else debugs(33, 3, HERE << "aborting chunked request without error " << error); === modified file 'src/http.cc' --- src/http.cc 2010-09-10 21:12:54 +0000 +++ src/http.cc 2010-09-11 00:12:53 +0000 @@ -767,7 +767,7 @@ debugs(11, 3, HERE << "ignoring denied 1xx"); proceedAfter1xx(); return; - } + } } #endif // USE_HTTP_VIOLATIONS @@ -776,7 +776,7 @@ // the Sink will use this to call us back after writing 1xx to the client typedef NullaryMemFunT CbDialer; const AsyncCall::Pointer cb = JobCallback(11, 3, CbDialer, this, - HttpStateData::proceedAfter1xx); + HttpStateData::proceedAfter1xx); CallJobHere1(11, 4, orig_request->clientConnection, ConnStateData, ConnStateData::sendControlMsg, HttpControlMsg(msg, cb)); // If the call is not fired, then the Sink is gone, and HttpStateData @@ -792,7 +792,7 @@ Must(flags.handling1xx); debugs(11, 2, HERE << "consuming " << header_bytes_read << - " header and " << reply_bytes_read << " body bytes read after 1xx"); + " header and " << reply_bytes_read << " body bytes read after 1xx"); header_bytes_read = 0; reply_bytes_read = 0; @@ -1186,7 +1186,8 @@ /// processes the already read and buffered response data, possibly after /// waiting for asynchronous 1xx control message processing void -HttpStateData::processReply() { +HttpStateData::processReply() +{ if (flags.handling1xx) { // we came back after handling a 1xx response debugs(11, 5, HERE << "done with 1xx handling"); @@ -2161,7 +2162,7 @@ if (receivedWholeRequestBody) { Must(!flags.sentLastChunk); flags.sentLastChunk = true; - buf.append("0\r\n\r\n", 5); + buf.append("0\r\n\r\n", 5); } return true;