#include <sslbuffer.h>
Inheritance diagram for Dv::Ssl::Buffer:
Public Member Functions | |
Buffer (Context &context, int fd, size_t inbufsize=1024, size_t outbufsize=1024, int msecs=0, unsigned int min_debug_level=0, Debugable *debug_master=0) | |
Constructor. | |
~Buffer () | |
Destructor. | |
void * | ssl () const |
Return pointer to SSL object. | |
const char * | cipher () const |
Return string representation of cypher. | |
int | iwait () const |
Wait for input to become available. | |
Protected Member Functions | |
virtual int | rread (char *buf, size_t len) |
Raw read implementation. | |
virtual int | rwrite (char *buf, size_t len) |
Raw write implementation, see Dv::Util::fdstreambuf. | |
Private Attributes | |
void * | ssl_ |
Opaque pointer to SSL object. |
Definition at line 14 of file sslbuffer.h.
Dv::Ssl::Buffer::Buffer | ( | Context & | context, | |
int | fd, | |||
size_t | inbufsize = 1024 , |
|||
size_t | outbufsize = 1024 , |
|||
int | msecs = 0 , |
|||
unsigned int | min_debug_level = 0 , |
|||
Debugable * | debug_master = 0 | |||
) |
Constructor.
context |
fd | underlying filedescriptor | |
inbufsize | size of input buffer | |
outbufsize | size of input buffer | |
msecs | max timeout value in millisecs. | |
min_debug_level | if a debug_master is connected, logging info will only be written if the master's level is at least min_debug_level | |
debug_master | from where debug info will be taken |
Dv::Ssl::Buffer::~Buffer | ( | ) |
Destructor.
void* Dv::Ssl::Buffer::ssl | ( | ) | const [inline] |
Return pointer to SSL object.
The return type is declared as void* to avoid inclusion of the openssl h header files.
Definition at line 37 of file sslbuffer.h.
References ssl_.
const char* Dv::Ssl::Buffer::cipher | ( | ) | const |
Return string representation of cypher.
int Dv::Ssl::Buffer::iwait | ( | ) | const [virtual] |
Wait for input to become available.
This function is a specialisation of Dv::Util::fdstreambuf::iwait which first uses SSL_pending to check whether bytes for reading are available in the underlying SSL object. Only if this fails does it call Dv::Util::fdstreambuf::iwait.
0 if a timeout occurred
-1 if an error condition exists (e.g. underlying fd not set)
Reimplemented from Dv::Util::fdstreambuf.
virtual int Dv::Ssl::Buffer::rread | ( | char * | buf, | |
size_t | len | |||
) | [protected, virtual] |
Raw read implementation.
buf | to read into | |
len | number of bytes to read |
0 on EOF
-1 on error
Reimplemented from Dv::Util::fdstreambuf.
virtual int Dv::Ssl::Buffer::rwrite | ( | char * | buf, | |
size_t | len | |||
) | [protected, virtual] |
Raw write implementation, see Dv::Util::fdstreambuf.
buf | to write from | |
len | number of bytes to write |
-1 on error
Reimplemented from Dv::Util::fdstreambuf.
void* Dv::Ssl::Buffer::ssl_ [private] |