Functions

tls_ct_wrq.c File Reference

tls clear text write queue. More...

#include "tls_ct_wrq.h"
#include "tls_cfg.h"
#include "tls_server.h"
#include "../../atomic_ops.h"
#include "../../mem/shm_mem.h"
#include <openssl/err.h>
#include <openssl/ssl.h>
Include dependency graph for tls_ct_wrq.c:

Go to the source code of this file.

Functions


Detailed Description

(queue clear text when SSL_write() cannot write it immediately due to re-keying).

Module: SIP-router TLS support

Definition in file tls_ct_wrq.c.


Function Documentation

static int ssl_flush ( void *  tcp_c,
void *  error,
const void *  buf,
unsigned  size 
) [static]
Parameters:
tcp_c TCP connection containing the SSL context
error error reason (set on exit)
buf buffer
size buffer size
Returns:
>0 on success (bytes written), <=0 on ssl error (should be handled outside)
Warning:
the SSL context must have the wbio and rbio previously set!

Definition at line 97 of file tls_ct_wrq.c.

References tls_accept(), and tls_connect().

Referenced by tls_ct_wq_flush().

Here is the call graph for this function:

Here is the caller graph for this function:

int tls_ct_wq_add ( tls_ct_q **  ct_q,
const void *  data,
unsigned int  size 
)

Wrapper over tls_ct_q_add(), besides doing a tls_ct_q_add it also keeps track of queue size and total queued bytes. If the maximum queue size is exceeded => error.

Parameters:
ct_q clear text queue
data data
size data size
Returns:
0 on success, < 0 on error (-1 memory allocation, -2 queue size too big).

Definition at line 173 of file tls_ct_wrq.c.

References tls_ct_q_add().

Referenced by tls_encode_f().

Here is the call graph for this function:

Here is the caller graph for this function:

int tls_ct_wq_flush ( struct tcp_connection *  c,
tls_ct_q **  ct_q,
int *  flags,
int *  ssl_err 
)

Wrapper over tls_ct_q_flush(), besides doing a tls_ct_q_add it also keeps track of queue size and total queued bytes.

Parameters:
c TCP connection
ct_q clear text queue
flags filled,
See also:
tls_ct_q_add() for more details.
Parameters:
ssl_err set to the SSL err (SSL_ERROR_NONE on full success).
Returns:
-1 on internal error, or the number of bytes flushed on success (>=0).

Definition at line 145 of file tls_ct_wrq.c.

References ssl_flush(), and tls_ct_q_flush().

Referenced by tls_read_f().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int tls_ct_wq_free ( tls_ct_q **  ct_q  ) 
Parameters:
ct_q clear text queue
Returns:
number of bytes that used to be queued (>=0),

Definition at line 199 of file tls_ct_wrq.c.

References tls_ct_q_destroy().

Referenced by tls_h_tcpconn_clean().

Here is the call graph for this function:

Here is the caller graph for this function:

int tls_ct_wq_init (  ) 
Returns:
0 on success, < 0 on error.

Definition at line 51 of file tls_ct_wrq.c.

unsigned int tls_ct_wq_total_bytes (  ) 
Returns:
total number of written queued bytes in all SSL connections

Definition at line 79 of file tls_ct_wrq.c.