]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Give full Request-URI to eCAP adapters.
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 3 Apr 2011 11:05:39 +0000 (05:05 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 3 Apr 2011 11:05:39 +0000 (05:05 -0600)
Implement libecap::RequestLine::uri() to return full Request-URI instead
of URL path.

Niether full URL nor URL path is perfect because the actual request may
have full URI or a path, but Squid does not really keep that
information. This change makes our eCAP implementation consistent with
our ICAP implementation.

Eventually, eCAP may have an API that is guaranteed to return full
Request-URI and Squid may remember what kind of URI it got in the virgin
request, allowing for a more truthful implementation.

src/adaptation/ecap/MessageRep.cc

index 8acf3798ed88b446e080f8295b718e2bd3664825..18024a61c94b41cf0effcea12d1ac9a63f3ccb58 100644 (file)
@@ -199,8 +199,10 @@ Adaptation::Ecap::RequestLineRep::uri(const Area &aUri)
 Adaptation::Ecap::RequestLineRep::Area
 Adaptation::Ecap::RequestLineRep::uri() const
 {
-    return Area::FromTempBuffer(theMessage.urlpath.rawBuf(),
-                                theMessage.urlpath.size());
+    const char *fullUrl = urlCanonical(&theMessage);
+    Must(fullUrl);
+    // optimize: avoid copying by having an Area::Detail that locks theMessage
+    return Area::FromTempBuffer(fullUrl, strlen(fullUrl));
 }
 
 void