From: Francesco Chemolli Date: Fri, 30 Jan 2009 09:54:59 +0000 (+0100) Subject: Verified and converted more String users. X-Git-Tag: SQUID_3_2_0_1~1212^2~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4232c626c22f98da411b74532c0b3c276ebdaab0;p=thirdparty%2Fsquid.git Verified and converted more String users. --- diff --git a/src/ICAP/ICAPModXact.cc b/src/ICAP/ICAPModXact.cc index e714eaaacb..36e7c057e1 100644 --- a/src/ICAP/ICAPModXact.cc +++ b/src/ICAP/ICAPModXact.cc @@ -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: "); diff --git a/src/tests/testEvent.cc b/src/tests/testEvent.cc index 1305a84ebe..c15b0dc458 100644 --- a/src/tests/testEvent.cc +++ b/src/tests/testEvent.cc @@ -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] );