diff options
Diffstat (limited to 'src/lib/libssl/src/apps/s_server.c')
| -rw-r--r-- | src/lib/libssl/src/apps/s_server.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c index 12f6c33c13..18717d8f23 100644 --- a/src/lib/libssl/src/apps/s_server.c +++ b/src/lib/libssl/src/apps/s_server.c | |||
| @@ -146,6 +146,8 @@ | |||
| 146 | #undef OPENSSL_NO_DEPRECATED | 146 | #undef OPENSSL_NO_DEPRECATED |
| 147 | #endif | 147 | #endif |
| 148 | 148 | ||
| 149 | #include <sys/ioctl.h> | ||
| 150 | |||
| 149 | #include <assert.h> | 151 | #include <assert.h> |
| 150 | #include <ctype.h> | 152 | #include <ctype.h> |
| 151 | #include <stdio.h> | 153 | #include <stdio.h> |
| @@ -249,9 +251,7 @@ static const char *s_cert_file = TEST_CERT, *s_key_file = NULL; | |||
| 249 | static const char *s_cert_file2 = TEST_CERT2, *s_key_file2 = NULL; | 251 | static const char *s_cert_file2 = TEST_CERT2, *s_key_file2 = NULL; |
| 250 | #endif | 252 | #endif |
| 251 | static char *s_dcert_file = NULL, *s_dkey_file = NULL; | 253 | static char *s_dcert_file = NULL, *s_dkey_file = NULL; |
| 252 | #ifdef FIONBIO | ||
| 253 | static int s_nbio = 0; | 254 | static int s_nbio = 0; |
| 254 | #endif | ||
| 255 | static int s_nbio_test = 0; | 255 | static int s_nbio_test = 0; |
| 256 | int s_crlf = 0; | 256 | int s_crlf = 0; |
| 257 | static SSL_CTX *ctx = NULL; | 257 | static SSL_CTX *ctx = NULL; |
| @@ -406,9 +406,7 @@ s_server_init(void) | |||
| 406 | s_key_file2 = NULL; | 406 | s_key_file2 = NULL; |
| 407 | ctx2 = NULL; | 407 | ctx2 = NULL; |
| 408 | #endif | 408 | #endif |
| 409 | #ifdef FIONBIO | ||
| 410 | s_nbio = 0; | 409 | s_nbio = 0; |
| 411 | #endif | ||
| 412 | s_nbio_test = 0; | 410 | s_nbio_test = 0; |
| 413 | ctx = NULL; | 411 | ctx = NULL; |
| 414 | www = 0; | 412 | www = 0; |
| @@ -456,9 +454,7 @@ sv_usage(void) | |||
| 456 | " Use \"openssl ecparam -list_curves\" for all names\n" \ | 454 | " Use \"openssl ecparam -list_curves\" for all names\n" \ |
| 457 | " (default is nistp256).\n"); | 455 | " (default is nistp256).\n"); |
| 458 | #endif | 456 | #endif |
| 459 | #ifdef FIONBIO | ||
| 460 | BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n"); | 457 | BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n"); |
| 461 | #endif | ||
| 462 | BIO_printf(bio_err, " -nbio_test - test with the non-blocking test bio\n"); | 458 | BIO_printf(bio_err, " -nbio_test - test with the non-blocking test bio\n"); |
| 463 | BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n"); | 459 | BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n"); |
| 464 | BIO_printf(bio_err, " -debug - Print more output\n"); | 460 | BIO_printf(bio_err, " -debug - Print more output\n"); |
| @@ -798,9 +794,7 @@ s_server_main(int argc, char *argv[]) | |||
| 798 | goto end; | 794 | goto end; |
| 799 | 795 | ||
| 800 | verify_depth = 0; | 796 | verify_depth = 0; |
| 801 | #ifdef FIONBIO | ||
| 802 | s_nbio = 0; | 797 | s_nbio = 0; |
| 803 | #endif | ||
| 804 | s_nbio_test = 0; | 798 | s_nbio_test = 0; |
| 805 | 799 | ||
| 806 | argc--; | 800 | argc--; |
| @@ -909,15 +903,11 @@ s_server_main(int argc, char *argv[]) | |||
| 909 | goto bad; | 903 | goto bad; |
| 910 | CAfile = *(++argv); | 904 | CAfile = *(++argv); |
| 911 | } | 905 | } |
| 912 | #ifdef FIONBIO | ||
| 913 | else if (strcmp(*argv, "-nbio") == 0) { | 906 | else if (strcmp(*argv, "-nbio") == 0) { |
| 914 | s_nbio = 1; | 907 | s_nbio = 1; |
| 915 | } | 908 | } |
| 916 | #endif | ||
| 917 | else if (strcmp(*argv, "-nbio_test") == 0) { | 909 | else if (strcmp(*argv, "-nbio_test") == 0) { |
| 918 | #ifdef FIONBIO | ||
| 919 | s_nbio = 1; | 910 | s_nbio = 1; |
| 920 | #endif | ||
| 921 | s_nbio_test = 1; | 911 | s_nbio_test = 1; |
| 922 | } else if (strcmp(*argv, "-debug") == 0) { | 912 | } else if (strcmp(*argv, "-debug") == 0) { |
| 923 | s_debug = 1; | 913 | s_debug = 1; |
| @@ -1661,7 +1651,6 @@ sv_body(char *hostname, int s, unsigned char *context) | |||
| 1661 | BIO_printf(bio_err, "out of memory\n"); | 1651 | BIO_printf(bio_err, "out of memory\n"); |
| 1662 | goto err; | 1652 | goto err; |
| 1663 | } | 1653 | } |
| 1664 | #ifdef FIONBIO | ||
| 1665 | if (s_nbio) { | 1654 | if (s_nbio) { |
| 1666 | unsigned long sl = 1; | 1655 | unsigned long sl = 1; |
| 1667 | 1656 | ||
| @@ -1670,7 +1659,6 @@ sv_body(char *hostname, int s, unsigned char *context) | |||
| 1670 | if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0) | 1659 | if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0) |
| 1671 | ERR_print_errors(bio_err); | 1660 | ERR_print_errors(bio_err); |
| 1672 | } | 1661 | } |
| 1673 | #endif | ||
| 1674 | 1662 | ||
| 1675 | if (con == NULL) { | 1663 | if (con == NULL) { |
| 1676 | con = SSL_new(ctx); | 1664 | con = SSL_new(ctx); |
| @@ -2178,7 +2166,6 @@ www_body(char *hostname, int s, unsigned char *context) | |||
| 2178 | if ((io == NULL) || (ssl_bio == NULL)) | 2166 | if ((io == NULL) || (ssl_bio == NULL)) |
| 2179 | goto err; | 2167 | goto err; |
| 2180 | 2168 | ||
| 2181 | #ifdef FIONBIO | ||
| 2182 | if (s_nbio) { | 2169 | if (s_nbio) { |
| 2183 | unsigned long sl = 1; | 2170 | unsigned long sl = 1; |
| 2184 | 2171 | ||
| @@ -2187,7 +2174,6 @@ www_body(char *hostname, int s, unsigned char *context) | |||
| 2187 | if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0) | 2174 | if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0) |
| 2188 | ERR_print_errors(bio_err); | 2175 | ERR_print_errors(bio_err); |
| 2189 | } | 2176 | } |
| 2190 | #endif | ||
| 2191 | 2177 | ||
| 2192 | /* lets make the output buffer a reasonable size */ | 2178 | /* lets make the output buffer a reasonable size */ |
| 2193 | if (!BIO_set_write_buffer_size(io, bufsize)) | 2179 | if (!BIO_set_write_buffer_size(io, bufsize)) |
