checkUrlpath();
buildTitleUrl();
debugs(9, 5, HERE << "host=" << request->GetHost() << ", path=" <<
- request->urlpath.unsafeBuf() << ", user=" << user << ", passwd=" <<
+ request->urlpath << ", user=" << user << ", passwd=" <<
password);
state = BEGIN;
mode = 'A';
} else {
t = ftpState->request->urlpath.rpos('/');
- filename = t ? t + 1 : ftpState->request->urlpath.unsafeBuf();
+ filename = t ? t + 1 : ftpState->request->urlpath.termedBuf();
mode = mimeGetTransferMode(filename);
}
debugs(9, 3, HERE);
if (code == 200) {
- p = path = xstrdup(ftpState->request->urlpath.unsafeBuf());
+ p = path = xstrdup(ftpState->request->urlpath.termedBuf());
if (*p == '/')
p++;
if (ftpState->theSize == 0) {
debugs(9, 2, "SIZE reported " <<
ftpState->ctrl.last_reply << " on " <<
- ftpState->title_url.unsafeBuf());
+ ftpState->title_url);
ftpState->theSize = -1;
}
} else if (code < 0) {
safe_free(ftpState->filepath);
/* Build the new path (urlpath begins with /) */
- path = xstrdup(ftpState->request->urlpath.unsafeBuf());
+ path = xstrdup(ftpState->request->urlpath.termedBuf());
rfc1738_unescape(path);
e->buffer(); /* released when done processing current data payload */
- filename = (t = urlpath.rpos('/')) ? t + 1 : urlpath.unsafeBuf();
+ filename = (t = urlpath.rpos('/')) ? t + 1 : urlpath.termedBuf();
if (flags.isdir) {
mime_type = "text/html";
if (request->protocol != PROTO_FTP)
return NULL;
- if ( !strncmp(request->urlpath.unsafeBuf(), "/", 1) ) {
+ if ( request->urlpath[0]=='/' ) {
newbuf.append(request->urlpath);
request->urlpath.absorb(newbuf);
safe_free(request->canonical);
- } else if ( !strncmp(request->urlpath.unsafeBuf(), "%2f", 3) ) {
- newbuf.append(request->urlpath.unsafeBuf() +1);
+ } else if ( !strncmp(request->urlpath.termedBuf(), "%2f", 3) ) {
+ newbuf.append(request->urlpath.rawBuf() +1, request->urlpath.size()-1);
request->urlpath.absorb(newbuf);
safe_free(request->canonical);
}
const char *url;
if (_peer->options.originserver)
- url = orig_request->urlpath.unsafeBuf();
+ url = orig_request->urlpath.termedBuf();
else
url = entry->url();
strListAdd(&vstr, name, ',');
hdr = request->header.getByName(name);
safe_free(name);
- value = hdr.unsafeBuf();
+ value = hdr.termedBuf();
if (value) {
value = rfc1738_escape_part(value);
strListAdd(&vstr, name, ',');
hdr = request->header.getByName(name);
safe_free(name);
- value = hdr.unsafeBuf();
+ value = hdr.termedBuf();
if (value) {
value = rfc1738_escape_part(value);
vary.clean();
#endif
- debugs(11, 3, "httpMakeVaryMark: " << vstr.unsafeBuf());
- return vstr.unsafeBuf();
+ debugs(11, 3, "httpMakeVaryMark: " << vstr);
+ return vstr.termedBuf();
}
void
header = hdr->getStrOrList(HDR_PROXY_SUPPORT);
/* XXX This ought to be done in a case-insensitive manner */
- rc = (strstr(header.unsafeBuf(), "Session-Based-Authentication") != NULL);
+ rc = (strstr(header.termedBuf(), "Session-Based-Authentication") != NULL);
return rc;
}
*/
/*
void
-HttpStateData::ReadReplyWrapper(int fd, char *unsafeBuf, size_t len, comm_err_t flag, int xerrno, void *data)
+HttpStateData::ReadReplyWrapper(int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void *data)
{
HttpStateData *httpState = static_cast<HttpStateData *>(data);
assert (fd == httpState->fd);
- // assert(unsafeBuf == readBuf->content());
+ // assert(buf == readBuf->content());
PROF_start(HttpStateData_readReply);
httpState->readReply (len, flag, xerrno);
PROF_stop(HttpStateData_readReply);
if (!flags.headers_parsed && len > 0 && fd_table[fd].uses > 1) {
/* Skip whitespace between replies */
- while (len > 0 && xisspace(*unsafeBuf))
- xmemmove(unsafeBuf, unsafeBuf + 1, len--);
+ while (len > 0 && xisspace(*buf))
+ xmemmove(buf, buf + 1, len--);
if (len == 0) {
/* Continue to read... */
orig_request->http_ver.major,
orig_request->http_ver.minor, ThisCache);
strListAdd(&strVia, bbuf, ',');
- hdr_out->putStr(HDR_VIA, strVia.unsafeBuf());
+ hdr_out->putStr(HDR_VIA, strVia.termedBuf());
strVia.clean();
}
snprintf(bbuf, BBUF_SZ, "%s=\"Surrogate/1.0 ESI/1.0\"",
Config.Accel.surrogate_id);
strListAdd(&strSurrogate, bbuf, ',');
- hdr_out->putStr(HDR_SURROGATE_CAPABILITY, strSurrogate.unsafeBuf());
+ hdr_out->putStr(HDR_SURROGATE_CAPABILITY, strSurrogate.termedBuf());
}
#endif
strFwd = orig_request->client_addr.NtoA(ntoabuf, MAX_IPSTRLEN);
}
if (strFwd.size() > 0)
- hdr_out->putStr(HDR_X_FORWARDED_FOR, strFwd.unsafeBuf());
+ hdr_out->putStr(HDR_X_FORWARDED_FOR, strFwd.termedBuf());
}
/** If set to DELETE - do not copy through. */
strFwd.clean();
const char *username = "-";
if (orig_request->extacl_user.size())
- username = orig_request->extacl_user.unsafeBuf();
+ username = orig_request->extacl_user.termedBuf();
else if (orig_request->auth_user_request)
username = orig_request->auth_user_request->username();
} else if (strcmp(orig_request->peer_login, "PASS") == 0) {
if (orig_request->extacl_user.size() && orig_request->extacl_passwd.size()) {
char loginbuf[256];
- snprintf(loginbuf, sizeof(loginbuf), "%s:%s", orig_request->extacl_user.unsafeBuf(), orig_request->extacl_passwd.unsafeBuf());
+ snprintf(loginbuf, sizeof(loginbuf), "%.*s:%.*s",
+ orig_request->extacl_user.size(),
+ orig_request->extacl_user.rawBuf(),
+ orig_request->extacl_passwd.size(),
+ orig_request->extacl_passwd.rawBuf());
httpHeaderPutStrf(hdr_out, HDR_PROXY_AUTHORIZATION, "Basic %s",
base64_encode(loginbuf));
}
hdr_out->putStr(HDR_AUTHORIZATION, auth);
} else if (orig_request->extacl_user.size() && orig_request->extacl_passwd.size()) {
char loginbuf[256];
- snprintf(loginbuf, sizeof(loginbuf), "%s:%s", orig_request->extacl_user.unsafeBuf(), orig_request->extacl_passwd.unsafeBuf());
+ snprintf(loginbuf, sizeof(loginbuf), "%.*s:%.*s",
+ orig_request->extacl_user.size(),
+ orig_request->extacl_user.rawBuf(),
+ orig_request->extacl_passwd.size(),
+ orig_request->extacl_passwd.rawBuf());
httpHeaderPutStrf(hdr_out, HDR_AUTHORIZATION, "Basic %s",
base64_encode(loginbuf));
}