Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
5b5d4558
Commit
5b5d4558
authored
Mar 14, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Mar 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Implement setting of send and receive timeouts.
parent
ea6f3a4c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
4 deletions
+51
-4
internet.c
dlls/wininet/internet.c
+22
-4
internet.h
dlls/wininet/internet.h
+1
-0
netconnection.c
dlls/wininet/netconnection.c
+28
-0
No files found.
dlls/wininet/internet.c
View file @
5b5d4558
...
...
@@ -2442,11 +2442,29 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
case
INTERNET_OPTION_DISABLE_PASSPORT_AUTH
:
TRACE
(
"Option INTERNET_OPTION_DISABLE_PASSPORT_AUTH: harmless stub, since not enabled
\n
"
);
break
;
case
INTERNET_OPTION_RECEIVE_TIMEOUT
:
FIXME
(
"Option INTERNET_OPTION_RECEIVE_TIMEOUT: STUB
\n
"
);
break
;
case
INTERNET_OPTION_SEND_TIMEOUT
:
FIXME
(
"Option INTERNET_OPTION_SEND_TIMEOUT: STUB
\n
"
);
case
INTERNET_OPTION_RECEIVE_TIMEOUT
:
TRACE
(
"INTERNET_OPTION_SEND/RECEIVE_TIMEOUT
\n
"
);
if
(
dwBufferLength
==
sizeof
(
DWORD
))
{
if
(
lpwhh
->
htype
==
WH_HHTTPREQ
)
ret
=
NETCON_set_timeout
(
&
((
LPWININETHTTPREQW
)
lpwhh
)
->
netConnection
,
dwOption
==
INTERNET_OPTION_SEND_TIMEOUT
,
*
(
DWORD
*
)
lpBuffer
);
else
{
FIXME
(
"INTERNET_OPTION_SEND/RECEIVE_TIMEOUT not supported on protocol %d
\n
"
,
lpwhh
->
htype
);
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
ret
=
FALSE
;
}
}
else
{
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
ret
=
FALSE
;
}
break
;
case
INTERNET_OPTION_CONNECT_RETRIES
:
FIXME
(
"Option INTERNET_OPTION_CONNECT_RETRIES: STUB
\n
"
);
...
...
dlls/wininet/internet.h
View file @
5b5d4558
...
...
@@ -481,6 +481,7 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f
int
*
recvd
/* out */
);
BOOL
NETCON_getNextLine
(
WININET_NETCONNECTION
*
connection
,
LPSTR
lpszBuffer
,
LPDWORD
dwBuffer
);
LPCVOID
NETCON_GetCert
(
WININET_NETCONNECTION
*
connection
);
BOOL
NETCON_set_timeout
(
WININET_NETCONNECTION
*
connection
,
BOOL
send
,
int
value
);
extern
void
URLCacheContainers_CreateDefaults
(
void
);
extern
void
URLCacheContainers_DeleteAll
(
void
);
...
...
dlls/wininet/netconnection.c
View file @
5b5d4558
...
...
@@ -714,3 +714,31 @@ LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection)
return
NULL
;
#endif
}
BOOL
NETCON_set_timeout
(
WININET_NETCONNECTION
*
connection
,
BOOL
send
,
int
value
)
{
int
result
;
struct
timeval
tv
;
/* FIXME: we should probably store the timeout in the connection to set
* when we do connect */
if
(
!
NETCON_connected
(
connection
))
return
TRUE
;
/* value is in milliseconds, convert to struct timeval */
tv
.
tv_sec
=
value
/
1000
;
tv
.
tv_usec
=
(
value
%
1000
)
*
1000
;
result
=
setsockopt
(
connection
->
socketFD
,
SOL_SOCKET
,
send
?
SO_SNDTIMEO
:
SO_RCVTIMEO
,
&
tv
,
sizeof
(
tv
));
if
(
result
==
-
1
)
{
WARN
(
"setsockopt failed (%s)
\n
"
,
strerror
(
errno
));
INTERNET_SetLastError
(
sock_get_error
(
errno
));
return
FALSE
;
}
return
TRUE
;
}
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