--------------------- PatchSet 5257 Date: 2002/10/06 08:09:38 Author: rbcollins Branch: commloops Tag: (none) Log: post merge touchups Members: src/client_side.c:1.52.4.10->1.52.4.11 src/store_client.c:1.11.4.4->1.11.4.5 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.52.4.10 retrieving revision 1.52.4.11 diff -u -r1.52.4.10 -r1.52.4.11 --- squid/src/client_side.c 6 Oct 2002 07:12:20 -0000 1.52.4.10 +++ squid/src/client_side.c 6 Oct 2002 08:09:38 -0000 1.52.4.11 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.52.4.10 2002/10/06 07:12:20 rbcollins Exp $ + * $Id: client_side.c,v 1.52.4.11 2002/10/06 08:09:38 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -90,6 +90,7 @@ struct { int deferred:1; /* This is a pipelined request waiting for the * current object to complete */ + int parsed_ok:1; /* Was this parsed correctly? */ } flags; struct { clientStreamNode *node; @@ -169,7 +170,7 @@ static void connNoteUseOfBuffer(ConnStateData * conn, int byteCount); static int connKeepReadingIncompleteRequest(ConnStateData * conn); static void connCancelIncompleteRequests(ConnStateData * conn); -static ConnStateData *connStateCreate(struct sockaddr_in peer, struct sockaddr_in me, int fd); +static ConnStateData *connStateCreate(struct sockaddr_in *peer, struct sockaddr_in *me, int fd); static clientStreamNode *getClientReplyContext(clientSocketContext * context); static int connAreAllContextsForThisConnection(ConnStateData * connState); static void connFreeAllContexts(ConnStateData * connState); @@ -1041,8 +1042,11 @@ * parseHttpRequest() * * Returns - * NULL on error or incomplete request - * a clientHttpRequest structure on success + * NULL on incomplete requests + * a clientSocketContext structure on success or failure + * Sets *status to -1 if failed to parse the request + * Sets *status to 0 we think we have a partial request + * Sets *status to 1 if we have a good request */ static clientSocketContext * parseHttpRequest(ConnStateData * conn, method_t * method_p, int *status, @@ -1342,8 +1346,16 @@ /* Process request */ context = parseHttpRequest(conn, &method, &parser_return_code, &prefix, &req_line_sz); - if (!context) + /* partial or incomplete request */ + if (!context) { safe_free(prefix); + assert (parser_return_code == 0); + if (!connKeepReadingIncompleteRequest(conn)) + connCancelIncompleteRequests(conn); + break; + } + + /* status -1 or 1 */ if (context) { clientHttpRequest *http = context->http; /* We have an initial client stream in place should it be needed */ @@ -1452,10 +1464,6 @@ } clientAccessCheck(http); continue; /* while offset > 0 && body.size_left == 0 */ - } else if (parser_return_code == 0) { - if (!connKeepReadingIncompleteRequest(conn)) - connCancelIncompleteRequests(conn); - break; } } /* while offset > 0 && conn->body.size_left == 0 */ /* Check if a half-closed connection was aborted in the middle */ Index: squid/src/store_client.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_client.c,v retrieving revision 1.11.4.4 retrieving revision 1.11.4.5 diff -u -r1.11.4.4 -r1.11.4.5 --- squid/src/store_client.c 6 Oct 2002 07:12:23 -0000 1.11.4.4 +++ squid/src/store_client.c 6 Oct 2002 08:09:39 -0000 1.11.4.5 @@ -1,6 +1,6 @@ /* - * $Id: store_client.c,v 1.11.4.4 2002/10/06 07:12:23 rbcollins Exp $ + * $Id: store_client.c,v 1.11.4.5 2002/10/06 08:09:39 rbcollins Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -189,7 +189,7 @@ void *data) { assert(!EBIT_TEST(e->flags, ENTRY_ABORTED)); - debug(20, 3) ("storeClientCopy: %s, from %d, for length %d, cb %p, cbdata %p\n", + debug(20, 3) ("storeClientCopy: %s, from %lu, for length %d, cb %p, cbdata %p\n", storeKeyText(e->hash.key), (unsigned long) copyInto.offset, copyInto.length,