--------------------- PatchSet 4673 Date: 2002/08/14 12:53:22 Author: rbcollins Branch: esi Tag: (none) Log: Incremental commit of Error code conversion Members: src/client_side.c:1.65.2.6->1.65.2.7 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.65.2.6 retrieving revision 1.65.2.7 diff -u -r1.65.2.6 -r1.65.2.7 --- squid/src/client_side.c 14 Aug 2002 12:23:45 -0000 1.65.2.6 +++ squid/src/client_side.c 14 Aug 2002 12:53:22 -0000 1.65.2.7 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.65.2.6 2002/08/14 12:23:45 rbcollins Exp $ + * $Id: client_side.c,v 1.65.2.7 2002/08/14 12:53:22 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1243,16 +1243,6 @@ for (H = &conn->chr; *H; H = &(*H)->next); *H = http; clientStreamRead (http->stream_head.tail->data, http, 0,HTTP_REQBUF_SZ,http->reqbuf); -#if 0 - err = clientBuildError(ERR_TOO_BIG, HTTP_REQUEST_ENTITY_TOO_LARGE, NULL, - &conn->peer.sin_addr, NULL); - http = parseHttpRequestAbort(conn, "error:request-too-large"); - /* add to the client request queue */ - for (H = &conn->chr; *H; H = &(*H)->next); - *H = http; - http->entry = clientCreateStoreEntry(node->data, METHOD_NONE, null_request_flags); - errorAppendEntry(http->entry, err); -#endif return; } break; @@ -1387,7 +1377,6 @@ { #if THIS_CONFUSES_PERSISTENT_CONNECTION_AWARE_BROWSERS_AND_USERS ConnStateData *conn = data; - ErrorState *err; debug(33, 3) ("requestTimeout: FD %d: lifetime is expired.\n", fd); if (fd_table[fd].rwstate) { /* @@ -1403,15 +1392,18 @@ /* * Generate an error */ - err = clientBuildError(ERR_LIFETIME_EXP, HTTP_REQUEST_TIMEOUT, "N/A", &conn->peer.sin_addr, NULL); - /* - * Normally we shouldn't call errorSend() in client_side.c, but - * it should be okay in this case. Presumably if we get here - * this is the first request for the connection, and no data - * has been written yet - */ + clientHttpRequest **H; + clientStreamNode *node; + clientHttpRequest *http = parseHttpRequestAbort(conn, "error:Connection%20lifetime%20expired"); + node = http->stream_head.tail->prev->data; + clientSetReplyToError (node->data,ERR_LIFETIME_EXP, HTTP_REQUEST_TIMEOUT,METHOD_NONE, "N/A", + &conn->peer.sin_addr, NULL, NULL); + /* No requests can be outstanded */ assert(conn->chr == NULL); - errorSend(fd, err); + /* add to the client request queue */ + for (H = &conn->chr; *H; H = &(*H)->next); + *H = http; + clientStreamRead (http->stream_head.tail->data, http, 0,HTTP_REQBUF_SZ,http->reqbuf); /* * if we don't close() here, we still need a timeout handler! */