Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e6d8fdb0
Commit
e6d8fdb0
authored
Sep 26, 2002
by
Greg Turner
Committed by
Alexandre Julliard
Sep 26, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed up some semantic misunderstandings using the helpful advice of
Rein Klazes - added SO_SNDTIMEO support - added ifdef's for consistency with rest of socket.c
parent
635eb3c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
8 deletions
+31
-8
socket.c
dlls/winsock/socket.c
+31
-8
No files found.
dlls/winsock/socket.c
View file @
e6d8fdb0
...
...
@@ -2705,21 +2705,44 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
optval
=
(
char
*
)
&
woptval
;
optlen
=
sizeof
(
int
);
}
if
(
level
==
SOL_SOCKET
&&
optname
==
SO_RCVTIMEO
&&
optlen
<
sizeof
(
struct
timeval
))
{
if
(
optlen
==
sizeof
(
time_t
))
{
/* Apparently WinSock will accept a shortened struct timeval.
FIXME: should we do the same for SO_SNDTIMEO? */
WARN
(
"Short struct timeval in SO_RCVTIMEO: assuming time_t
\n
"
);
tval
.
tv_sec
=
*
(
time_t
*
)
optval
;
tval
.
tv_usec
=
0
;
#ifdef SO_RCVTIMEO
if
(
level
==
SOL_SOCKET
&&
optname
==
SO_RCVTIMEO
)
{
if
(
optlen
==
sizeof
(
UINT32
))
{
/* WinSock passes miliseconds instead of struct timeval */
tval
.
tv_usec
=
*
(
PUINT32
)
optval
%
1000
;
tval
.
tv_sec
=
*
(
PUINT32
)
optval
/
1000
;
/* min of 500 milisec */
if
(
tval
.
tv_sec
==
0
&&
tval
.
tv_usec
<
500
)
tval
.
tv_usec
=
500
;
optlen
=
sizeof
(
struct
timeval
);
optval
=
(
char
*
)
&
tval
;
}
else
if
(
optlen
==
sizeof
(
struct
timeval
))
{
WARN
(
"SO_RCVTIMEO for %d bytes: assuming unixism
\n
"
,
optlen
);
}
else
{
WARN
(
"SO_RCVTIMEO for %d bytes is too small
: ignored
\n
"
,
optlen
);
WARN
(
"SO_RCVTIMEO for %d bytes is weird
: ignored
\n
"
,
optlen
);
close
(
fd
);
return
0
;
}
}
#endif
#ifdef SO_SNDTIMEO
if
(
level
==
SOL_SOCKET
&&
optname
==
SO_SNDTIMEO
)
{
if
(
optlen
==
sizeof
(
UINT32
))
{
/* WinSock passes miliseconds instead of struct timeval */
tval
.
tv_usec
=
*
(
PUINT32
)
optval
%
1000
;
tval
.
tv_sec
=
*
(
PUINT32
)
optval
/
1000
;
/* min of 500 milisec */
if
(
tval
.
tv_sec
==
0
&&
tval
.
tv_usec
<
500
)
tval
.
tv_usec
=
500
;
optlen
=
sizeof
(
struct
timeval
);
optval
=
(
char
*
)
&
tval
;
}
else
if
(
optlen
==
sizeof
(
struct
timeval
))
{
WARN
(
"SO_SNDTIMEO for %d bytes: assuming unixism
\n
"
,
optlen
);
}
else
{
WARN
(
"SO_SNDTIMEO for %d bytes is weird: ignored
\n
"
,
optlen
);
close
(
fd
);
return
0
;
}
}
#endif
}
if
(
optname
==
SO_RCVBUF
&&
*
(
int
*
)
optval
<
2048
)
{
WARN
(
"SO_RCVBF for %d bytes is too small: ignored
\n
"
,
*
(
int
*
)
optval
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment