]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Change HttpMsg::httpMsgParseError into a virtual function, and then overload that...
authorrobertc <>
Tue, 18 Apr 2006 18:25:50 +0000 (18:25 +0000)
committerrobertc <>
Tue, 18 Apr 2006 18:25:50 +0000 (18:25 +0000)
src/HttpMsg.cc
src/HttpMsg.h
src/HttpReply.cc
src/HttpReply.h

index a547c7869fe709b5f845127e617fbc34e8aa0d81..8b7fac545a05594af3aaa6c7f5b0f86fa0eebf56 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $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
@@ -36,7 +36,6 @@
 #include "squid.h"
 #include "HttpMsg.h"
 #include "HttpRequest.h"
-#include "HttpReply.h"
 #include "MemBuf.h"
 
 HttpMsg::HttpMsg(http_hdr_owner_type owner): header(owner),
@@ -290,11 +289,6 @@ int
 HttpMsg::httpMsgParseError()
 {
     reset();
-    /* indicate an error */
-
-    if (HttpReply *rep = dynamic_cast<HttpReply*>(this))
-        rep->sline.status = HTTP_INVALID_HEADER;
-
     return -1;
 }
 
index d098743d20aad586e526571f1a583edc1833322a..44d7af5fc1493288f7f26a78c4b861fa56716ce5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $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/
@@ -81,7 +81,7 @@ public:
 
     int httpMsgParseStep(const char *buf, int atEnd);
 
-    int httpMsgParseError();
+    virtual int httpMsgParseError();
 
     virtual bool expectingBody(method_t, ssize_t&) const = 0;
 
index e7e66127c61d5b4426de3180a7908bd212fed722..f09d8fa4aea268ebc0c2cbe45029ea42c27d8223 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $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
@@ -449,6 +449,16 @@ bool HttpReply::parseFirstLine(const char *blk_start, const char *blk_end)
     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
index 790df613cf04db4f57cc19c4719e6772c690aa0a..0b4d0ff46c3fee0470477ba461e3e79e37888723 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $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/
@@ -93,6 +93,8 @@ public:
     bool do_clean;
 
 public:
+    virtual int httpMsgParseError();
+
     virtual bool expectingBody(method_t, ssize_t&) const;
 
     void updateOnNotModified(HttpReply const *other);