]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug fix: In the case of an error while accessing a gopher server, squid will crash
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Sat, 7 Aug 2010 15:38:22 +0000 (18:38 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Sat, 7 Aug 2010 15:38:22 +0000 (18:38 +0300)
The GopherStateData::req  used to retrieve the releated HttpRequest object in
gopherSendComplete function when a server while accessing the server occurs.

The GopherStateData::req is never assigned and it is always NULL (should be
removed?). The gopherState->fwd->request must be used instead.

src/gopher.cc

index 70e6352f8d90dc5196572bcf5ab278ee4c88cd5b..75c821c568e8f18fba00b123b4c7ba53d2fd8f42 100644 (file)
@@ -899,7 +899,7 @@ gopherSendComplete(int fd, char *buf, size_t size, comm_err_t errflag, int xerrn
         ErrorState *err;
         err = errorCon(ERR_WRITE_ERROR, HTTP_SERVICE_UNAVAILABLE, gopherState->fwd->request);
         err->xerrno = errno;
-        err->port = gopherState->req->port;
+        err->port = gopherState->fwd->request->port;
         err->url = xstrdup(entry->url());
         gopherState->fwd->fail(err);
         comm_close(fd);