~yadi/squid/parser-ng-htok

« back to all changes in this revision

Viewing changes to src/security/EncryptorAnswer.h

  • Committer: Amos Jeffries
  • Date: 2015-03-21 08:25:19 UTC
  • mfrom: (13987.1.1 crypto-ng-encryptor)
  • Revision ID: squid3@treenet.co.nz-20150321082519-lsb35xuj1oraz317
Crypto-NG: Move Ssl::PeerConnectorAnswer to Security::EncryptorAnswer

This class was not actually depending on OpenSSL API symbols and by
abstracting it out we can unify the callback handlers for encrypted and
non-encrypted logic paths for several classes that setup connections.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
 
3
 *
 
4
 * Squid software is distributed under GPLv2+ license and includes
 
5
 * contributions from numerous individuals and organizations.
 
6
 * Please see the COPYING and CONTRIBUTORS files for details.
 
7
 */
 
8
 
 
9
#ifndef SQUID_SECURITY_ENCRYPTORANSWER_H
 
10
#define SQUID_SECURITY_ENCRYPTORANSWER_H
 
11
 
 
12
#include "base/CbcPointer.h"
 
13
#include "comm/forward.h"
 
14
 
 
15
class ErrorState;
 
16
 
 
17
namespace Security {
 
18
 
 
19
/// Peer encrypted connection setup results (supplied via a callback).
 
20
/// The connection to peer was secured if and only if the error member is nil.
 
21
class EncryptorAnswer
 
22
{
 
23
public:
 
24
    ~EncryptorAnswer(); ///< deletes error if it is still set
 
25
    Comm::ConnectionPointer conn; ///< peer connection (secured on success)
 
26
 
 
27
    /// answer recepients must clear the error member in order to keep its info
 
28
    /// XXX: We should refcount ErrorState instead of cbdata-protecting it.
 
29
    CbcPointer<ErrorState> error; ///< problem details (nil on success)
 
30
};
 
31
 
 
32
std::ostream &operator <<(std::ostream &, const Security::EncryptorAnswer &);
 
33
 
 
34
} // namepace Security
 
35
 
 
36
#endif /* SQUID_SECURITY_ENCRYPTORANSWER_H */
 
37