Add a pointer to a paper (is the algorithm in section 4.2 the
[oweals/openssl.git] / crypto / bio / bss_conn.c
index 83ba60edfbb102ab8d3c64eed1f0dc9c2e509686..154cb78fb83c84497d56e243cb1b18866d7e08a6 100644 (file)
 #include "cryptlib.h"
 #include <openssl/bio.h>
 
-/*     BIOerr(BIO_F_WSASTARTUP,BIO_R_WSASTARTUP ); */
-
 #ifdef WIN16
 #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
 #else
 #define SOCKET_PROTOCOL IPPROTO_TCP
 #endif
 
+#if (defined(VMS) && __VMS_VER < 70000000)
+/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
+#undef FIONBIO
+#endif
+
+
 typedef struct bio_connect_st
        {
        int state;
@@ -94,38 +98,24 @@ typedef struct bio_connect_st
        int (*info_callback)();
        } BIO_CONNECT;
 
-#ifndef NOPROTO
+union int_fn_to_char_u
+       {
+       char *char_p;
+       int (*fn_p)();
+       };
+
 static int conn_write(BIO *h,char *buf,int num);
 static int conn_read(BIO *h,char *buf,int size);
 static int conn_puts(BIO *h,char *str);
 static long conn_ctrl(BIO *h,int cmd,long arg1,char *arg2);
 static int conn_new(BIO *h);
 static int conn_free(BIO *data);
-#else
-static int conn_write();
-static int conn_read();
-static int conn_puts();
-static long conn_ctrl();
-static int conn_new();
-static int conn_free();
-#endif
-
-#ifndef NOPROTO
 
 static int conn_state(BIO *b, BIO_CONNECT *c);
 static void conn_close_socket(BIO *data);
 BIO_CONNECT *BIO_CONNECT_new(void );
 void BIO_CONNECT_free(BIO_CONNECT *a);
 
-#else
-
-static int conn_state();
-static void conn_close_socket();
-BIO_CONNECT *BIO_CONNECT_new();
-void BIO_CONNECT_free();
-
-#endif
-
 static BIO_METHOD methods_connectp=
        {
        BIO_TYPE_CONNECT,
@@ -580,16 +570,26 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
        case BIO_CTRL_FLUSH:
                break;
        case BIO_CTRL_DUP:
+               {
+               union int_fn_to_char_u tmp_cb;
+               
                dbio=(BIO *)ptr;
                if (data->param_port)
                        BIO_set_conn_port(dbio,data->param_port);
                if (data->param_hostname)
                        BIO_set_conn_hostname(dbio,data->param_hostname);
                BIO_set_nbio(dbio,data->nbio);
-               BIO_set_info_callback(dbio,data->info_callback);
+               tmp_cb.fn_p=data->info_callback;
+               (void)BIO_set_info_callback(dbio,tmp_cb.char_p);
+               }
                break;
        case BIO_CTRL_SET_CALLBACK:
-               data->info_callback=(int (*)())ptr;
+               {
+               union int_fn_to_char_u tmp_cb;
+               
+               tmp_cb.char_p=ptr;
+               data->info_callback=tmp_cb.fn_p;
+               }
                break;
        case BIO_CTRL_GET_CALLBACK:
                {