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
0e33eee9
Commit
0e33eee9
authored
Feb 26, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Use vtbl for InternetSetOption(INTERNET_OPTION_[SEND|RECEIVE]_TIMEOUT) implementation.
parent
1ffcfbce
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
30 deletions
+54
-30
ftp.c
dlls/wininet/ftp.c
+3
-0
http.c
dlls/wininet/http.c
+21
-0
internet.c
dlls/wininet/internet.c
+20
-24
internet.h
dlls/wininet/internet.h
+2
-1
netconnection.c
dlls/wininet/netconnection.c
+4
-5
internet.c
dlls/wininet/tests/internet.c
+4
-0
No files found.
dlls/wininet/ftp.c
View file @
0e33eee9
...
...
@@ -1169,6 +1169,7 @@ static BOOL FTPFILE_WriteFile(WININETHANDLEHEADER *hdr, const void *buffer, DWOR
static
const
HANDLEHEADERVtbl
FTPFILEVtbl
=
{
FTPFILE_Destroy
,
NULL
,
NULL
,
FTPFILE_WriteFile
};
...
...
@@ -2086,6 +2087,7 @@ static void FTPSESSION_CloseConnection(WININETHANDLEHEADER *hdr)
static
const
HANDLEHEADERVtbl
FTPSESSIONVtbl
=
{
FTPSESSION_Destroy
,
FTPSESSION_CloseConnection
,
NULL
,
NULL
};
...
...
@@ -3164,6 +3166,7 @@ static void FTPFINDNEXT_Destroy(WININETHANDLEHEADER *hdr)
static
const
HANDLEHEADERVtbl
FTPFINDNEXTVtbl
=
{
FTPFINDNEXT_Destroy
,
NULL
,
NULL
,
NULL
};
...
...
dlls/wininet/http.c
View file @
0e33eee9
...
...
@@ -1392,6 +1392,25 @@ static void HTTPREQ_CloseConnection(WININETHANDLEHEADER *hdr)
INTERNET_STATUS_CONNECTION_CLOSED
,
0
,
0
);
}
static
DWORD
HTTPREQ_SetOption
(
WININETHANDLEHEADER
*
hdr
,
DWORD
option
,
void
*
buffer
,
DWORD
size
)
{
WININETHTTPREQW
*
req
=
(
WININETHTTPREQW
*
)
hdr
;
switch
(
option
)
{
case
INTERNET_OPTION_SEND_TIMEOUT
:
case
INTERNET_OPTION_RECEIVE_TIMEOUT
:
TRACE
(
"INTERNET_OPTION_SEND/RECEIVE_TIMEOUT
\n
"
);
if
(
size
!=
sizeof
(
DWORD
))
return
ERROR_INVALID_PARAMETER
;
return
NETCON_set_timeout
(
&
req
->
netConnection
,
option
==
INTERNET_OPTION_SEND_TIMEOUT
,
*
(
DWORD
*
)
buffer
);
}
return
ERROR_INTERNET_INVALID_OPTION
;
}
static
BOOL
HTTPREQ_WriteFile
(
WININETHANDLEHEADER
*
hdr
,
const
void
*
buffer
,
DWORD
size
,
DWORD
*
written
)
{
LPWININETHTTPREQW
lpwhr
=
(
LPWININETHTTPREQW
)
hdr
;
...
...
@@ -1402,6 +1421,7 @@ static BOOL HTTPREQ_WriteFile(WININETHANDLEHEADER *hdr, const void *buffer, DWOR
static
const
HANDLEHEADERVtbl
HTTPREQVtbl
=
{
HTTPREQ_Destroy
,
HTTPREQ_CloseConnection
,
HTTPREQ_SetOption
,
HTTPREQ_WriteFile
};
...
...
@@ -2925,6 +2945,7 @@ static void HTTPSESSION_Destroy(WININETHANDLEHEADER *hdr)
static
const
HANDLEHEADERVtbl
HTTPSESSIONVtbl
=
{
HTTPSESSION_Destroy
,
NULL
,
NULL
,
NULL
};
...
...
dlls/wininet/internet.c
View file @
0e33eee9
...
...
@@ -474,6 +474,7 @@ static VOID APPINFO_Destroy(WININETHANDLEHEADER *hdr)
static
const
HANDLEHEADERVtbl
APPINFOVtbl
=
{
APPINFO_Destroy
,
NULL
,
NULL
,
NULL
};
...
...
@@ -2477,11 +2478,22 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
LPWININETHANDLEHEADER
lpwhh
;
BOOL
ret
=
TRUE
;
TRACE
(
"
0x%08x
\n
"
,
dwOption
);
TRACE
(
"
(%p %d %p %d)
\n
"
,
hInternet
,
dwOption
,
lpBuffer
,
dwBufferLength
);
lpwhh
=
(
LPWININETHANDLEHEADER
)
WININET_GetObject
(
hInternet
);
if
(
!
lpwhh
)
return
FALSE
;
if
(
lpwhh
&&
lpwhh
->
vtbl
->
SetOption
)
{
DWORD
res
;
res
=
lpwhh
->
vtbl
->
SetOption
(
lpwhh
,
dwOption
,
lpBuffer
,
dwBufferLength
);
if
(
res
!=
ERROR_INTERNET_INVALID_OPTION
)
{
WININET_Release
(
lpwhh
);
if
(
res
!=
ERROR_SUCCESS
)
SetLastError
(
res
);
return
res
==
ERROR_SUCCESS
;
}
}
switch
(
dwOption
)
{
...
...
@@ -2553,25 +2565,7 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
break
;
case
INTERNET_OPTION_SEND_TIMEOUT
:
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
);
}
}
else
{
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
ret
=
FALSE
;
}
FIXME
(
"INTERNET_OPTION_SEND/RECEIVE_TIMEOUT
\n
"
);
break
;
case
INTERNET_OPTION_CONNECT_RETRIES
:
FIXME
(
"Option INTERNET_OPTION_CONNECT_RETRIES: STUB
\n
"
);
...
...
@@ -2584,11 +2578,13 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
break
;
default:
FIXME
(
"Option %d STUB
\n
"
,
dwOption
);
INTERNET_SetLastError
(
ERROR_IN
VALID_PARAMETER
);
INTERNET_SetLastError
(
ERROR_IN
TERNET_INVALID_OPTION
);
ret
=
FALSE
;
break
;
}
WININET_Release
(
lpwhh
);
if
(
lpwhh
)
WININET_Release
(
lpwhh
);
return
ret
;
}
...
...
dlls/wininet/internet.h
View file @
0e33eee9
...
...
@@ -138,6 +138,7 @@ typedef struct _WININETHANDLEHEADER WININETHANDLEHEADER, *LPWININETHANDLEHEADER;
typedef
struct
{
void
(
*
Destroy
)(
WININETHANDLEHEADER
*
);
void
(
*
CloseConnection
)(
WININETHANDLEHEADER
*
);
DWORD
(
*
SetOption
)(
WININETHANDLEHEADER
*
,
DWORD
,
void
*
,
DWORD
);
BOOL
(
*
WriteFile
)(
WININETHANDLEHEADER
*
,
const
void
*
,
DWORD
,
DWORD
*
);
}
HANDLEHEADERVtbl
;
...
...
@@ -475,7 +476,7 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f
BOOL
NETCON_query_data_available
(
WININET_NETCONNECTION
*
connection
,
DWORD
*
available
);
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
);
DWORD
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 @
0e33eee9
...
...
@@ -745,7 +745,7 @@ LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection)
#endif
}
BOOL
NETCON_set_timeout
(
WININET_NETCONNECTION
*
connection
,
BOOL
send
,
int
value
)
DWORD
NETCON_set_timeout
(
WININET_NETCONNECTION
*
connection
,
BOOL
send
,
int
value
)
{
int
result
;
struct
timeval
tv
;
...
...
@@ -753,7 +753,7 @@ BOOL NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value)
/* FIXME: we should probably store the timeout in the connection to set
* when we do connect */
if
(
!
NETCON_connected
(
connection
))
return
TRUE
;
return
ERROR_SUCCESS
;
/* value is in milliseconds, convert to struct timeval */
tv
.
tv_sec
=
value
/
1000
;
...
...
@@ -766,9 +766,8 @@ BOOL NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value)
if
(
result
==
-
1
)
{
WARN
(
"setsockopt failed (%s)
\n
"
,
strerror
(
errno
));
INTERNET_SetLastError
(
sock_get_error
(
errno
));
return
FALSE
;
return
sock_get_error
(
errno
);
}
return
TRUE
;
return
ERROR_SUCCESS
;
}
dlls/wininet/tests/internet.c
View file @
0e33eee9
...
...
@@ -113,6 +113,10 @@ static void test_InternetCanonicalizeUrlA(void)
"got %u and %u with size %u for '%s' (%d)
\n
"
,
res
,
GetLastError
(),
dwSize
,
buffer
,
lstrlenA
(
buffer
));
res
=
InternetSetOptionA
(
NULL
,
0xdeadbeef
,
buffer
,
sizeof
(
buffer
));
ok
(
!
res
,
"InternetSetOptionA succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INTERNET_INVALID_OPTION
,
"InternetSetOptionA failed %u, expected ERROR_INTERNET_INVALID_OPTION
\n
"
,
GetLastError
());
}
/* ############################### */
...
...
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