projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
some const fixes and cleanup
[openssl.git]
/
crypto
/
bio
/
bss_acpt.c
diff --git
a/crypto/bio/bss_acpt.c
b/crypto/bio/bss_acpt.c
index 09e8c90b536fac87ae20aa6c597418c2df6a0f78..d090b7272fb69d51d6189217f41071ab2d5880d0 100644
(file)
--- a/
crypto/bio/bss_acpt.c
+++ b/
crypto/bio/bss_acpt.c
@@
-56,21
+56,21
@@
* [including the GNU Public Licence.]
*/
* [including the GNU Public Licence.]
*/
-#ifndef NO_SOCK
-
#include <stdio.h>
#include <errno.h>
#define USE_SOCKETS
#include "cryptlib.h"
#include <openssl/bio.h>
#include <stdio.h>
#include <errno.h>
#define USE_SOCKETS
#include "cryptlib.h"
#include <openssl/bio.h>
-#ifdef WIN16
+#ifndef OPENSSL_NO_SOCK
+
+#ifdef OPENSSL_SYS_WIN16
#define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
#else
#define SOCKET_PROTOCOL IPPROTO_TCP
#endif
#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
/* 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;
{
BIO_ACCEPT *ret;
- if ((ret=(BIO_ACCEPT *)
M
alloc(sizeof(BIO_ACCEPT))) == NULL)
+ if ((ret=(BIO_ACCEPT *)
OPENSSL_m
alloc(sizeof(BIO_ACCEPT))) == NULL)
return(NULL);
memset(ret,0,sizeof(BIO_ACCEPT));
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 == NULL)
return;
- if (a->param_addr != NULL)
F
ree(a->param_addr);
- if (a->addr != NULL)
F
ree(a->addr);
+ if (a->param_addr != NULL)
OPENSSL_f
ree(a->param_addr);
+ if (a->addr != NULL)
OPENSSL_f
ree(a->addr);
if (a->bio_chain != NULL) BIO_free(a->bio_chain);
if (a->bio_chain != NULL) BIO_free(a->bio_chain);
-
F
ree(a);
+
OPENSSL_f
ree(a);
}
static void acpt_close_socket(BIO *bio)
}
static void acpt_close_socket(BIO *bio)
@@
-236,8
+236,20
@@
again:
c->state=ACPT_S_OK;
goto 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));
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);
if (i < 0) return(i);
+
bio=BIO_new_socket(i,BIO_CLOSE);
if (bio == NULL) goto err;
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)
{
b->init=1;
if (data->param_addr != NULL)
-
F
ree(data->param_addr);
+
OPENSSL_f
ree(data->param_addr);
data->param_addr=BUF_strdup(ptr);
}
else if (num == 1)
data->param_addr=BUF_strdup(ptr);
}
else if (num == 1)