]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceFormat Enforcement
authorAutomatic source maintenance <squidadm@squid-cache.org>
Sat, 11 Sep 2010 00:12:53 +0000 (18:12 -0600)
committerAutomatic source maintenance <squidadm@squid-cache.org>
Sat, 11 Sep 2010 00:12:53 +0000 (18:12 -0600)
src/HttpControlMsg.h
src/Server.cc
src/client_side.cc
src/http.cc

index a417c349101877812ad0c918c31b972af3451c2a..c60f8fb8d0119237e7b44f1cbe9871e02a679137 100644 (file)
 
 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 @@ class HttpControlMsg
 {
 public:
     typedef HttpMsgPointerT<HttpReply> 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
index a6004b1efb25e16cfb723efa724e713c6fa975cf..8f11549bb13c28fbcf46ede20442e2c8f7b1c51e 100644 (file)
@@ -393,8 +393,7 @@ ServerStateData::sentRequestBody(const CommIoCbParams &io)
 
     if (!requestBodySource->exhausted())
         sendMoreRequestBody();
-    else
-    if (receivedWholeRequestBody)
+    else if (receivedWholeRequestBody)
         doneSendingRequestBody();
     else
         debugs(9,3, HERE << "waiting for body production end or abort");
index 49cbf7c5267aa1579f0b642f4357c9987b272afd..74bb562a92f176c223a7da479393d4ad7cd502de 100644 (file)
@@ -2321,7 +2321,7 @@ ConnStateData::checkHeaderLimits()
         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 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c
         // 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 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c
     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 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c
 
         /* 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<clientReplyContext *>(node->data.getRaw());
             assert (repContext);
@@ -2567,7 +2567,7 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c
         // 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 @@ clientParseRequest(ConnStateData * conn, bool &do_next_read)
     // 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 @@ ConnStateData::abortChunkedRequestBody(const err_type error)
         clientReplyContext *repContext = dynamic_cast<clientReplyContext*>(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 @@ ConnStateData::abortChunkedRequestBody(const err_type error)
         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);
index 91e9b5a170bc0b3c30c9bf69ac6790c5af070c89..d6e9d9c0e745ed936af60336b8d4abb1630899cb 100644 (file)
@@ -767,7 +767,7 @@ HttpStateData::handle1xx(HttpReply *reply)
             debugs(11, 3, HERE << "ignoring denied 1xx");
             proceedAfter1xx();
             return;
-               }
+        }
     }
 #endif // USE_HTTP_VIOLATIONS
 
@@ -776,7 +776,7 @@ HttpStateData::handle1xx(HttpReply *reply)
     // the Sink will use this to call us back after writing 1xx to the client
     typedef NullaryMemFunT<HttpStateData> 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 @@ HttpStateData::proceedAfter1xx()
     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 @@ HttpStateData::readReply(const CommIoCbParams &io)
 /// 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 @@ HttpStateData::getMoreRequestBody(MemBuf &buf)
     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;