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
b01d5842
Commit
b01d5842
authored
Nov 30, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Directly return error status from NETCON_init.
parent
1d96e20e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
21 deletions
+19
-21
http.c
dlls/wininet/http.c
+8
-3
internet.h
dlls/wininet/internet.h
+1
-1
netconnection.c
dlls/wininet/netconnection.c
+10
-17
No files found.
dlls/wininet/http.c
View file @
b01d5842
...
...
@@ -2594,7 +2594,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(http_session_t *lpwhs,
LPWSTR
lpszHostName
=
NULL
;
HINTERNET
handle
=
NULL
;
static
const
WCHAR
szHostForm
[]
=
{
'%'
,
's'
,
':'
,
'%'
,
'u'
,
0
};
DWORD
len
;
DWORD
len
,
res
;
TRACE
(
"-->
\n
"
);
...
...
@@ -2636,10 +2636,11 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(http_session_t *lpwhs,
goto
lend
;
}
if
(
!
NETCON_init
(
&
lpwhr
->
netConnection
,
dwFlags
&
INTERNET_FLAG_SECURE
)
)
if
(
(
res
=
NETCON_init
(
&
lpwhr
->
netConnection
,
dwFlags
&
INTERNET_FLAG_SECURE
))
!=
ERROR_SUCCESS
)
{
InternetCloseHandle
(
handle
);
handle
=
NULL
;
INTERNET_SetLastError
(
res
);
goto
lend
;
}
...
...
@@ -3694,7 +3695,11 @@ static BOOL HTTP_HandleRedirect(http_request_t *lpwhr, LPCWSTR lpszUrl)
INTERNET_SetLastError
(
res
);
return
FALSE
;
}
if
(
!
NETCON_init
(
&
lpwhr
->
netConnection
,
lpwhr
->
hdr
.
dwFlags
&
INTERNET_FLAG_SECURE
))
return
FALSE
;
res
=
NETCON_init
(
&
lpwhr
->
netConnection
,
lpwhr
->
hdr
.
dwFlags
&
INTERNET_FLAG_SECURE
);
if
(
res
!=
ERROR_SUCCESS
)
{
INTERNET_SetLastError
(
res
);
return
FALSE
;
}
lpwhr
->
read_pos
=
lpwhr
->
read_size
=
0
;
lpwhr
->
read_chunked
=
FALSE
;
}
...
...
dlls/wininet/internet.h
View file @
b01d5842
...
...
@@ -428,7 +428,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD
dwStatusInfoLength
);
BOOL
NETCON_connected
(
WININET_NETCONNECTION
*
connection
);
BOOL
NETCON_init
(
WININET_NETCONNECTION
*
connnection
,
BOOL
useSSL
);
DWORD
NETCON_init
(
WININET_NETCONNECTION
*
connnection
,
BOOL
useSSL
);
void
NETCON_unload
(
void
);
DWORD
NETCON_create
(
WININET_NETCONNECTION
*
connection
,
int
domain
,
int
type
,
int
protocol
);
...
...
dlls/wininet/netconnection.c
View file @
b01d5842
...
...
@@ -163,7 +163,7 @@ static void ssl_lock_callback(int mode, int type, const char *file, int line)
#endif
BOOL
NETCON_init
(
WININET_NETCONNECTION
*
connection
,
BOOL
useSSL
)
DWORD
NETCON_init
(
WININET_NETCONNECTION
*
connection
,
BOOL
useSSL
)
{
connection
->
useSSL
=
FALSE
;
connection
->
socketFD
=
-
1
;
...
...
@@ -177,25 +177,23 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
if
(
OpenSSL_ssl_handle
)
/* already initialized everything */
{
LeaveCriticalSection
(
&
init_ssl_cs
);
return
TRUE
;
return
ERROR_SUCCESS
;
}
OpenSSL_ssl_handle
=
wine_dlopen
(
SONAME_LIBSSL
,
RTLD_NOW
,
NULL
,
0
);
if
(
!
OpenSSL_ssl_handle
)
{
ERR
(
"trying to use a SSL connection, but couldn't load %s. Expect trouble.
\n
"
,
SONAME_LIBSSL
);
INTERNET_SetLastError
(
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
);
LeaveCriticalSection
(
&
init_ssl_cs
);
return
FALSE
;
return
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
;
}
OpenSSL_crypto_handle
=
wine_dlopen
(
SONAME_LIBCRYPTO
,
RTLD_NOW
,
NULL
,
0
);
if
(
!
OpenSSL_crypto_handle
)
{
ERR
(
"trying to use a SSL connection, but couldn't load %s. Expect trouble.
\n
"
,
SONAME_LIBCRYPTO
);
INTERNET_SetLastError
(
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
);
LeaveCriticalSection
(
&
init_ssl_cs
);
return
FALSE
;
return
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
;
}
/* mmm nice ugly macroness */
...
...
@@ -204,9 +202,8 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
if (!p##x) \
{ \
ERR("failed to load symbol %s\n", #x); \
INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); \
LeaveCriticalSection(&init_ssl_cs); \
return
FALSE
; \
return
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
; \
}
DYNSSL
(
SSL_library_init
);
...
...
@@ -234,9 +231,8 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
if (!p##x) \
{ \
ERR("failed to load symbol %s\n", #x); \
INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); \
LeaveCriticalSection(&init_ssl_cs); \
return
FALSE
; \
return
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
; \
}
DYNCRYPTO
(
BIO_new_fp
);
DYNCRYPTO
(
CRYPTO_num_locks
);
...
...
@@ -257,9 +253,8 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
{
ERR
(
"SSL_CTX_set_default_verify_paths failed: %s
\n
"
,
pERR_error_string
(
pERR_get_error
(),
0
));
INTERNET_SetLastError
(
ERROR_OUTOFMEMORY
);
LeaveCriticalSection
(
&
init_ssl_cs
);
return
FALSE
;
return
ERROR_OUTOFMEMORY
;
}
pCRYPTO_set_id_callback
(
ssl_thread_id
);
...
...
@@ -267,9 +262,8 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
pCRYPTO_num_locks
()
*
sizeof
(
CRITICAL_SECTION
));
if
(
!
ssl_locks
)
{
INTERNET_SetLastError
(
ERROR_OUTOFMEMORY
);
LeaveCriticalSection
(
&
init_ssl_cs
);
return
FALSE
;
return
ERROR_OUTOFMEMORY
;
}
for
(
i
=
0
;
i
<
pCRYPTO_num_locks
();
i
++
)
InitializeCriticalSection
(
&
ssl_locks
[
i
]);
...
...
@@ -277,11 +271,10 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
LeaveCriticalSection
(
&
init_ssl_cs
);
#else
FIXME
(
"can't use SSL, not compiled in.
\n
"
);
INTERNET_SetLastError
(
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
);
return
FALSE
;
return
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
;
#endif
}
return
TRUE
;
return
ERROR_SUCCESS
;
}
void
NETCON_unload
(
void
)
...
...
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