diff options
author | zaq178miami <pinepain@gmail.com> | 2013-06-23 19:36:10 +0300 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2013-07-06 22:28:45 -0700 |
commit | 6ad770dc62f76fa0625d277b521a120b549d9fc2 (patch) | |
tree | 964847f5a839c7ccbfba6c09bc9b5ca3102c89d4 /librabbitmq/amqp_polarssl.c | |
parent | b6a1dfec14e70fc6afe8ce9710231e552ba6bfb5 (diff) | |
download | rabbitmq-c-github-ask-6ad770dc62f76fa0625d277b521a120b549d9fc2.tar.gz |
Add nonblocking connect support
Diffstat (limited to 'librabbitmq/amqp_polarssl.c')
-rw-r--r-- | librabbitmq/amqp_polarssl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/librabbitmq/amqp_polarssl.c b/librabbitmq/amqp_polarssl.c index 770fdbe..bae3141 100644 --- a/librabbitmq/amqp_polarssl.c +++ b/librabbitmq/amqp_polarssl.c @@ -128,12 +128,20 @@ amqp_ssl_socket_recv(void *base, } static int -amqp_ssl_socket_open(void *base, const char *host, int port) +amqp_ssl_socket_open(void *base, const char *host, int port, struct timeval *timeout) { int status; struct amqp_ssl_socket_t *self = (struct amqp_ssl_socket_t *)base; self->last_error = 0; + if (timeout && (timeout->tv_sec != 0 || timeout->tv_usec != 0)) { + /* We don't support PolarSSL for now because it uses its own connect() wrapper + * It is not too hard to implement net_connect() with noblock support, + * but then we will have to maintain that piece of code and keep it synced with main PolarSSL code base + */ + return AMQP_STATUS_INVALID_PARAMETER; + } + status = net_connect(&self->sockfd, host, port); if (status) { /* This isn't quite right. We should probably translate between |