X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fbio%2Fbss_acpt.c;h=4110ff1a45ec9e3940ace6fdf3c682b699332b59;hb=ddb6b965da0087dadea5488fe11646e3777c66e1;hp=4da5822062c173c13dec556bfec52158a02f6be0;hpb=26a3a48d65c7464b400ec1de439994d7f0d25fed;p=oweals%2Fopenssl.git diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 4da5822062..4110ff1a45 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -56,21 +56,21 @@ * [including the GNU Public Licence.] */ -#ifndef NO_SOCK - #include #include #define USE_SOCKETS #include "cryptlib.h" #include -#ifdef WIN16 +#ifndef OPENSSL_NO_SOCK + +#ifdef OPENSSL_SYS_WIN16 #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */ #else #define SOCKET_PROTOCOL IPPROTO_TCP #endif -#if (defined(VMS) && __VMS_VER < 70000000) +#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000) /* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */ #undef FIONBIO #endif @@ -100,8 +100,8 @@ static int acpt_new(BIO *h); static int acpt_free(BIO *data); static int acpt_state(BIO *b, BIO_ACCEPT *c); static void acpt_close_socket(BIO *data); -BIO_ACCEPT *BIO_ACCEPT_new(void ); -void BIO_ACCEPT_free(BIO_ACCEPT *a); +static BIO_ACCEPT *BIO_ACCEPT_new(void ); +static void BIO_ACCEPT_free(BIO_ACCEPT *a); #define ACPT_S_BEFORE 1 #define ACPT_S_GET_ACCEPT_SOCKET 2 @@ -141,7 +141,7 @@ static int acpt_new(BIO *bi) return(1); } -BIO_ACCEPT *BIO_ACCEPT_new(void) +static BIO_ACCEPT *BIO_ACCEPT_new(void) { BIO_ACCEPT *ret; @@ -154,7 +154,7 @@ BIO_ACCEPT *BIO_ACCEPT_new(void) return(ret); } -void BIO_ACCEPT_free(BIO_ACCEPT *a) +static void BIO_ACCEPT_free(BIO_ACCEPT *a) { if(a == NULL) return; @@ -236,8 +236,20 @@ again: c->state=ACPT_S_OK; goto again; } + BIO_clear_retry_flags(b); + b->retry_reason=0; i=BIO_accept(c->accept_sock,&(c->addr)); + + /* -2 return means we should retry */ + if(i == -2) + { + BIO_set_retry_special(b); + b->retry_reason=BIO_RR_ACCEPT; + return -1; + } + if (i < 0) return(i); + bio=BIO_new_socket(i,BIO_CLOSE); if (bio == NULL) goto err; @@ -328,7 +340,6 @@ static int acpt_write(BIO *b, const char *in, int inl) static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr) { - BIO *dbio; int *ip; long ret=1; BIO_ACCEPT *data; @@ -425,8 +436,8 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr) ret=(long)data->bind_mode; break; case BIO_CTRL_DUP: - dbio=(BIO *)ptr; -/* if (data->param_port) EAY EAY +/* dbio=(BIO *)ptr; + if (data->param_port) EAY EAY BIO_set_port(dbio,data->param_port); if (data->param_hostname) BIO_set_hostname(dbio,data->param_hostname); @@ -449,7 +460,7 @@ static int acpt_puts(BIO *bp, const char *str) return(ret); } -BIO *BIO_new_accept(char *str) +BIO *BIO_new_accept(const char *str) { BIO *ret;