/*
- * $Id: Server.cc,v 1.23 2007/09/27 14:34:06 rousskov Exp $
+ * $Id: Server.cc,v 1.24 2008/02/08 18:30:18 rousskov Exp $
*
* DEBUG:
* AUTHOR: Duane Wessels
if (abortOnBadEntry("entry went bad while waiting for ICAP ACL check"))
return;
+ // TODO: Should nonICAP and postICAP path check this on the server-side?
+ // That check now only happens on client-side, in processReplyAccess().
+ if (virginReply()->expectedBodyTooLarge(*request)) {
+ sendBodyIsTooLargeError();
+ return;
+ }
+ // TODO: Should we check received5CBodyTooLarge on the server-side as well?
+
startedIcap = startIcap(service, originalRequest());
if (!startedIcap && (!service || service->bypass)) {
}
#endif
+void
+ServerStateData::sendBodyIsTooLargeError()
+{
+ ErrorState *err = errorCon(ERR_TOO_BIG, HTTP_FORBIDDEN, request);
+ err->xerrno = errno;
+ fwd->fail(err);
+ fwd->dontRetry(true);
+ abortTransaction("Virgin body too large.");
+}
+
// TODO: when HttpStateData sends all errors to ICAP,
// we should be able to move this at the end of setVirginReply().
void
/*
- * $Id: Server.h,v 1.11 2008/01/07 17:10:22 hno Exp $
+ * $Id: Server.h,v 1.12 2008/02/08 18:30:18 rousskov Exp $
*
* AUTHOR: Duane Wessels
*
private:
void quitIfAllDone(); // successful termination
+ void sendBodyIsTooLargeError();
HttpReply *theVirginReply; // reply received from the origin server
HttpReply *theFinalReply; // adapted reply from ICAP or virgin reply