From 69f1b12577c83a06eb3c8e46f40a2c2d79144e6b Mon Sep 17 00:00:00 2001 From: tedu Date: Thu, 17 Apr 2014 22:19:56 +0000 Subject: [PATCH] delete if 0 code --- lib/libcrypto/bio/b_sock.c | 28 ------------------- lib/libcrypto/bio/bf_buff.c | 3 --- lib/libcrypto/bio/bf_lbuf.c | 21 --------------- lib/libcrypto/bio/bss_dgram.c | 39 ++++++++++----------------- lib/libssl/src/crypto/bio/b_sock.c | 28 ------------------- lib/libssl/src/crypto/bio/bf_buff.c | 3 --- lib/libssl/src/crypto/bio/bf_lbuf.c | 21 --------------- lib/libssl/src/crypto/bio/bss_dgram.c | 39 ++++++++++----------------- 8 files changed, 28 insertions(+), 154 deletions(-) diff --git a/lib/libcrypto/bio/b_sock.c b/lib/libcrypto/bio/b_sock.c index 0972feeb584..43b27e04060 100644 --- a/lib/libcrypto/bio/b_sock.c +++ b/lib/libcrypto/bio/b_sock.c @@ -96,23 +96,7 @@ static int wsa_init_done = 0; #define WSAAPI #endif -#if 0 -static unsigned long BIO_ghbn_hits = 0L; -static unsigned long BIO_ghbn_miss = 0L; - -#define GHBN_NUM 4 -static struct ghbn_cache_st { - char name[129]; - struct hostent *ent; - unsigned long order; -} ghbn_cache[GHBN_NUM]; -#endif - static int get_ip(const char *str, unsigned char *ip); -#if 0 -static void ghbn_free(struct hostent *a); -static struct hostent *ghbn_dup(struct hostent *a); -#endif int BIO_get_host_ip(const char *str, unsigned char *ip) @@ -200,10 +184,6 @@ BIO_get_port(const char *str, unsigned short *port_ptr) *port_ptr = 21; else if (strcmp(str, "gopher") == 0) *port_ptr = 70; -#if 0 - else if (strcmp(str, "wais") == 0) - *port_ptr = 21; -#endif else { SYSerr(SYS_F_GETSERVBYNAME, errno); ERR_add_error_data(3, "service='", str, "'"); @@ -220,10 +200,6 @@ BIO_sock_error(int sock) int j, i; int size; -#if defined(OPENSSL_SYS_BEOS_R5) - return 0; -#endif - size = sizeof(int); /* Note: under Windows the third parameter is of type (char *) * whereas under other systems it is (void *) if you don't have @@ -260,13 +236,9 @@ BIO_socket_ioctl(int fd, long type, void *arg) { int i; -#ifdef __DJGPP__ - i = ioctl(fd, type, (char *)arg); -#else # define ARG arg i = ioctl(fd, type, ARG); -#endif /* __DJGPP__ */ if (i < 0) SYSerr(SYS_F_IOCTLSOCKET, errno); return (i); diff --git a/lib/libcrypto/bio/bf_buff.c b/lib/libcrypto/bio/bf_buff.c index 7b76e895a41..9dfd90c7b44 100644 --- a/lib/libcrypto/bio/bf_buff.c +++ b/lib/libcrypto/bio/bf_buff.c @@ -419,9 +419,6 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) r = BIO_write(b->next_bio, &(ctx->obuf[ctx->obuf_off]), ctx->obuf_len); -#if 0 - fprintf(stderr, "FLUSH [%3d] %3d -> %3d\n", ctx->obuf_off, ctx->obuf_len, r); -#endif BIO_copy_next_retry(b); if (r <= 0) return ((long)r); diff --git a/lib/libcrypto/bio/bf_lbuf.c b/lib/libcrypto/bio/bf_lbuf.c index e233cbc92ca..7ed26ccec76 100644 --- a/lib/libcrypto/bio/bf_lbuf.c +++ b/lib/libcrypto/bio/bf_lbuf.c @@ -205,24 +205,15 @@ linebuffer_write(BIO *b, const char *in, int inl) } } -#if 0 - BIO_write(b->next_bio, "<*<", 3); -#endif i = BIO_write(b->next_bio, ctx->obuf, ctx->obuf_len); if (i <= 0) { ctx->obuf_len = orig_olen; BIO_copy_next_retry(b); -#if 0 - BIO_write(b->next_bio, ">*>", 3); -#endif if (i < 0) return ((num > 0) ? num : i); if (i == 0) return (num); } -#if 0 - BIO_write(b->next_bio, ">*>", 3); -#endif if (i < ctx->obuf_len) memmove(ctx->obuf, ctx->obuf + i, ctx->obuf_len - i); @@ -232,23 +223,14 @@ linebuffer_write(BIO *b, const char *in, int inl) /* Now that the save buffer is emptied, let's write the input buffer if a NL was found and there is anything to write. */ if ((foundnl || p - in > ctx->obuf_size) && p - in > 0) { -#if 0 - BIO_write(b->next_bio, "<*<", 3); -#endif i = BIO_write(b->next_bio, in, p - in); if (i <= 0) { BIO_copy_next_retry(b); -#if 0 - BIO_write(b->next_bio, ">*>", 3); -#endif if (i < 0) return ((num > 0) ? num : i); if (i == 0) return (num); } -#if 0 - BIO_write(b->next_bio, ">*>", 3); -#endif num += i; in += i; inl -= i; @@ -334,9 +316,6 @@ linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr) if (ctx->obuf_len > 0) { r = BIO_write(b->next_bio, ctx->obuf, ctx->obuf_len); -#if 0 - fprintf(stderr, "FLUSH %3d -> %3d\n", ctx->obuf_len, r); -#endif BIO_copy_next_retry(b); if (r <= 0) return ((long)r); diff --git a/lib/libcrypto/bio/bss_dgram.c b/lib/libcrypto/bio/bss_dgram.c index 50281b5650a..c1e85a21c65 100644 --- a/lib/libcrypto/bio/bss_dgram.c +++ b/lib/libcrypto/bio/bss_dgram.c @@ -411,12 +411,10 @@ dgram_write(BIO *b, const char *in, int inl) BIO_set_retry_write(b); data->_errno = errno; - -#if 0 /* higher layers are responsible for querying MTU, if necessary */ - if (data->_errno == EMSGSIZE) - /* retrieve the new MTU */ - BIO_ctrl(b, BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); -#endif + /* + * higher layers are responsible for querying MTU, + * if necessary + */ } } return (ret); @@ -486,28 +484,19 @@ dgram_ctrl(BIO *b, int cmd, long num, void *ptr) break; case BIO_CTRL_DGRAM_CONNECT: to = (struct sockaddr *)ptr; -#if 0 - if (connect(b->num, to, sizeof(struct sockaddr)) < 0) { - perror("connect"); - ret = 0; - } else { -#endif - switch (to->sa_family) { - case AF_INET: - memcpy(&data->peer, to, sizeof(data->peer.sa_in)); - break; + switch (to->sa_family) { + case AF_INET: + memcpy(&data->peer, to, sizeof(data->peer.sa_in)); + break; #if OPENSSL_USE_IPV6 - case AF_INET6: - memcpy(&data->peer, to, sizeof(data->peer.sa_in6)); - break; + case AF_INET6: + memcpy(&data->peer, to, sizeof(data->peer.sa_in6)); + break; #endif - default: - memcpy(&data->peer, to, sizeof(data->peer.sa)); - break; - } -#if 0 + default: + memcpy(&data->peer, to, sizeof(data->peer.sa)); + break; } -#endif break; /* (Linux)kernel sets DF bit on outgoing IP packets */ case BIO_CTRL_DGRAM_MTU_DISCOVER: diff --git a/lib/libssl/src/crypto/bio/b_sock.c b/lib/libssl/src/crypto/bio/b_sock.c index 0972feeb584..43b27e04060 100644 --- a/lib/libssl/src/crypto/bio/b_sock.c +++ b/lib/libssl/src/crypto/bio/b_sock.c @@ -96,23 +96,7 @@ static int wsa_init_done = 0; #define WSAAPI #endif -#if 0 -static unsigned long BIO_ghbn_hits = 0L; -static unsigned long BIO_ghbn_miss = 0L; - -#define GHBN_NUM 4 -static struct ghbn_cache_st { - char name[129]; - struct hostent *ent; - unsigned long order; -} ghbn_cache[GHBN_NUM]; -#endif - static int get_ip(const char *str, unsigned char *ip); -#if 0 -static void ghbn_free(struct hostent *a); -static struct hostent *ghbn_dup(struct hostent *a); -#endif int BIO_get_host_ip(const char *str, unsigned char *ip) @@ -200,10 +184,6 @@ BIO_get_port(const char *str, unsigned short *port_ptr) *port_ptr = 21; else if (strcmp(str, "gopher") == 0) *port_ptr = 70; -#if 0 - else if (strcmp(str, "wais") == 0) - *port_ptr = 21; -#endif else { SYSerr(SYS_F_GETSERVBYNAME, errno); ERR_add_error_data(3, "service='", str, "'"); @@ -220,10 +200,6 @@ BIO_sock_error(int sock) int j, i; int size; -#if defined(OPENSSL_SYS_BEOS_R5) - return 0; -#endif - size = sizeof(int); /* Note: under Windows the third parameter is of type (char *) * whereas under other systems it is (void *) if you don't have @@ -260,13 +236,9 @@ BIO_socket_ioctl(int fd, long type, void *arg) { int i; -#ifdef __DJGPP__ - i = ioctl(fd, type, (char *)arg); -#else # define ARG arg i = ioctl(fd, type, ARG); -#endif /* __DJGPP__ */ if (i < 0) SYSerr(SYS_F_IOCTLSOCKET, errno); return (i); diff --git a/lib/libssl/src/crypto/bio/bf_buff.c b/lib/libssl/src/crypto/bio/bf_buff.c index 7b76e895a41..9dfd90c7b44 100644 --- a/lib/libssl/src/crypto/bio/bf_buff.c +++ b/lib/libssl/src/crypto/bio/bf_buff.c @@ -419,9 +419,6 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) r = BIO_write(b->next_bio, &(ctx->obuf[ctx->obuf_off]), ctx->obuf_len); -#if 0 - fprintf(stderr, "FLUSH [%3d] %3d -> %3d\n", ctx->obuf_off, ctx->obuf_len, r); -#endif BIO_copy_next_retry(b); if (r <= 0) return ((long)r); diff --git a/lib/libssl/src/crypto/bio/bf_lbuf.c b/lib/libssl/src/crypto/bio/bf_lbuf.c index e233cbc92ca..7ed26ccec76 100644 --- a/lib/libssl/src/crypto/bio/bf_lbuf.c +++ b/lib/libssl/src/crypto/bio/bf_lbuf.c @@ -205,24 +205,15 @@ linebuffer_write(BIO *b, const char *in, int inl) } } -#if 0 - BIO_write(b->next_bio, "<*<", 3); -#endif i = BIO_write(b->next_bio, ctx->obuf, ctx->obuf_len); if (i <= 0) { ctx->obuf_len = orig_olen; BIO_copy_next_retry(b); -#if 0 - BIO_write(b->next_bio, ">*>", 3); -#endif if (i < 0) return ((num > 0) ? num : i); if (i == 0) return (num); } -#if 0 - BIO_write(b->next_bio, ">*>", 3); -#endif if (i < ctx->obuf_len) memmove(ctx->obuf, ctx->obuf + i, ctx->obuf_len - i); @@ -232,23 +223,14 @@ linebuffer_write(BIO *b, const char *in, int inl) /* Now that the save buffer is emptied, let's write the input buffer if a NL was found and there is anything to write. */ if ((foundnl || p - in > ctx->obuf_size) && p - in > 0) { -#if 0 - BIO_write(b->next_bio, "<*<", 3); -#endif i = BIO_write(b->next_bio, in, p - in); if (i <= 0) { BIO_copy_next_retry(b); -#if 0 - BIO_write(b->next_bio, ">*>", 3); -#endif if (i < 0) return ((num > 0) ? num : i); if (i == 0) return (num); } -#if 0 - BIO_write(b->next_bio, ">*>", 3); -#endif num += i; in += i; inl -= i; @@ -334,9 +316,6 @@ linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr) if (ctx->obuf_len > 0) { r = BIO_write(b->next_bio, ctx->obuf, ctx->obuf_len); -#if 0 - fprintf(stderr, "FLUSH %3d -> %3d\n", ctx->obuf_len, r); -#endif BIO_copy_next_retry(b); if (r <= 0) return ((long)r); diff --git a/lib/libssl/src/crypto/bio/bss_dgram.c b/lib/libssl/src/crypto/bio/bss_dgram.c index 50281b5650a..c1e85a21c65 100644 --- a/lib/libssl/src/crypto/bio/bss_dgram.c +++ b/lib/libssl/src/crypto/bio/bss_dgram.c @@ -411,12 +411,10 @@ dgram_write(BIO *b, const char *in, int inl) BIO_set_retry_write(b); data->_errno = errno; - -#if 0 /* higher layers are responsible for querying MTU, if necessary */ - if (data->_errno == EMSGSIZE) - /* retrieve the new MTU */ - BIO_ctrl(b, BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); -#endif + /* + * higher layers are responsible for querying MTU, + * if necessary + */ } } return (ret); @@ -486,28 +484,19 @@ dgram_ctrl(BIO *b, int cmd, long num, void *ptr) break; case BIO_CTRL_DGRAM_CONNECT: to = (struct sockaddr *)ptr; -#if 0 - if (connect(b->num, to, sizeof(struct sockaddr)) < 0) { - perror("connect"); - ret = 0; - } else { -#endif - switch (to->sa_family) { - case AF_INET: - memcpy(&data->peer, to, sizeof(data->peer.sa_in)); - break; + switch (to->sa_family) { + case AF_INET: + memcpy(&data->peer, to, sizeof(data->peer.sa_in)); + break; #if OPENSSL_USE_IPV6 - case AF_INET6: - memcpy(&data->peer, to, sizeof(data->peer.sa_in6)); - break; + case AF_INET6: + memcpy(&data->peer, to, sizeof(data->peer.sa_in6)); + break; #endif - default: - memcpy(&data->peer, to, sizeof(data->peer.sa)); - break; - } -#if 0 + default: + memcpy(&data->peer, to, sizeof(data->peer.sa)); + break; } -#endif break; /* (Linux)kernel sets DF bit on outgoing IP packets */ case BIO_CTRL_DGRAM_MTU_DISCOVER: -- 2.20.1