From 795c1240c9fb09c42bcdc45d5a8d44e6a406ee9c Mon Sep 17 00:00:00 2001 From: Michael Steinert Date: Thu, 10 May 2012 13:28:17 -0600 Subject: Add plumbing for SSL/TLS support This change abstracts out the networking functions so that the user can provide an SSL/TLS implementation. Callback functions replace `writev()`, `send()`, and `recv()` (there is also a callback for error reporting). The default interface remains unchanged. If the user wants to create a SSL/TLS connection they first negotiate the connection and then use the new function `amqp_set_sockfd_full()` to provide the networking implementation for their SSL/TLS library. The user may provide an optional pointer to data that is passed through to the networking functions. Signed-off-by: Michael Steinert --- librabbitmq/amqp_private.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'librabbitmq/amqp_private.h') diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h index 68239d1..b28d7bb 100644 --- a/librabbitmq/amqp_private.h +++ b/librabbitmq/amqp_private.h @@ -43,6 +43,7 @@ #include "amqp.h" #include "amqp_framing.h" +#include #include /* Error numbering: Because of differences in error numbering on @@ -71,8 +72,11 @@ #if __GNUC__ > 2 | (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #define AMQP_NORETURN \ __attribute__ ((__noreturn__)) +#define AMQP_UNUSED \ + __attribute__ ((__unused__)) #else #define AMQP_NORETURN +#define AMQP_UNUSED #endif #if __GNUC__ >= 4 @@ -144,6 +148,13 @@ struct amqp_connection_state_t_ { amqp_bytes_t outbound_buffer; int sockfd; + amqp_socket_writev_fn writev; + amqp_socket_send_fn send; + amqp_socket_recv_fn recv; + amqp_socket_close_fn close; + amqp_socket_error_fn error; + void *user_data; + amqp_bytes_t sock_inbound_buffer; size_t sock_inbound_offset; size_t sock_inbound_limit; -- cgit v1.2.1