Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/auth/ntlm/UserRequest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,23 @@ Auth::Ntlm::UserRequest::authenticate(HttpRequest * aRequest, ConnStateData * co
/* get header */
const char *proxy_auth = aRequest->header.getStr(type);

/* if proxy_auth is actually NULL, we'd better not manipulate it. */
if (!proxy_auth) {
debugs(29, 4, "WARNING: NTLM Authentication missing authorization header");
return;
}

/* locate second word */
const char *blob = proxy_auth;

/* if proxy_auth is actually NULL, we'd better not manipulate it. */
if (blob) {
while (xisspace(*blob) && *blob)
++blob;
while (xisspace(*blob) && *blob)
++blob;

while (!xisspace(*blob) && *blob)
++blob;
while (!xisspace(*blob) && *blob)
++blob;

while (xisspace(*blob) && *blob)
++blob;
}
while (xisspace(*blob) && *blob)
++blob;

switch (user()->credentials()) {

Expand Down
32 changes: 0 additions & 32 deletions src/http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2615,38 +2615,6 @@ HttpStateData::doneSendingRequestBody()
sendComplete();
}

// more origin request body data is available
void
HttpStateData::handleMoreRequestBodyAvailable()
{
if (eof || !Comm::IsConnOpen(serverConnection)) {
// XXX: we should check this condition in other callbacks then!
// TODO: Check whether this can actually happen: We should unsubscribe
// as a body consumer when the above condition(s) are detected.
debugs(11, DBG_IMPORTANT, "Transaction aborted while reading HTTP body");
return;
}

assert(requestBodySource != nullptr);

if (requestBodySource->buf().hasContent()) {
// XXX: why does not this trigger a debug message on every request?

if (flags.headers_parsed && !flags.abuse_detected) {
flags.abuse_detected = true;
debugs(11, DBG_IMPORTANT, "http handleMoreRequestBodyAvailable: Likely proxy abuse detected '" << request->client_addr << "' -> '" << entry->url() << "'" );

if (virginReply()->sline.status() == Http::scInvalidHeader) {
closeServer();
mustStop("HttpStateData::handleMoreRequestBodyAvailable");
return;
}
}
}

HttpStateData::handleMoreRequestBodyAvailable();
}

// premature end of the request body
void
HttpStateData::handleRequestBodyProducerAborted()
Expand Down
2 changes: 0 additions & 2 deletions src/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ class HttpStateData : public Client
std::optional<size_t> canBufferMoreReplyBytes() const;
size_t maybeMakeSpaceAvailable(size_t maxReadSize);

// consuming request body
virtual void handleMoreRequestBodyAvailable();
void handleRequestBodyProducerAborted() override;

void writeReplyBody();
Expand Down
1 change: 0 additions & 1 deletion src/http/StateFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class StateFlags
bool toOriginPeer() const { return toOrigin && peering && !tunneling; }

bool keepalive_broken = false;
bool abuse_detected = false;
bool request_sent = false;
bool chunked = false; ///< reading a chunked response; TODO: rename
bool chunked_request = false; ///< writing a chunked request
Expand Down
Loading