Skip to content

Commit e081e21

Browse files
committed
patch 7.4.1459
Problem: MS-Windows doesn't know socklen_t. Solution: Use previous method for WIN32.
1 parent fdd6ce4 commit e081e21

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/channel.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,10 @@ channel_open(
681681
struct timeval tv;
682682
fd_set rfds;
683683
fd_set wfds;
684+
#ifndef WIN32
684685
int so_error = 0;
685686
socklen_t so_error_len = sizeof(so_error);
687+
#endif
686688

687689
FD_ZERO(&rfds);
688690
FD_SET(sd, &rfds);
@@ -709,9 +711,12 @@ channel_open(
709711
return NULL;
710712
}
711713

714+
#ifdef WIN32
712715
/* On Win32: select() is expected to work and wait for up to the
713-
* waittime for the socket to be open.
714-
* On Linux-like systems: See socket(7) for the behavior
716+
* waittime for the socket to be open. */
717+
if (!FD_ISSET(sd, &wfds) || ret == 0)
718+
#else
719+
/* On Linux-like systems: See socket(7) for the behavior
715720
* After putting the socket in non-blocking mode, connect() will
716721
* return EINPROGRESS, select() will not wait (as if writing is
717722
* possible), need to use getsockopt() to check if the socket is
@@ -725,9 +730,9 @@ channel_open(
725730
if (ret < 0 || (so_error != 0
726731
&& so_error != EWOULDBLOCK
727732
&& so_error != ECONNREFUSED
728-
#ifdef EINPROGRESS
733+
# ifdef EINPROGRESS
729734
&& so_error != EINPROGRESS
730-
#endif
735+
# endif
731736
))
732737
{
733738
ch_errorn(channel,
@@ -741,6 +746,7 @@ channel_open(
741746
}
742747

743748
if (!FD_ISSET(sd, &wfds) || so_error != 0)
749+
#endif
744750
{
745751
#ifndef WIN32
746752
struct timeval end_tv;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1459,
746748
/**/
747749
1458,
748750
/**/

0 commit comments

Comments
 (0)