serversFree(&servers);
+ doneWithRetries();
+
HTTPMSGUNLOCK(request);
if (err)
if (shutting_down)
return false;
+ if (!self) { // we have aborted before the server called us back
+ debugs(17, 5, HERE << "not retrying because of earlier abort");
+ // we will be destroyed when the server clears its Pointer to us
+ return false;
+ }
+
if (entry->store_status != STORE_PENDING)
return false;
void
FwdState::retryOrBail()
{
- if (!self) { // we have aborted before the server called us back
- debugs(17, 5, HERE << "not retrying because of earlier abort");
- // we will be destroyed when the server clears its Pointer to us
- return;
- }
-
if (checkRetry()) {
int originserver = (servers->_peer == NULL);
debugs(17, 3, "fwdServerClosed: re-forwarding (" << n_tries << " tries, " << (squid_curtime - start_t) << " secs)");
return;
}
- if (!err && shutting_down) {
+ // TODO: should we call completed() here and move doneWithRetries there?
+ doneWithRetries();
+
+ if (self != NULL && !err && shutting_down) {
errorCon(ERR_SHUTTING_DOWN, HTTP_SERVICE_UNAVAILABLE, request);
}
self = NULL; // refcounted
}
+// If the Server quits before nibbling at the request body, the body sender
+// will not know (so that we can retry). Call this if we will not retry. We
+// will notify the sender so that it does not get stuck waiting for space.
+void
+FwdState::doneWithRetries()
+{
+ if (request && request->body_pipe != NULL)
+ request->body_pipe->expectNoConsumption();
+}
+
// called by the server that failed after calling unregister()
void
FwdState::handleUnregisteredServerEnd()