X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fbio%2Fbss_acpt.c;h=d090b7272fb69d51d6189217f41071ab2d5880d0;hb=2238e8e4777c23ebb99da5b1227bd428d5134df6;hp=09e8c90b536fac87ae20aa6c597418c2df6a0f78;hpb=0e1c06128adbfd2d88dc304db2262140bad045fd;p=oweals%2Fopenssl.git diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 09e8c90b53..d090b7272f 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 @@ -145,7 +145,7 @@ BIO_ACCEPT *BIO_ACCEPT_new(void) { BIO_ACCEPT *ret; - if ((ret=(BIO_ACCEPT *)Malloc(sizeof(BIO_ACCEPT))) == NULL) + if ((ret=(BIO_ACCEPT *)OPENSSL_malloc(sizeof(BIO_ACCEPT))) == NULL) return(NULL); memset(ret,0,sizeof(BIO_ACCEPT)); @@ -159,10 +159,10 @@ void BIO_ACCEPT_free(BIO_ACCEPT *a) if(a == NULL) return; - if (a->param_addr != NULL) Free(a->param_addr); - if (a->addr != NULL) Free(a->addr); + if (a->param_addr != NULL) OPENSSL_free(a->param_addr); + if (a->addr != NULL) OPENSSL_free(a->addr); if (a->bio_chain != NULL) BIO_free(a->bio_chain); - Free(a); + OPENSSL_free(a); } static void acpt_close_socket(BIO *bio) @@ -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; @@ -355,7 +367,7 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr) { b->init=1; if (data->param_addr != NULL) - Free(data->param_addr); + OPENSSL_free(data->param_addr); data->param_addr=BUF_strdup(ptr); } else if (num == 1)