--------------------- PatchSet 960 Date: 2000/12/18 12:29:26 Author: adri Branch: modio Tag: (none) Log: Kill more uses of storeMemHiOffset() * set the status to HTTP_OK if there isn't any status set, rather than if we haven't appended any data to the object yet. EIther way, its only going to be set once.. * Always send an error message to the forwarding client if we get an error during the whois processing, rather than only doing it if we have some data. Members: src/whois.c:1.2.2.1->1.2.2.2 Index: squid/src/whois.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/whois.c,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- squid/src/whois.c 13 Dec 2000 09:45:03 -0000 1.2.2.1 +++ squid/src/whois.c 18 Dec 2000 12:29:26 -0000 1.2.2.2 @@ -1,6 +1,6 @@ /* - * $Id: whois.c,v 1.2.2.1 2000/12/13 09:45:03 rbcollins Exp $ + * $Id: whois.c,v 1.2.2.2 2000/12/18 12:29:26 adri Exp $ * * DEBUG: section 75 WHOIS protocol * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -94,8 +94,15 @@ debug(75, 3) ("whoisReadReply: FD %d read %d bytes\n", fd, len); debug(75, 5) ("{%s}\n", buf); if (len > 0) { - if (0 == storeMemHiOffset(entry)) - mem->reply->sline.status = HTTP_OK; + /* + * the original code checked if anything was in memory and if not, + * status was set to HTTP_OK. I'm doing something similar. I guess + * this stops overwriting status if its been set to something else, + * but it should be a "fabricated" HTTP reply anyway, right ? + * -- adrian + */ + if (mem->reply->sline.status == HTTP_STATUS_NONE) + mem->reply->sline.status = HTTP_OK; fd_bytes(fd, len, FD_READ); kb_incr(&statCounter.server.all.kbytes_in, len); kb_incr(&statCounter.server.http.kbytes_in, len); @@ -106,15 +113,18 @@ fd, xstrerror()); if (ignoreErrno(errno)) { commSetSelect(fd, COMM_SELECT_READ, whoisReadReply, p, Config.Timeout.read); - } else if (storeMemHiOffset(entry) == 0) { + } else { + /* + * Whether we got any data or not is kind of irrelevant. + * We should try to error out anyway. + * -- adrian + */ ErrorState *err; err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR); err->xerrno = errno; fwdFail(p->fwd, err); comm_close(fd); - } else { - comm_close(fd); - } + } } else { fwdComplete(p->fwd); debug(75, 3) ("whoisReadReply: Done: %s\n", storeUrl(entry));