if (hdr == NULL)
return false;
- debugs(28, 3, "aclHeaderData::match: checking '" << hdrName.unsafeBuf() << "'");
+ debugs(28, 3, "aclHeaderData::match: checking '" << hdrName << "'");
- String value = hdrId != HDR_BAD_HDR ? hdr->getStrOrList(hdrId) : hdr->getByName(hdrName.unsafeBuf());
+ String value = hdrId != HDR_BAD_HDR ? hdr->getStrOrList(hdrId) : hdr->getByName(hdrName.termedBuf());
- return regex_rule->match(value.unsafeBuf());
+ return regex_rule->match(value.termedBuf());
}
wordlist *
ACLHTTPHeaderData::dump()
{
wordlist *W = NULL;
- wordlistAdd(&W, hdrName.unsafeBuf());
+ wordlistAdd(&W, hdrName.termedBuf());
wordlist * regex_dump = regex_rule->dump();
wordlistAddWl(&W, regex_dump);
wordlistDestroy(®ex_dump);
char* t = strtokFile();
assert (t != NULL);
hdrName = t;
- hdrId = httpHeaderIdByNameDef(hdrName.unsafeBuf(), strlen(hdrName.unsafeBuf()));
+ hdrId = httpHeaderIdByNameDef(hdrName.rawBuf(), hdrName.size());
regex_rule->parse();
}
bool
ACLHTTPHeaderData::empty() const
{
- return (hdrId == HDR_BAD_HDR && !hdrName.unsafeBuf()) || regex_rule->empty();
+ return (hdrId == HDR_BAD_HDR && hdrName.undefined()) || regex_rule->empty();
}
ACLData<HttpHeader*> *
int
ACLUrlPathStrategy::match (ACLData<char const *> * &data, ACLChecklist *checklist)
{
- char *esc_buf = xstrdup(checklist->request->urlpath.unsafeBuf());
+ char *esc_buf = xstrdup(checklist->request->urlpath.termedBuf());
rfc1738_unescape(esc_buf);
int result = data->match(esc_buf);
safe_free(esc_buf);
void ICAPOptXact::makeRequest(MemBuf &buf)
{
const Adaptation::Service &s = service();
- buf.Printf("OPTIONS %s ICAP/1.0\r\n", s.cfg().uri.buf());
- buf.Printf("Host: %s:%d\r\n", s.cfg().host.buf(), s.cfg().port);
+ const String uri = s.cfg().uri;
+ buf.Printf("OPTIONS %.*s ICAP/1.0\r\n", uri.size(), uri.rawBuf());
+ const String host = s.cfg().host;
+ buf.Printf("Host: %.*s:%d\r\n", host.size(), host.rawBuf(), s.cfg().port);
buf.append(ICAP::crlf, 2);
}
{
const String s = h->getByName(fname);
- if (s.size() && xisdigit(*s.unsafeBuf()))
- value = atoi(s.unsafeBuf());
+ if (s.size() && xisdigit(*s.termedBuf()))
+ value = atoi(s.termedBuf());
else
value = -1;
if (eLen < urlLen) {
const int eOff = urlLen - eLen;
// RFC 3507 examples imply that extensions come without leading '.'
- if (urlPath.unsafeBuf()[eOff-1] == '.' &&
- strcmp(urlPath.unsafeBuf() + eOff, e->key) == 0) {
+ if (urlPath[eOff-1] == '.' &&
+ strcmp(urlPath.termedBuf() + eOff, e->key) == 0) {
debugs(93,7, "ICAPOptions url " << urlPath << " matches " <<
name << " extension " << e->key);
return true;
debugs(93,1, "WARNING: Squid is configured to use ICAP method " <<
cfg().methodStr() <<
" for service " << cfg().uri.unsafeBuf() <<
- " but OPTIONS response declares the methods are " << method_list.unsafeBuf());
+ " but OPTIONS response declares the methods are " << method_list);
}
}
aLogEntry->http.version = request->http_ver;
aLogEntry->hier = request->hier;
aLogEntry->cache.requestSize += request->content_length;
- aLogEntry->cache.extuser = request->extacl_user.unsafeBuf();
+ aLogEntry->cache.extuser = request->extacl_user.termedBuf();
if (request->auth_user_request) {
if (al.reply) {
al.http.code = al.reply->sline.status;
- al.http.content_type = al.reply->content_type.unsafeBuf();
+ al.http.content_type = al.reply->content_type.termedBuf();
} else if (loggingEntry() && loggingEntry()->mem_obj) {
al.http.code = loggingEntry()->mem_obj->getReply()->sline.status;
al.http.content_type = loggingEntry()->mem_obj->getReply()->content_type.unsafeBuf();
static void
clientPackTermBound(String boundary, MemBuf * mb)
{
- mb->Printf("\r\n--%s--\r\n", boundary.unsafeBuf());
+ mb->Printf("\r\n--%.*s--\r\n", boundary.size(), boundary.rawBuf());
debugs(33, 6, "clientPackTermBound: buf offset: " << mb->size);
}
assert(spec);
/* put boundary */
- debugs(33, 5, "clientPackRangeHdr: appending boundary: " <<
- boundary.unsafeBuf());
+ debugs(33, 5, "clientPackRangeHdr: appending boundary: " << boundary);
/* rfc2046 requires to _prepend_ boundary with <crlf>! */
- mb->Printf("\r\n--%s\r\n", boundary.unsafeBuf());
+ mb->Printf("\r\n--%.*s\r\n", boundary.size(), boundary.rawBuf());
/* stuff the header with required entries and pack it */
request->flags.spoof_client_ip = conn->port->spoof_client_ip;
}
- if (internalCheck(request->urlpath.unsafeBuf())) {
+ if (internalCheck(request->urlpath.termedBuf())) {
if (internalHostnameIs(request->GetHost()) &&
request->port == getMyPort()) {
http->flags.internal = 1;
int connection_auth_blocked = 0;
while ((e = hdr->getEntry(&pos))) {
if (e->id == HDR_WWW_AUTHENTICATE) {
- const char *value = e->value.unsafeBuf();
+ const char *value = e->value.rawBuf();
if ((strncasecmp(value, "NTLM", 4) == 0 &&
(value[4] == '\0' || value[4] == ' '))
ThisCache);
strListAdd(&strVia, bbuf, ',');
hdr->delById(HDR_VIA);
- hdr->putStr(HDR_VIA, strVia.unsafeBuf());
+ hdr->putStr(HDR_VIA, strVia.termedBuf());
}
/* Signal keep-alive if needed */
hdr->putStr(http->flags.accel ? HDR_CONNECTION : HDR_PROXY_CONNECTION,
int may_pin = 0;
while ((e = req_hdr->getEntry(&pos))) {
if (e->id == HDR_AUTHORIZATION || e->id == HDR_PROXY_AUTHORIZATION) {
- const char *value = e->value.unsafeBuf();
+ const char *value = e->value.rawBuf();
if (strncasecmp(value, "NTLM ", 5) == 0
||
strncasecmp(value, "Negotiate ", 10) == 0
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] );
+ CPPUNIT_ASSERT_EQUAL( (int)(expect[i]), (int)anEntry->_appended_text[i] );
}
printf("\n");
CPPUNIT_ASSERT_EQUAL( expect, anEntry->_appended_text);
EBIT_CLR(e->flags, KEY_PRIVATE);
e->ping_status = PING_NONE;
EBIT_CLR(e->flags, ENTRY_VALIDATED);
- e->hashInsert((const cache_key *)name.unsafeBuf()); /* do it after we clear KEY_PRIVATE */
+ e->hashInsert((const cache_key *)name.termedBuf()); /* do it after we clear KEY_PRIVATE */
return e;
}
EBIT_CLR(e->flags, KEY_PRIVATE);
e->ping_status = PING_NONE;
EBIT_CLR(e->flags, ENTRY_VALIDATED);
- e->hashInsert((const cache_key *)name.unsafeBuf()); /* do it after we clear KEY_PRIVATE */
+ e->hashInsert((const cache_key *)name.termedBuf()); /* do it after we clear KEY_PRIVATE */
return e;
}