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