From: Amos Jeffries Date: Sat, 1 Aug 2009 10:06:49 +0000 (+1200) Subject: Remove more goto. Fixing one internal profiler error X-Git-Tag: SQUID_3_1_0_13~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f815c9641131da60b076aa238ecdc88ce49163db;p=thirdparty%2Fsquid.git Remove more goto. Fixing one internal profiler error --- diff --git a/src/HttpMsg.cc b/src/HttpMsg.cc index 5d8160b8fa..7525b070aa 100644 --- a/src/HttpMsg.cc +++ b/src/HttpMsg.cc @@ -243,7 +243,6 @@ HttpMsg::httpMsgParseStep(const char *buf, int len, int atEnd) const char **parse_end_ptr = &blk_end; assert(parse_start); assert(pstate < psParsed); - int retval; *parse_end_ptr = parse_start; @@ -251,13 +250,13 @@ HttpMsg::httpMsgParseStep(const char *buf, int len, int atEnd) if (pstate == psReadyToParseStartLine) { if (!httpMsgIsolateStart(&parse_start, &blk_start, &blk_end)) { - retval = 0; - goto finish; + PROF_stop(HttpMsg_httpMsgParseStep); + return 0; } if (!parseFirstLine(blk_start, blk_end)) { - retval = httpMsgParseError(); - goto finish; + PROF_stop(HttpMsg_httpMsgParseStep); + return httpMsgParseError(); } *parse_end_ptr = parse_start; @@ -278,13 +277,15 @@ HttpMsg::httpMsgParseStep(const char *buf, int len, int atEnd) if (atEnd) { blk_start = parse_start, blk_end = blk_start + strlen(blk_start); } else { - retval = 0; - goto finish; + PROF_stop(HttpMsg_httpMsgParseStep); + return 0; } } - if (!header.parse(blk_start, blk_end)) + if (!header.parse(blk_start, blk_end)) { + PROF_stop(HttpMsg_httpMsgParseStep); return httpMsgParseError(); + } hdrCacheInit(); @@ -294,10 +295,9 @@ HttpMsg::httpMsgParseStep(const char *buf, int len, int atEnd) ++pstate; } - retval = 1; -finish: + PROF_stop(HttpMsg_httpMsgParseStep); - return retval; + return 1; } /* handy: resets and returns -1 */