Skip to content

Instantly share code, notes, and snippets.

@RootUp
Created January 6, 2019 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RootUp/265cfec5a13aeb7bc8350672ff386d14 to your computer and use it in GitHub Desktop.
Save RootUp/265cfec5a13aeb7bc8350672ff386d14 to your computer and use it in GitHub Desktop.
HttpConnection.cc
# https://github.com/aria2/aria2/blob/37368130ca7de5491a75fd18a20c5c5cc641824a/src/HttpConnection.cc
std::string result;
std::string line;
while (getline(istr, line)) {
if (util::startsWith(line, "Authorization: Basic")) {
result += "Authorization: Basic ********\n";
}
else if (util::startsWith(line, "Proxy-Authorization: Basic")) {
result += "Proxy-Authorization: Basic ********\n";
}
....
const auto& proc = outstandingHttpRequests_.front()->getHttpHeaderProcessor();
if (proc->parse(socketRecvBuffer_->getBuffer(),
ocketRecvBuffer_->getBufferLength())) {
A2_LOG_INFO(
fmt(MSG_RECEIVE_RESPONSE, cuid_, proc->getHeaderString().c_str()));
auto result = proc->getResult();
if (result->getStatusCode() / 100 == 1) {
socketRecvBuffer_->drain(proc->getLastBytesProcessed());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment