Skip to content

Commit

Permalink
imap-send: move #ifdef around
Browse files Browse the repository at this point in the history
Instead of adding an early return to the inside of the
ssl_socket_connect() function for NO_OPENSSL compilation, split it
into a separate stub function.

No functional change, but the next change to extend ssl_socket_connect()
will become easier to read this way.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 19, 2013
1 parent f174a25 commit 1e1fe52
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,17 @@ static void socket_perror(const char *func, struct imap_socket *sock, int ret)
}
}

#ifdef NO_OPENSSL
static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int verify)
{
#ifdef NO_OPENSSL
fprintf(stderr, "SSL requested but SSL support not compiled in\n");
return -1;
}

#else

static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int verify)
{
#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
const SSL_METHOD *meth;
#else
Expand Down Expand Up @@ -323,8 +328,8 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve
}

return 0;
#endif
}
#endif

static int socket_read(struct imap_socket *sock, char *buf, int len)
{
Expand Down

0 comments on commit 1e1fe52

Please sign in to comment.