//tell ClientHttpRequest to store a fresh portion of the adapted response
if (p->data->body->hasContent()) {
+ /*
+ * NOTE: req will be NULL if this is a "request satisfaction"
+ * ICAP reply. In other words, the ICAP REQMOD reply may
+ * contain an HTTP response, in which case we'll have a body, but
+ * adapted->data->header will be an HttpReply, not an HttpRequest.
+ */
HttpRequest *req = dynamic_cast<HttpRequest*>(adapted->data->header);
- assert(req);
- debugs(32,3,HERE << "notifying body_reader, contentSize() = " << p->data->body->contentSize());
- req->body_reader->notify(p->data->body->contentSize());
+
+ if (req) {
+ debugs(32,3,HERE << "notifying body_reader, contentSize() = " << p->data->body->contentSize());
+ req->body_reader->notify(p->data->body->contentSize());
+ } else {
+ http->takeAdaptedBody(adapted->data->body);
+ }
}
}
/*
- * $Id: client_side_request.cc,v 1.70 2006/06/05 18:57:08 serassio Exp $
+ * $Id: client_side_request.cc,v 1.71 2006/06/21 22:37:49 wessels Exp $
*
* DEBUG: section 85 Client-side Request Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
storeEntry()->write(StoreIOBuffer(buf, request_satisfaction_offset));
request_satisfaction_offset += buf->contentSize();
buf->consume(buf->contentSize()); // consume everything written
+ } else {
+ debug(85,0)("Unexpected call to takeAdaptedBody when "
+ "not in request_satisfaction_mode");
}
}