--------------------- PatchSet 4671 Date: 2002/08/14 11:42:52 Author: rbcollins Branch: esi Tag: (none) Log: Incremental commit of Error code conversion Members: src/client_side.c:1.65.2.4->1.65.2.5 src/client_side_reply.c:1.1.2.3->1.1.2.4 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.65.2.4 retrieving revision 1.65.2.5 diff -u -r1.65.2.4 -r1.65.2.5 --- squid/src/client_side.c 14 Aug 2002 11:16:05 -0000 1.65.2.4 +++ squid/src/client_side.c 14 Aug 2002 11:42:52 -0000 1.65.2.5 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.65.2.4 2002/08/14 11:16:05 rbcollins Exp $ + * $Id: client_side.c,v 1.65.2.5 2002/08/14 11:42:52 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1139,14 +1139,6 @@ clientSetReplyToError (node->data, ERR_INVALID_REQ, HTTP_BAD_REQUEST, method, NULL, &conn->peer.sin_addr, NULL, conn->in.buf); -#if 0 - err = clientBuildError(ERR_INVALID_REQ, HTTP_BAD_REQUEST, NULL, &conn->peer.sin_addr, - NULL); - err->request_hdrs = xstrdup(conn->in.buf); - /* FIXME */ - http->entry = clientCreateStoreEntry(node->data, method, null_request_flags); - errorAppendEntry(http->entry, err); -#endif clientStreamRead (http->stream_head.tail->data, http, 0, HTTP_REQBUF_SZ, http->reqbuf); @@ -1162,13 +1154,6 @@ clientStreamRead (http->stream_head.tail->data, http, 0, HTTP_REQBUF_SZ, http->reqbuf); -#if 0 - err = clientBuildError(ERR_INVALID_URL, HTTP_BAD_REQUEST, http->uri, - &conn->peer.sin_addr, NULL); - http->al.http.code = err->http_status; - http->entry = clientCreateStoreEntry(node->data, method, null_request_flags); - errorAppendEntry(http->entry, err); -#endif safe_free(prefix); break; } else { @@ -1208,21 +1193,18 @@ if (!urlCheckRequest(request) || httpHeaderHas(&request->header, HDR_TRANSFER_ENCODING)) { clientStreamNode *node = http->stream_head.tail->prev->data; - err = clientBuildError(ERR_UNSUP_REQ, HTTP_NOT_IMPLEMENTED, NULL, &conn->peer.sin_addr, - request); - request->flags.proxy_keepalive = 0; - http->al.http.code = err->http_status; - http->entry = clientCreateStoreEntry(node->data, request->method, null_request_flags); - errorAppendEntry(http->entry, err); + clientSetReplyToError (node->data,ERR_UNSUP_REQ, HTTP_NOT_IMPLEMENTED, request->method, + NULL, &conn->peer.sin_addr, request, NULL); + clientStreamRead (http->stream_head.tail->data, http, 0, + HTTP_REQBUF_SZ, + http->reqbuf); break; } if (!clientCheckContentLength(request)) { clientStreamNode *node = http->stream_head.tail->prev->data; - err = clientBuildError(ERR_INVALID_REQ, HTTP_LENGTH_REQUIRED, NULL, - &conn->peer.sin_addr, request); - http->al.http.code = err->http_status; - http->entry = clientCreateStoreEntry(node->data, request->method, null_request_flags); - errorAppendEntry(http->entry, err); + clientSetReplyToError (node->data,ERR_INVALID_REQ, HTTP_LENGTH_REQUIRED, request->method, + NULL, &conn->peer.sin_addr, request, NULL); + clientStreamRead (http->stream_head.tail->data, http, 0,HTTP_REQBUF_SZ,http->reqbuf); break; } http->request = requestLink(request); @@ -1234,11 +1216,16 @@ /* Is it too large? */ if (clientRequestBodyTooLarge(request->content_length)) { clientStreamNode *node = http->stream_head.tail->prev->data; + clientSetReplyToError (node->data,ERR_TOO_BIG, HTTP_REQUEST_ENTITY_TOO_LARGE,METHOD_NONE, NULL, + &conn->peer.sin_addr, http->request, NULL); + 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, http->request); http->entry = clientCreateStoreEntry(node->data, METHOD_NONE, null_request_flags); errorAppendEntry(http->entry, err); +#endif break; } } Index: squid/src/client_side_reply.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/client_side_reply.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid/src/client_side_reply.c 14 Aug 2002 11:16:06 -0000 1.1.2.3 +++ squid/src/client_side_reply.c 14 Aug 2002 11:42:52 -0000 1.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.c,v 1.1.2.3 2002/08/14 11:16:06 rbcollins Exp $ + * $Id: client_side_reply.c,v 1.1.2.4 2002/08/14 11:42:52 rbcollins Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -95,7 +95,7 @@ if (unparsedrequest) errstate->request_hdrs = xstrdup (unparsedrequest); - if (status == HTTP_NOT_IMPLEMENTED) + if (status == HTTP_NOT_IMPLEMENTED && context->http->request) /* prevent confusion over whether we default to persistent or not */ context->http->request->flags.proxy_keepalive = 0; context->http->al.http.code = errstate->http_status;