status and request lines of HTTP requests and responses.
Still need to write HttpRequest::parseFirstLine().
/*
- * $Id: HttpMsg.cc,v 1.16 2005/09/15 19:22:30 wessels Exp $
+ * $Id: HttpMsg.cc,v 1.17 2005/09/15 20:19:41 wessels Exp $
*
* DEBUG: section 74 HTTP Message
* AUTHOR: Alex Rousskov
const char **parse_end_ptr = &blk_end;
assert(parse_start);
assert(pstate < psParsed);
- HttpReply *rep = dynamic_cast<HttpReply*>(this);
- HttpRequest *req = dynamic_cast<HttpRequest*>(this);
*parse_end_ptr = parse_start;
if (!httpMsgIsolateStart(&parse_start, &blk_start, &blk_end))
return 0;
- if (rep) {
- if (!httpStatusLineParse(&rep->sline, rep->protoPrefix, blk_start, blk_end))
- return httpMsgParseError();
- } else if (req) {
- if (!req->parseRequestLine(blk_start, blk_end))
- return httpMsgParseError();
- }
+ if (!parseFirstLine(blk_start, blk_end))
+ return httpMsgParseError();
*parse_end_ptr = parse_start;
/*
- * $Id: HttpMsg.h,v 1.2 2005/09/15 19:22:30 wessels Exp $
+ * $Id: HttpMsg.h,v 1.3 2005/09/15 20:19:41 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
protected:
virtual void packFirstLineInto(Packer * p, bool full_uri) const = 0;
+ virtual bool parseFirstLine(const char *blk_start, const char *blk_end) = 0;
virtual void hdrCacheInit();
};
/*
- * $Id: HttpReply.cc,v 1.74 2005/09/15 19:22:30 wessels Exp $
+ * $Id: HttpReply.cc,v 1.75 2005/09/15 20:19:41 wessels Exp $
*
* DEBUG: section 58 HTTP Reply (Response)
* AUTHOR: Alex Rousskov
{
httpStatusLinePackInto(&sline, p);
}
+
+bool HttpReply::parseFirstLine(const char *blk_start, const char *blk_end)
+{
+ return httpStatusLineParse(&sline, protoPrefix, blk_start, blk_end);
+}
/*
- * $Id: HttpReply.h,v 1.10 2005/09/15 19:22:30 wessels Exp $
+ * $Id: HttpReply.h,v 1.11 2005/09/15 20:19:41 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
protected:
virtual void packFirstLineInto(Packer * p, bool) const;
+ virtual bool parseFirstLine(const char *start, const char *end);
virtual void hdrCacheInit();
};
/*
- * $Id: HttpRequest.cc,v 1.50 2005/09/15 19:22:30 wessels Exp $
+ * $Id: HttpRequest.cc,v 1.51 2005/09/15 20:19:41 wessels Exp $
*
* DEBUG: section 73 HTTP Request
* AUTHOR: Duane Wessels
return true;
}
-bool HttpRequest::parseRequestLine(const char *start, const char *end)
+bool HttpRequest::parseFirstLine(const char *start, const char *end)
{
- fatal("HttpRequest::parseRequestLine not implemented yet");
+ fatal("HttpRequest::parseFirstLine not implemented yet");
return false;
}
/*
- * $Id: HttpRequest.h,v 1.13 2005/09/15 19:22:30 wessels Exp $
+ * $Id: HttpRequest.h,v 1.14 2005/09/15 20:19:41 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
String extacl_log; /* String to be used for access.log purposes */
public:
- bool parseRequestLine(const char *start, const char *end);
+ bool parseFirstLine(const char *start, const char *end);
int parseHeader(const char *parse_start);
private: