# endif
#endif
-# define openssl_fdset(a,b) FD_SET(a, b)
-
typedef struct args_st {
char **data;
int count;
}
if (req_timeout != -1 && rv <= 0) {
FD_ZERO(&confds);
- openssl_fdset(fd, &confds);
+ FD_SET(fd, &confds);
tv.tv_usec = 0;
tv.tv_sec = req_timeout;
- rv = select(fd + 1, NULL, (void *) &confds, NULL, &tv);
+ rv = select(fd + 1, NULL, &confds, NULL, &tv);
if (rv == 0) {
BIO_puts(err, "Timeout on connect\n");
return NULL;
if (req_timeout == -1)
continue;
FD_ZERO(&confds);
- openssl_fdset(fd, &confds);
+ FD_SET(fd, &confds);
tv.tv_usec = 0;
tv.tv_sec = req_timeout;
if (BIO_should_read(cbio))
- rv = select(fd + 1, (void *) &confds, NULL, NULL, &tv);
+ rv = select(fd + 1, &confds, NULL, NULL, &tv);
else if (BIO_should_write(cbio))
- rv = select(fd + 1, NULL, (void *) &confds, NULL, &tv);
+ rv = select(fd + 1, NULL, &confds, NULL, &tv);
else {
BIO_puts(err, "Unexpected retry condition\n");
goto err;
ssl_pending = read_ssl && SSL_pending(con);
+ /* XXX should add tests for fd_set overflow */
+
if (!ssl_pending) {
if (tty_on) {
if (read_tty)
- openssl_fdset(fileno(stdin), &readfds);
+ FD_SET(fileno(stdin), &readfds);
if (write_tty)
- openssl_fdset(fileno(stdout), &writefds);
+ FD_SET(fileno(stdout), &writefds);
}
if (read_ssl)
- openssl_fdset(SSL_get_fd(con), &readfds);
+ FD_SET(SSL_get_fd(con), &readfds);
if (write_ssl)
- openssl_fdset(SSL_get_fd(con), &writefds);
+ FD_SET(SSL_get_fd(con), &writefds);
/* printf("mode tty(%d %d%d) ssl(%d%d)\n",
tty_on,read_tty,write_tty,read_ssl,write_ssl);*/
- /*
- * Note: under VMS with SOCKETSHR the second
- * parameter is currently of type (int *) whereas
- * under other systems it is (void *) if you don't
- * have a cast it will choke the compiler: if you do
- * have a cast then you can either go for (int *) or
- * (void *).
- */
- i = select(width, (void *) &readfds, (void *) &writefds,
+ i = select(width, &readfds, &writefds,
NULL, timeoutp);
if (i < 0) {
BIO_printf(bio_err, "bad select %d\n",
if (!read_from_sslcon) {
FD_ZERO(&readfds);
- openssl_fdset(fileno(stdin), &readfds);
- openssl_fdset(s, &readfds);
- /*
- * Note: under VMS with SOCKETSHR the second
- * parameter is currently of type (int *) whereas
- * under other systems it is (void *) if you don't
- * have a cast it will choke the compiler: if you do
- * have a cast then you can either go for (int *) or
- * (void *).
- */
+ FD_SET(fileno(stdin), &readfds);
+ FD_SET(s, &readfds);
if ((SSL_version(con) == DTLS1_VERSION) &&
DTLSv1_get_timeout(con, &timeout))
timeoutp = &timeout;
else
timeoutp = NULL;
- i = select(width, (void *) &readfds, NULL, NULL, timeoutp);
+ i = select(width, &readfds, NULL, NULL, timeoutp);
if ((SSL_version(con) == DTLS1_VERSION) && DTLSv1_handle_timeout(con) > 0) {
BIO_printf(bio_err, "TIMEOUT occured\n");
int ret;
struct hostent *h1, *h2;
static struct sockaddr_in from;
- int len;
+ socklen_t len;
/* struct linger ling; */
if (!ssl_sock_init())
memset((char *) &from, 0, sizeof(from));
len = sizeof(from);
- /*
- * Note: under VMS with SOCKETSHR the fourth parameter is currently
- * of type (int *) whereas under other systems it is (void *) if you
- * don't have a cast it will choke the compiler: if you do have a
- * cast then you can either go for (int *) or (void *).
- */
- ret = accept(acc_sock, (struct sockaddr *) & from, (void *) &len);
+ ret = accept(acc_sock, (struct sockaddr *) & from, &len);
if (ret == -1) {
if (errno == EINTR) {
/* check_timeout(); */
i = SSL_get_fd(serverCon);
width = i + 1;
FD_ZERO(&readfds);
- openssl_fdset(i, &readfds);
- /*
- * Note: under VMS with SOCKETSHR the 2nd parameter
- * is currently of type (int *) whereas under other
- * systems it is (void *) if you don't have a cast it
- * will choke the compiler: if you do have a cast
- * then you can either go for (int *) or (void *).
- */
- select(width, (void *) &readfds, NULL, NULL, NULL);
+ FD_SET(i, &readfds);
+ select(width, &readfds, NULL, NULL, NULL);
continue;
}
break;