Skip to content

Commit

Permalink
Several fixes
Browse files Browse the repository at this point in the history
* Fixed comments and documentation according to the wiki
  'response terminology'.

* Initialize http->al->reply just after clone(), in order to supply
  it to early ACLs checks called during building the final response
  header (e.g., reply_header_add ACLs).
  • Loading branch information
eduard-bagdasaryan committed Jul 25, 2019
1 parent 53a8826 commit 824da98
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/AccessLogEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class AccessLogEntry: public RefCountable
SBuf lastAclData; ///< string for external_acl_type %DATA format code

HierarchyLogEntry hier;
HttpReplyPointer reply; ///< virgin 1xx reply or a reply a to-be-sent to client
HttpReplyPointer reply; ///< the last sent reply
HttpRequest *request = nullptr; //< virgin HTTP request
HttpRequest *adapted_request = nullptr; //< HTTP request after adaptation and redirection

Expand Down
8 changes: 3 additions & 5 deletions src/cf.data.pre
Original file line number Diff line number Diff line change
Expand Up @@ -4696,15 +4696,13 @@ DOC_START

RESPONSE

[http::]<Hs HTTP status code received from the next hop
[http::]<Hs HTTP status code of the last received virgin final reply
[http::]>Hs HTTP status code of the last sent reply.

[http::]<h The header of the last sent reply. If that last
reply was an interim reply (e.g., HTTP 100 Continue),
then the interim reply header is logged.
[http::]<h The header of the last sent reply.
Optional header name argument as for >h.

[http::]mt MIME content type of the last sent reply.
[http::]mt MIME type of the last sent reply.

See http://wiki.squid-cache.org/ResponseTerms for details.

Expand Down
3 changes: 0 additions & 3 deletions src/client_side.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,6 @@ ClientHttpRequest::logRequest()
al->http.code = al->reply->sline.status();
al->http.content_type = al->reply->content_type.termedBuf();
} else if (loggingEntry() && loggingEntry()->mem_obj) {
// possibly unreachable code, since al->reply is always
// initialized before loggingEntry and TODO: if al->reply
// is nil, loggingEntry is nil either.`
al->http.code = loggingEntry()->mem_obj->getReply()->sline.status();
al->http.content_type = loggingEntry()->mem_obj->getReply()->content_type.termedBuf();
}
Expand Down
4 changes: 2 additions & 2 deletions src/client_side_reply.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1649,15 +1649,15 @@ clientReplyContext::cloneReply()
reply = http->storeEntry()->getReply()->clone();
HTTPMSGLOCK(reply);

http->al->reply = reply;

if (reply->sline.protocol == AnyP::PROTO_HTTP) {
/* RFC 2616 requires us to advertise our version (but only on real HTTP traffic) */
reply->sline.version = Http::ProtocolVersion();
}

/* do header conversions */
buildReplyHeader();

http->al->reply = reply;
}

/// Safely disposes of an entry pointing to a cache hit that we do not want.
Expand Down

0 comments on commit 824da98

Please sign in to comment.