Reorder inclusion of header files:
[openssl.git] / ssl / bio_ssl.c
index f6396db82edc12a378560cb01e4befd48e7cc447..467e1499470efe906900e23ad9f1396378eb6758 100644 (file)
@@ -71,7 +71,7 @@ static int ssl_puts(BIO *h, const char *str);
 static long ssl_ctrl(BIO *h, int cmd, long arg1, void *arg2);
 static int ssl_new(BIO *h);
 static int ssl_free(BIO *data);
-static long ssl_callback_ctrl(BIO *h, int cmd, void (*fp)());
+static long ssl_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
 typedef struct bio_ssl_st
        {
        SSL *ssl; /* The ssl handle :-) */
@@ -206,6 +206,10 @@ static int ssl_read(BIO *b, char *out, int outl)
                BIO_set_retry_special(b);
                retry_reason=BIO_RR_SSL_X509_LOOKUP;
                break;
+       case SSL_ERROR_WANT_ACCEPT:
+               BIO_set_retry_special(b);
+               retry_reason=BIO_RR_ACCEPT;
+               break;
        case SSL_ERROR_WANT_CONNECT:
                BIO_set_retry_special(b);
                retry_reason=BIO_RR_CONNECT;
@@ -470,7 +474,7 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
        return(ret);
        }
 
-static long ssl_callback_ctrl(BIO *b, int cmd, void (*fp)())
+static long ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
        {
        SSL *ssl;
        BIO_SSL *bs;
@@ -482,7 +486,9 @@ static long ssl_callback_ctrl(BIO *b, int cmd, void (*fp)())
                {
        case BIO_CTRL_SET_CALLBACK:
                {
-               SSL_set_info_callback(ssl,fp);
+               /* FIXME: setting this via a completely different prototype
+                  seems like a crap idea */
+               SSL_set_info_callback(ssl,(void (*)(const SSL *,int,int))fp);
                }
                break;
        default: