BIO source and sink node, handling socket I/O and monitoring SSL state. More...

#include <bio.h>

Inheritance diagram for Ssl::Bio:
Collaboration diagram for Ssl::Bio:

Public Member Functions

 Bio (const int anFd)
 
virtual ~Bio ()
 
virtual int write (const char *buf, int size, BIO *table)
 Writes the given data to socket. More...
 
virtual int read (char *buf, int size, BIO *table)
 Reads data from socket. More...
 
virtual void flush (BIO *table)
 
int fd () const
 The SSL socket descriptor. More...
 
virtual void stateChanged (const SSL *ssl, int where, int ret)
 
const SBufrBufData ()
 The buffered input data. More...
 

Static Public Member Functions

static BIO * Create (const int fd, Security::Io::Type type)
 
static void Link (SSL *ssl, BIO *bio)
 Tells ssl connection to use BIO and monitor state via stateChanged() More...
 

Protected Attributes

const int fd_
 the SSL socket we are reading and writing More...
 
SBuf rbuf
 Used to buffer input data. More...
 

Detailed Description

Definition at line 30 of file bio.h.

Constructor & Destructor Documentation

Ssl::Bio::Bio ( const int  anFd)
explicit

Definition at line 98 of file bio.cc.

References debugs, and fd_.

Ssl::Bio::~Bio ( )
virtual

Definition at line 103 of file bio.cc.

References debugs.

Member Function Documentation

BIO * Ssl::Bio::Create ( const int  fd,
Security::Io::Type  type 
)
static

Creates a low-level BIO table, creates a high-level Ssl::Bio object for a given socket, and then links the two together via BIO_C_SET_FD.

Definition at line 66 of file bio.cc.

References NULL, squid_bio_create(), squid_bio_ctrl(), squid_bio_destroy(), squid_bio_puts(), squid_bio_read(), squid_bio_write(), and SquidMethods.

Referenced by CreateSession().

int Ssl::Bio::fd ( ) const
inline

Definition at line 46 of file bio.h.

References fd_.

Referenced by squid_bio_ctrl().

virtual void Ssl::Bio::flush ( BIO *  table)
inlinevirtual

Flushes any buffered data to socket. The Ssl::Bio does not buffer any data, so this method has nothing to do

Reimplemented in Ssl::ServerBio.

Definition at line 44 of file bio.h.

Referenced by squid_bio_ctrl().

void Ssl::Bio::Link ( SSL *  ssl,
BIO *  bio 
)
static

Definition at line 92 of file bio.cc.

References squid_ssl_info().

Referenced by CreateSession().

const SBuf& Ssl::Bio::rBufData ( )
inline

Definition at line 58 of file bio.h.

References rbuf.

Referenced by Ssl::PeekingPeerConnector::initialize(), and switchToTunnel().

int Ssl::Bio::read ( char *  buf,
int  size,
BIO *  table 
)
virtual
void Ssl::Bio::stateChanged ( const SSL *  ssl,
int  where,
int  ret 
)
virtual

Called by linked SSL connection whenever state changes, an alert appears, or an error occurs. See SSL_set_info_callback().

Called whenever the SSL connection state changes, an alert appears, or an error occurs. See SSL_set_info_callback().

Reimplemented in Ssl::ServerBio, and Ssl::ClientBio.

Definition at line 156 of file bio.cc.

References debugs.

Referenced by Ssl::ClientBio::stateChanged(), and Ssl::ServerBio::stateChanged().

int Ssl::Bio::write ( const char *  buf,
int  size,
BIO *  table 
)
virtual

Member Data Documentation

const int Ssl::Bio::fd_
protected

Definition at line 60 of file bio.h.

Referenced by Bio(), and fd().

SBuf Ssl::Bio::rbuf
protected

Definition at line 61 of file bio.h.

Referenced by rBufData(), and Ssl::ClientBio::setReadBufData().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors