]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Verified and converted more String users.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 30 Jan 2009 09:54:59 +0000 (10:54 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 30 Jan 2009 09:54:59 +0000 (10:54 +0100)
src/ICAP/ICAPModXact.cc
src/tests/testEvent.cc

index e714eaaacb4e662e210a30869ba219b497c85529..36e7c057e1a5809688dcb89e24d9d41b615126a1 100644 (file)
@@ -1038,13 +1038,17 @@ void ICAPModXact::makeRequestHeaders(MemBuf &buf)
 
     // we must forward "Proxy-Authenticate" and "Proxy-Authorization"
     // as ICAP headers.
-    if (virgin.header->header.has(HDR_PROXY_AUTHENTICATE))
-        buf.Printf("Proxy-Authenticate: %s\r\n",
-                   virgin.header->header.getByName("Proxy-Authenticate").unsafeBuf());
+    if (virgin.header->header.has(HDR_PROXY_AUTHENTICATE)) {
+        String vh=virgin.header->header.getByName("Proxy-Authenticate");
+        buf.Printf("Proxy-Authenticate: %.*s\r\n",
+                   vh.size(), vh.rawBuf());
+    }
 
-    if (virgin.header->header.has(HDR_PROXY_AUTHORIZATION))
-        buf.Printf("Proxy-Authorization: %s\r\n",
-                   virgin.header->header.getByName("Proxy-Authorization").unsafeBuf());
+    if (virgin.header->header.has(HDR_PROXY_AUTHORIZATION)) {
+        String vh=virgin.header->header.getByName("Proxy-Authorization");
+        buf.Printf("Proxy-Authorization: %.*s\r\n",
+                   vh.size(), vh.rawBuf());
+    }
 
     buf.Printf("Encapsulated: ");
 
index 1305a84ebe8fb1b75f9f4c66c48e7c66c0934758..c15b0dc458c36291bf67cf0d66742b9aa3f088df 100644 (file)
@@ -98,16 +98,16 @@ testEvent::testDump()
     printf("Actual Text:\n");
     /* TODO: these should really be just [] lookups, but String doesn't have those here yet. */
     for ( int i = 0; i < anEntry->_appended_text.size(); i++) {
-        CPPUNIT_ASSERT( expect.unsafeBuf()[i] );
-        CPPUNIT_ASSERT( anEntry->_appended_text.unsafeBuf()[i] );
+        CPPUNIT_ASSERT( expect[i] );
+        CPPUNIT_ASSERT( anEntry->_appended_text[i] );
 
         /* slight hack to make special chars visible */
-        switch (anEntry->_appended_text.unsafeBuf()[i]) {
+        switch (anEntry->_appended_text[i]) {
         case '\t':
             printf("\\t");
             break;
         default:
-            printf("%c", anEntry->_appended_text.unsafeBuf()[i] );
+            printf("%c", anEntry->_appended_text[i] );
         }
         /* make this an int comparison, so that we can see the ASCII code at failure */
         CPPUNIT_ASSERT_EQUAL( (int)expect.unsafeBuf()[i], (int)anEntry->_appended_text.unsafeBuf()[i] );