]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Mark some performance regressions
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Jun 2014 13:47:54 +0000 (06:47 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Jun 2014 13:47:54 +0000 (06:47 -0700)
src/HttpRequest.cc
src/http/one/RequestParser.cc

index c19901dc7c84eabcc1dd16af12a2aa2ee3e87fa4..b3b8f15c7946a2db6dafd0d2b730e69732f57718 100644 (file)
@@ -317,13 +317,13 @@ bool
 HttpRequest::parseFirstLine(const char *start, const char *end)
 {
     const char *t = start + strcspn(start, w_space);
-    SBuf m(start, start-t);
+    SBuf m(start, start-t); // XXX: SBuf ctor allocates and data-copies. performance regression.
     method = HttpRequestMethod(m);
 
     if (method == Http::METHOD_NONE)
         return false;
 
-    start = t + strspn(t, w_space);
+    start = t + strspn(t, w_space); // XXX: breaks if whitespace exists in URL
 
     const char *ver = findTrailingHTTPVersion(start, end);
 
@@ -369,6 +369,7 @@ HttpRequest::parseHeader(Http1::RequestParser &hp)
     if (!hp.headerBlockSize())
         return true;
 
+    // XXX: c_str() reallocates. performance regression.
     const bool result = header.parse(hp.mimeHeader().c_str(), hp.headerBlockSize());
 
     if (result)
index 7e0d94922a73a9b329b5d1e686b37a390b337e84..9e8ba8aa59870d5d3732f63a88215e7b9f9164ed 100644 (file)
@@ -334,6 +334,7 @@ Http::One::RequestParser::parse(const SBuf &aBuf)
              *       (ie, none, so don't try parsing em)
              */
             int64_t mimeHeaderBytes = 0;
+            // XXX: c_str() reallocates. performance regression.
             if ((mimeHeaderBytes = headersEnd(buf_.c_str(), buf_.length())) == 0) {
                 if (buf_.length()+firstLineSize() >= Config.maxRequestHeaderSize) {
                     debugs(33, 5, "Too large request");