Skip to content

Commit 1e1fe52

Browse files
committed
imap-send: move #ifdef around
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 <[email protected]>
1 parent f174a25 commit 1e1fe52

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

imap-send.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,17 @@ static void socket_perror(const char *func, struct imap_socket *sock, int ret)
266266
}
267267
}
268268

269+
#ifdef NO_OPENSSL
269270
static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int verify)
270271
{
271-
#ifdef NO_OPENSSL
272272
fprintf(stderr, "SSL requested but SSL support not compiled in\n");
273273
return -1;
274+
}
275+
274276
#else
277+
278+
static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int verify)
279+
{
275280
#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
276281
const SSL_METHOD *meth;
277282
#else
@@ -323,8 +328,8 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve
323328
}
324329

325330
return 0;
326-
#endif
327331
}
332+
#endif
328333

329334
static int socket_read(struct imap_socket *sock, char *buf, int len)
330335
{

0 commit comments

Comments
 (0)