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 <gitster@pobox.com>

Junio C Hamano committed Feb 15, 2013 at 12:32 UTC 1e1fe52923a8f582c4f50b41f0dd978d5d7c9bd3
1 file changed +7 -2
imap-send.c
+7 -2
@@ -266,12 +266,17 @@ static void socket_perror(const char *func, struct imap_socket *sock, int ret)
266 }
267 }
268
269 +#ifdef NO_OPENSSL
270 static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int verify)
271 {
271 -#ifdef NO_OPENSSL
272 fprintf(stderr, "SSL requested but SSL support not compiled in\n");
273 return -1;
274 +}
275 +
276 #else
277 +
278 +static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int verify)
279 +{
280 #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
281 const SSL_METHOD *meth;
282 #else
@@ -323,8 +328,8 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve
328 }
329
330 return 0;
326 -#endif
331 }
332 +#endif
333
334 static int socket_read(struct imap_socket *sock, char *buf, int len)
335 {