diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-11-08 10:48:02 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-11-08 10:48:02 +0000 |
| commit | 52316b09723bb004d2479fa897677eaa62e28d57 (patch) | |
| tree | f245de8a8662075230f5070065bb351a11346e24 /src/SocketCore.h | |
| parent | 5c4910f71e7002c4f5dc5977be27b84d65609c27 (diff) | |
2008-11-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Introduced TLSContext that holds TLS related data that can be
shared with multiple SSL connections.
* src/DownloadEngineFactory.cc
* src/LibgnutlsTLSContext.cc
* src/LibgnutlsTLSContext.h
* src/LibsslTLSContext.cc
* src/LibsslTLSContext.h
* src/Makefile.am
* src/SocketCore.cc
* src/SocketCore.h
* src/TLSContext.h
* src/message.h
Diffstat (limited to 'src/SocketCore.h')
| -rw-r--r-- | src/SocketCore.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/SocketCore.h b/src/SocketCore.h index fd1a3396..e55c387f 100644 --- a/src/SocketCore.h +++ b/src/SocketCore.h @@ -54,12 +54,15 @@ # include <gnutls/gnutls.h> #endif // HAVE_LIBGNUTLS +#include "SharedHandle.h" #include "a2io.h" #include "a2netcompat.h" #include "a2time.h" namespace aria2 { +class TLSContext; + class SocketCore { friend bool operator==(const SocketCore& s1, const SocketCore& s2); friend bool operator!=(const SocketCore& s1, const SocketCore& s2); @@ -85,16 +88,18 @@ private: bool _wantRead; bool _wantWrite; +#if ENABLE_SSL + static SharedHandle<TLSContext> _tlsContext; +#endif + #ifdef HAVE_LIBSSL // for SSL - SSL_CTX* sslCtx; SSL* ssl; int sslHandleEAGAIN(int ret); #endif // HAVE_LIBSSL #ifdef HAVE_LIBGNUTLS gnutls_session_t sslSession; - gnutls_certificate_credentials_t sslXcred; char* peekBuf; size_t peekBufLength; size_t peekBufMax; @@ -317,6 +322,8 @@ public: * readData() or writeData() and the socket needs to write more data. */ bool wantWrite() const; + + static void setTLSContext(const SharedHandle<TLSContext>& tlsContext); }; } // namespace aria2 |
