--------------------- PatchSet 7379 Date: 2008/03/20 21:06:18 Author: chtsanti Branch: async-calls Tag: (none) Log: - Remove some unused,commented code - Add profiler stats for HttpStateData::readReply method. Members: src/http.cc:1.122.4.11->1.122.4.12 Index: squid3/src/http.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/http.cc,v retrieving revision 1.122.4.11 retrieving revision 1.122.4.12 diff -u -r1.122.4.11 -r1.122.4.12 --- squid3/src/http.cc 19 Mar 2008 22:01:07 -0000 1.122.4.11 +++ squid3/src/http.cc 20 Mar 2008 21:06:18 -0000 1.122.4.12 @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.122.4.11 2008/03/19 22:01:07 chtsanti Exp $ + * $Id: http.cc,v 1.122.4.12 2008/03/20 21:06:18 chtsanti Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -162,14 +162,6 @@ { return fd; } -/* -static void -httpStateFree(int fd, void *data) -{ - HttpStateData *httpState = static_cast(data); - debugs(11, 5, "httpStateFree: FD " << fd << ", httpState=" << data); - delete httpState; -}*/ void HttpStateData::httpStateConnClosed(const CommCloseCbParams ¶ms) @@ -952,18 +944,6 @@ /* * This is the callback after some data has been read from the network */ -/* -void -HttpStateData::ReadReplyWrapper(int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void *data) -{ - HttpStateData *httpState = static_cast(data); - assert (fd == httpState->fd); - // assert(buf == readBuf->content()); - PROF_start(HttpStateData_readReply); - httpState->readReply (len, flag, xerrno); - PROF_stop(HttpStateData_readReply); -} -*/ /* XXX this function is too long! */ void HttpStateData::readReply (const CommIoCbParams &io) @@ -972,6 +952,8 @@ int clen; int len = io.size; + PROF_start(HttpStateData_readReply); + Must(fd == io.fd); flags.do_next_read = 0; @@ -981,11 +963,13 @@ // Bail out early on COMM_ERR_CLOSING - close handlers will tidy up for us if (io.flag == COMM_ERR_CLOSING) { debugs(11, 3, "http socket closing"); + PROF_stop(HttpStateData_readReply); return; } if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) { maybeReadVirginBody(); + PROF_stop(HttpStateData_readReply); return; } @@ -1003,7 +987,8 @@ flags.do_next_read = 0; comm_close(fd); } - + + PROF_stop(HttpStateData_readReply); return; } @@ -1044,6 +1029,7 @@ /* Timeout NOT increased. This whitespace was from previous reply */ flags.do_next_read = 1; maybeReadVirginBody(); + PROF_stop(HttpStateData_readReply); return; } } @@ -1060,8 +1046,10 @@ processReplyHeader(); PROF_stop(HttpStateData_processReplyHeader); - if (!continueAfterParsingHeader()) // parsing error or need more data + if (!continueAfterParsingHeader()) { // parsing error or need more data + PROF_stop(HttpStateData_readReply); return; // TODO: send errors to ICAP + } adaptOrFinalizeReply(); } @@ -1070,6 +1058,7 @@ PROF_start(HttpStateData_processReplyBody); processReplyBody(); // may call serverComplete() PROF_stop(HttpStateData_processReplyBody); + PROF_stop(HttpStateData_readReply); } // Checks whether we can continue with processing the body or doing ICAP.