/*
- * $Id: HttpMsg.cc,v 1.25 2006/02/17 18:10:59 wessels Exp $
+ * $Id: HttpMsg.cc,v 1.26 2006/04/18 12:25:50 robertc Exp $
*
* DEBUG: section 74 HTTP Message
* AUTHOR: Alex Rousskov
#include "squid.h"
#include "HttpMsg.h"
#include "HttpRequest.h"
-#include "HttpReply.h"
#include "MemBuf.h"
HttpMsg::HttpMsg(http_hdr_owner_type owner): header(owner),
HttpMsg::httpMsgParseError()
{
reset();
- /* indicate an error */
-
- if (HttpReply *rep = dynamic_cast<HttpReply*>(this))
- rep->sline.status = HTTP_INVALID_HEADER;
-
return -1;
}
/*
- * $Id: HttpMsg.h,v 1.8 2006/02/17 18:10:59 wessels Exp $
+ * $Id: HttpMsg.h,v 1.9 2006/04/18 12:25:50 robertc Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
int httpMsgParseStep(const char *buf, int atEnd);
- int httpMsgParseError();
+ virtual int httpMsgParseError();
virtual bool expectingBody(method_t, ssize_t&) const = 0;
/*
- * $Id: HttpReply.cc,v 1.82 2006/01/23 20:04:24 wessels Exp $
+ * $Id: HttpReply.cc,v 1.83 2006/04/18 12:25:50 robertc Exp $
*
* DEBUG: section 58 HTTP Reply (Response)
* AUTHOR: Alex Rousskov
return httpStatusLineParse(&sline, protoPrefix, blk_start, blk_end);
}
+/* handy: resets and returns -1 */
+int
+HttpReply::httpMsgParseError()
+{
+ int result(HttpMsg::httpMsgParseError());
+ /* indicate an error in the status line */
+ sline.status = HTTP_INVALID_HEADER;
+ return result;
+}
+
/*
* Indicate whether or not we would usually expect an entity-body
* along with this response
/*
- * $Id: HttpReply.h,v 1.16 2006/02/17 18:10:59 wessels Exp $
+ * $Id: HttpReply.h,v 1.17 2006/04/18 12:25:50 robertc Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
bool do_clean;
public:
+ virtual int httpMsgParseError();
+
virtual bool expectingBody(method_t, ssize_t&) const;
void updateOnNotModified(HttpReply const *other);