Skip to content

Commit

Permalink
Refactor Security::BlindPeerConnector constructor (squid-cache#1511)
Browse files Browse the repository at this point in the history
Avoid having to include HttpRequest.h in
BlindPeerConnector.h by moving the
definition of the constructor to the .cc file
  • Loading branch information
kinkie authored and squid-anubis committed Nov 18, 2023
1 parent 5fb6afe commit 2c6781d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/security/BlindPeerConnector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,13 @@ Security::BlindPeerConnector::noteNegotiationDone(ErrorState *error)
}
}

Security::BlindPeerConnector::BlindPeerConnector(HttpRequestPointer &aRequest,
const Comm::ConnectionPointer &aServerConn,
const AsyncCallback<EncryptorAnswer> &aCallback,
const AccessLogEntryPointer &alp,
time_t timeout) :
AsyncJob("Security::BlindPeerConnector"),
Security::PeerConnector(aServerConn, aCallback, alp, timeout)
{
request = aRequest;
}
8 changes: 1 addition & 7 deletions src/security/BlindPeerConnector.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define SQUID_SRC_SECURITY_BLINDPEERCONNECTOR_H

#include "http/forward.h"
#include "HttpRequest.h"
#include "security/PeerConnector.h"

class ErrorState;
Expand All @@ -26,12 +25,7 @@ class BlindPeerConnector: public Security::PeerConnector {
const Comm::ConnectionPointer &aServerConn,
const AsyncCallback<EncryptorAnswer> &aCallback,
const AccessLogEntryPointer &alp,
const time_t timeout = 0) :
AsyncJob("Security::BlindPeerConnector"),
Security::PeerConnector(aServerConn, aCallback, alp, timeout)
{
request = aRequest;
}
time_t timeout = 0);

/* Security::PeerConnector API */

Expand Down
8 changes: 8 additions & 0 deletions src/tests/stub_libsecurity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
CBDATA_NAMESPACED_CLASS_INIT(Security, BlindPeerConnector);
namespace Security
{
BlindPeerConnector::BlindPeerConnector(HttpRequestPointer &, const Comm::ConnectionPointer & aServerConn,
const AsyncCallback<EncryptorAnswer> & aCallback,
const AccessLogEntryPointer &alp,
time_t) :
AsyncJob("Security::BlindPeerConnector"),
Security::PeerConnector(aServerConn, aCallback, alp, 0)
{STUB_NOP}

bool BlindPeerConnector::initialize(Security::SessionPointer &) STUB_RETVAL(false)
Security::ContextPointer BlindPeerConnector::getTlsContext() STUB_RETVAL(Security::ContextPointer())
void BlindPeerConnector::noteNegotiationDone(ErrorState *) STUB
Expand Down

0 comments on commit 2c6781d

Please sign in to comment.