/*
- * $Id: client_side.cc,v 1.754 2007/05/18 06:41:23 amosjeffries Exp $
+ * $Id: client_side.cc,v 1.755 2007/05/18 18:30:41 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
http->calloutContext = new ClientRequestContext(http);
http->doCallouts();
-
+
finish:
if (!notedUseOfBuffer)
connNoteUseOfBuffer(conn.getRaw(), http->req_sz);
+
+ /*
+ * DPW 2007-05-18
+ * Moved the TCP_RESET feature from clientReplyContext::sendMoreData
+ * to here because calling comm_reset_close() causes http to
+ * be freed and the above connNoteUseOfBuffer() would hit an
+ * assertion, not to mention that we were accessing freed memory.
+ */
+ if (http->request->flags.resetTCP() && conn->fd > -1) {
+ debugs(33, 3, HERE << "Sending TCP RST on FD " << conn->fd);
+ comm_reset_close(conn->fd);
+ return;
+ }
}
static void
/*
- * $Id: client_side_reply.cc,v 1.127 2007/05/18 06:41:23 amosjeffries Exp $
+ * $Id: client_side_reply.cc,v 1.128 2007/05/18 18:30:41 wessels Exp $
*
* DEBUG: section 88 Client-side Reply Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
/* update size of the request */
reqsize = reqofs;
- if (http->request->flags.resetTCP()) {
- /* yuck. FIXME: move to client_side.c */
-
- if (fd != -1)
- comm_reset_close(fd);
-
- return;
- }
-
if (errorInStream(result, reqofs)) {
sendStreamError(result);
return;