]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/bio/bss_acpt.c
Make non blocking I/O work for accept BIOs.
[thirdparty/openssl.git] / crypto / bio / bss_acpt.c
index 4da5822062c173c13dec556bfec52158a02f6be0..0c440fbb5f94a668e712d977a294f05a368ae50c 100644 (file)
@@ -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;