diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-12-12 07:54:55 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-12-12 07:56:56 +0100 |
commit | 9e6b694698e64ab72168f68a897b56ceb8a6bd94 (patch) | |
tree | 549536a7c0d0cd5e5ba6c67ff579d815b098809f | |
parent | 71af402497b3e769fc79cc642b3005deab48e3f8 (diff) | |
download | gnutls-9e6b694698e64ab72168f68a897b56ceb8a6bd94.tar.gz |
Added gnutls_record_check_corked.
-rw-r--r-- | lib/gnutls_buffers.c | 16 | ||||
-rw-r--r-- | lib/gnutls_record.c | 5 | ||||
-rw-r--r-- | lib/includes/gnutls/gnutls.h.in | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/lib/gnutls_buffers.c b/lib/gnutls_buffers.c index 7f3b5a4147..7d2dd9cca9 100644 --- a/lib/gnutls_buffers.c +++ b/lib/gnutls_buffers.c @@ -97,6 +97,22 @@ size_t gnutls_record_check_pending(gnutls_session_t session) return _gnutls_record_buffer_get_size(session); } +/** + * gnutls_record_check_corked: + * @session: is a #gnutls_session_t structure. + * + * This function checks if there pending corked + * data in the gnutls buffers --see gnutls_cork(). + * + * Returns: Returns the size of the corked data or zero. + * + * Since: 3.2.8 + **/ +size_t gnutls_record_check_corked(gnutls_session_t session) +{ + return session->internals.record_presend_buffer.length; +} + int _gnutls_record_buffer_get(content_type_t type, gnutls_session_t session, uint8_t * data, diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index 68d868abad..8d70505337 100644 --- a/lib/gnutls_record.c +++ b/lib/gnutls_record.c @@ -1492,6 +1492,11 @@ void gnutls_record_cork(gnutls_session_t session) * occurs (i.e., the function will retry on %GNUTLS_E_AGAIN and * %GNUTLS_E_INTERRUPTED). * + * If the flag %GNUTLS_RECORD_WAIT is not specified and the function + * is interrupted then the %GNUTLS_E_AGAIN or %GNUTLS_E_INTERRUPTED + * errors will be returned. To obtain the data left in the corked + * buffer use gnutls_record_check_corked(). + * * Returns: On success the number of transmitted data is returned, or * otherwise a negative error code. * diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index 11102127da..0818ba7f0a 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -951,6 +951,7 @@ size_t gnutls_record_get_max_size(gnutls_session_t session); ssize_t gnutls_record_set_max_size(gnutls_session_t session, size_t size); size_t gnutls_record_check_pending(gnutls_session_t session); +size_t gnutls_record_check_corked(gnutls_session_t session); void gnutls_session_force_valid(gnutls_session_t session); |