Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
1f9fe60a
Commit
1f9fe60a
authored
11 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Make nonblocking_connect() also select() for exceptional conditions since
Win32 make connect() failure an exceptional condition.
parent
1158079d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpdev/sockwrap.c
+7
-4
7 additions, 4 deletions
src/xpdev/sockwrap.c
with
7 additions
and
4 deletions
src/xpdev/sockwrap.c
+
7
−
4
View file @
1f9fe60a
...
...
@@ -377,14 +377,17 @@ int DLLCALL nonblocking_connect(SOCKET sock, struct sockaddr* addr, size_t size,
if
(
result
==
SOCKET_ERROR
&&
(
ERROR_VALUE
==
EWOULDBLOCK
||
ERROR_VALUE
==
EINPROGRESS
))
{
fd_set
socket_set
;
fd_set
wsocket_set
;
fd_set
esocket_set
;
struct
timeval
tv
;
socklen_t
optlen
=
sizeof
(
result
);
tv
.
tv_sec
=
timeout
;
tv
.
tv_usec
=
0
;
FD_ZERO
(
&
socket_set
);
FD_SET
(
sock
,
&
socket_set
);
if
(
select
(
sock
+
1
,
NULL
,
&
socket_set
,
NULL
,
&
tv
)
==
1
)
FD_ZERO
(
&
wsocket_set
);
FD_SET
(
sock
,
&
wsocket_set
);
FD_ZERO
(
&
esocket_set
);
FD_SET
(
sock
,
&
esocket_set
);
if
(
select
(
sock
+
1
,
NULL
,
&
wsocket_set
,
&
esocket_set
,
&
tv
)
==
1
)
getsockopt
(
sock
,
SOL_SOCKET
,
SO_ERROR
,
(
void
*
)
&
result
,
&
optlen
);
}
return
result
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment