diff options
author | Parménides GV <parmegv@sdf.org> | 2014-06-13 12:21:38 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-06-13 12:21:38 +0200 |
commit | d09435a9d2adb0d0cafa0b1f9f6cfe326346cbc6 (patch) | |
tree | 946278cd836aa6af639675f4eb5ec7378d783dd8 /app/openssl/crypto/bio/b_sock.c | |
parent | 5d47fde84a03acb1201f8650c55dc0cd981df679 (diff) | |
parent | 3a71bc9e4aa4296f460e2e3c55de74c9852477ad (diff) |
Merge branch 'develop' into release-0.5.2
Diffstat (limited to 'app/openssl/crypto/bio/b_sock.c')
-rw-r--r-- | app/openssl/crypto/bio/b_sock.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/openssl/crypto/bio/b_sock.c b/app/openssl/crypto/bio/b_sock.c index d47310d6..470b1a00 100644 --- a/app/openssl/crypto/bio/b_sock.c +++ b/app/openssl/crypto/bio/b_sock.c @@ -629,7 +629,8 @@ int BIO_get_accept_socket(char *host, int bind_mode) struct sockaddr_in6 sa_in6; #endif } server,client; - int s=INVALID_SOCKET,cs,addrlen; + int s=INVALID_SOCKET,cs; + socklen_t addrlen; unsigned char ip[4]; unsigned short port; char *str=NULL,*e; @@ -704,10 +705,10 @@ int BIO_get_accept_socket(char *host, int bind_mode) if ((*p_getaddrinfo.f)(h,p,&hint,&res)) break; - addrlen = res->ai_addrlen<=sizeof(server) ? + addrlen = res->ai_addrlen <= (socklen_t)sizeof(server) ? res->ai_addrlen : - sizeof(server); - memcpy(&server, res->ai_addr, addrlen); + (socklen_t)sizeof(server); + memcpy(&server, res->ai_addr, (size_t)addrlen); (*p_freeaddrinfo.f)(res); goto again; @@ -719,7 +720,7 @@ int BIO_get_accept_socket(char *host, int bind_mode) memset((char *)&server,0,sizeof(server)); server.sa_in.sin_family=AF_INET; server.sa_in.sin_port=htons(port); - addrlen = sizeof(server.sa_in); + addrlen = (socklen_t)sizeof(server.sa_in); if (h == NULL || strcmp(h,"*") == 0) server.sa_in.sin_addr.s_addr=INADDR_ANY; @@ -960,7 +961,6 @@ int BIO_set_tcp_ndelay(int s, int on) #endif return(ret == 0); } -#endif int BIO_socket_nbio(int s, int mode) { @@ -973,3 +973,4 @@ int BIO_socket_nbio(int s, int mode) #endif return(ret == 0); } +#endif |