summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bss_dgram.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/bss_dgram.c')
-rw-r--r--src/lib/libcrypto/bio/bss_dgram.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c
index 71ebe987b6..eb7e365467 100644
--- a/src/lib/libcrypto/bio/bss_dgram.c
+++ b/src/lib/libcrypto/bio/bss_dgram.c
@@ -57,6 +57,7 @@
57 * 57 *
58 */ 58 */
59 59
60#ifndef OPENSSL_NO_DGRAM
60 61
61#include <stdio.h> 62#include <stdio.h>
62#include <errno.h> 63#include <errno.h>
@@ -64,7 +65,6 @@
64#include "cryptlib.h" 65#include "cryptlib.h"
65 66
66#include <openssl/bio.h> 67#include <openssl/bio.h>
67#ifndef OPENSSL_NO_DGRAM
68 68
69#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) 69#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
70#include <sys/timeb.h> 70#include <sys/timeb.h>
@@ -308,6 +308,7 @@ static int dgram_read(BIO *b, char *out, int outl)
308 OPENSSL_assert(sa.len.s<=sizeof(sa.peer)); 308 OPENSSL_assert(sa.len.s<=sizeof(sa.peer));
309 sa.len.i = (int)sa.len.s; 309 sa.len.i = (int)sa.len.s;
310 } 310 }
311 dgram_reset_rcv_timeout(b);
311 312
312 if ( ! data->connected && ret >= 0) 313 if ( ! data->connected && ret >= 0)
313 BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, &sa.peer); 314 BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, &sa.peer);
@@ -321,8 +322,6 @@ static int dgram_read(BIO *b, char *out, int outl)
321 data->_errno = get_last_socket_error(); 322 data->_errno = get_last_socket_error();
322 } 323 }
323 } 324 }
324
325 dgram_reset_rcv_timeout(b);
326 } 325 }
327 return(ret); 326 return(ret);
328 } 327 }
@@ -341,7 +340,7 @@ static int dgram_write(BIO *b, const char *in, int inl)
341 340
342 if (data->peer.sa.sa_family == AF_INET) 341 if (data->peer.sa.sa_family == AF_INET)
343 peerlen = sizeof(data->peer.sa_in); 342 peerlen = sizeof(data->peer.sa_in);
344#if OPENSSL_USE_IPV6 343#if OPENSSL_USE_IVP6
345 else if (data->peer.sa.sa_family == AF_INET6) 344 else if (data->peer.sa.sa_family == AF_INET6)
346 peerlen = sizeof(data->peer.sa_in6); 345 peerlen = sizeof(data->peer.sa_in6);
347#endif 346#endif
@@ -746,13 +745,9 @@ static int BIO_dgram_should_retry(int i)
746 { 745 {
747 err=get_last_socket_error(); 746 err=get_last_socket_error();
748 747
749#if defined(OPENSSL_SYS_WINDOWS) 748#if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */
750 /* If the socket return value (i) is -1 749 if ((i == -1) && (err == 0))
751 * and err is unexpectedly 0 at this point, 750 return(1);
752 * the error code was overwritten by
753 * another system call before this error
754 * handling is called.
755 */
756#endif 751#endif
757 752
758 return(BIO_dgram_non_fatal_error(err)); 753 return(BIO_dgram_non_fatal_error(err));
@@ -815,6 +810,7 @@ int BIO_dgram_non_fatal_error(int err)
815 } 810 }
816 return(0); 811 return(0);
817 } 812 }
813#endif
818 814
819static void get_current_time(struct timeval *t) 815static void get_current_time(struct timeval *t)
820 { 816 {
@@ -832,5 +828,3 @@ static void get_current_time(struct timeval *t)
832 gettimeofday(t, NULL); 828 gettimeofday(t, NULL);
833#endif 829#endif
834 } 830 }
835
836#endif