#include <errno.h>
#define USE_SOCKETS
#include "cryptlib.h"
-#include "bio.h"
-
-/* BIOerr(BIO_F_WSASTARTUP,BIO_R_WSASTARTUP ); */
+#include <openssl/bio.h>
#ifdef WIN16
#define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
#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;
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,
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:
{