delete if 0 code
authortedu <tedu@openbsd.org>
Thu, 17 Apr 2014 22:19:56 +0000 (22:19 +0000)
committertedu <tedu@openbsd.org>
Thu, 17 Apr 2014 22:19:56 +0000 (22:19 +0000)
lib/libcrypto/bio/b_sock.c
lib/libcrypto/bio/bf_buff.c
lib/libcrypto/bio/bf_lbuf.c
lib/libcrypto/bio/bss_dgram.c
lib/libssl/src/crypto/bio/b_sock.c
lib/libssl/src/crypto/bio/bf_buff.c
lib/libssl/src/crypto/bio/bf_lbuf.c
lib/libssl/src/crypto/bio/bss_dgram.c

index 0972fee..43b27e0 100644 (file)
@@ -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);
index 7b76e89..9dfd90c 100644 (file)
@@ -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);
index e233cbc..7ed26cc 100644 (file)
@@ -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);
index 50281b5..c1e85a2 100644 (file)
@@ -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:
index 0972fee..43b27e0 100644 (file)
@@ -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);
index 7b76e89..9dfd90c 100644 (file)
@@ -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);
index e233cbc..7ed26cc 100644 (file)
@@ -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);
index 50281b5..c1e85a2 100644 (file)
@@ -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: