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
a30ffca1
Commit
a30ffca1
authored
Mar 02, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Move close_connection implementation to common Protocol object.
parent
7c77c57a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
31 deletions
+53
-31
http.c
dlls/urlmon/http.c
+30
-31
protocol.c
dlls/urlmon/protocol.c
+14
-0
urlmon_main.h
dlls/urlmon/urlmon_main.h
+9
-0
No files found.
dlls/urlmon/http.c
View file @
a30ffca1
...
...
@@ -80,9 +80,32 @@ typedef struct {
static
const
WCHAR
wszHeaders
[]
=
{
'A'
,
'c'
,
'c'
,
'e'
,
'p'
,
't'
,
'-'
,
'E'
,
'n'
,
'c'
,
'o'
,
'd'
,
'i'
,
'n'
,
'g'
,
':'
,
' '
,
'g'
,
'z'
,
'i'
,
'p'
,
','
,
' '
,
'd'
,
'e'
,
'f'
,
'l'
,
'a'
,
't'
,
'e'
,
0
};
/*
* Helpers
*/
#define ASYNCPROTOCOL_THIS(iface) DEFINE_THIS2(HttpProtocol, base, iface)
static
void
HttpProtocol_close_connection
(
Protocol
*
prot
)
{
HttpProtocol
*
This
=
ASYNCPROTOCOL_THIS
(
prot
);
if
(
This
->
connection
)
InternetCloseHandle
(
This
->
connection
);
if
(
This
->
http_negotiate
)
{
IHttpNegotiate_Release
(
This
->
http_negotiate
);
This
->
http_negotiate
=
0
;
}
if
(
This
->
full_header
)
{
if
(
This
->
full_header
!=
wszHeaders
)
heap_free
(
This
->
full_header
);
This
->
full_header
=
0
;
}
}
#undef ASYNCPROTOCOL_THIS
static
const
ProtocolVtbl
AsyncProtocolVtbl
=
{
HttpProtocol_close_connection
};
static
void
HTTPPROTOCOL_ReportResult
(
HttpProtocol
*
This
,
HRESULT
hres
)
{
...
...
@@ -129,31 +152,6 @@ static void HTTPPROTOCOL_AllDataRead(HttpProtocol *This)
HTTPPROTOCOL_ReportResult
(
This
,
S_OK
);
}
static
void
HTTPPROTOCOL_Close
(
HttpProtocol
*
This
)
{
if
(
This
->
http_negotiate
)
{
IHttpNegotiate_Release
(
This
->
http_negotiate
);
This
->
http_negotiate
=
0
;
}
if
(
This
->
base
.
request
)
InternetCloseHandle
(
This
->
base
.
request
);
if
(
This
->
connection
)
InternetCloseHandle
(
This
->
connection
);
if
(
This
->
base
.
internet
)
{
InternetCloseHandle
(
This
->
base
.
internet
);
This
->
base
.
internet
=
0
;
}
if
(
This
->
full_header
)
{
if
(
This
->
full_header
!=
wszHeaders
)
heap_free
(
This
->
full_header
);
This
->
full_header
=
0
;
}
This
->
base
.
flags
=
0
;
}
static
void
CALLBACK
HTTPPROTOCOL_InternetStatusCallback
(
HINTERNET
hInternet
,
DWORD_PTR
dwContext
,
DWORD
dwInternetStatus
,
LPVOID
lpvStatusInformation
,
DWORD
dwStatusInformationLength
)
...
...
@@ -269,7 +267,7 @@ static ULONG WINAPI HttpProtocol_Release(IInternetProtocol *iface)
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
HTTPPROTOCOL_Close
(
This
);
protocol_close_connection
(
&
This
->
base
);
heap_free
(
This
);
URLMON_UnlockModule
();
...
...
@@ -523,7 +521,7 @@ done:
if
(
hres
!=
S_OK
)
{
IInternetProtocolSink_ReportResult
(
This
->
base
.
protocol_sink
,
hres
,
0
,
NULL
);
HTTPPROTOCOL_Close
(
This
);
protocol_close_connection
(
&
This
->
base
);
}
CoTaskMemFree
(
post_cookie
);
...
...
@@ -714,8 +712,8 @@ static HRESULT WINAPI HttpProtocol_Terminate(IInternetProtocol *iface, DWORD dwO
HttpProtocol
*
This
=
PROTOCOL_THIS
(
iface
);
TRACE
(
"(%p)->(%08x)
\n
"
,
This
,
dwOptions
);
HTTPPROTOCOL_Close
(
This
);
protocol_close_connection
(
&
This
->
base
);
return
S_OK
;
}
...
...
@@ -915,6 +913,7 @@ static HRESULT create_http_protocol(BOOL https, void **ppobj)
if
(
!
ret
)
return
E_OUTOFMEMORY
;
ret
->
base
.
vtbl
=
&
AsyncProtocolVtbl
;
ret
->
lpInternetProtocolVtbl
=
&
HttpProtocolVtbl
;
ret
->
lpInternetPriorityVtbl
=
&
HttpPriorityVtbl
;
...
...
dlls/urlmon/protocol.c
View file @
a30ffca1
...
...
@@ -42,3 +42,17 @@ HRESULT protocol_unlock_request(Protocol *protocol)
return
S_OK
;
}
void
protocol_close_connection
(
Protocol
*
protocol
)
{
protocol
->
vtbl
->
close_connection
(
protocol
);
if
(
protocol
->
request
)
InternetCloseHandle
(
protocol
->
request
);
if
(
protocol
->
internet
)
{
InternetCloseHandle
(
protocol
->
internet
);
protocol
->
internet
=
0
;
}
protocol
->
flags
=
0
;
}
dlls/urlmon/urlmon_main.h
View file @
a30ffca1
...
...
@@ -79,7 +79,11 @@ HRESULT bind_to_object(IMoniker *mon, LPCWSTR url, IBindCtx *pbc, REFIID riid, v
HRESULT
create_binding_protocol
(
LPCWSTR
url
,
BOOL
from_urlmon
,
IInternetProtocol
**
protocol
);
void
set_binding_sink
(
IInternetProtocol
*
bind_protocol
,
IInternetProtocolSink
*
sink
);
typedef
struct
ProtocolVtbl
ProtocolVtbl
;
typedef
struct
{
const
ProtocolVtbl
*
vtbl
;
IInternetProtocol
*
protocol
;
IInternetProtocolSink
*
protocol_sink
;
...
...
@@ -98,8 +102,13 @@ typedef struct {
LONG
priority
;
}
Protocol
;
struct
ProtocolVtbl
{
void
(
*
close_connection
)(
Protocol
*
);
};
HRESULT
protocol_lock_request
(
Protocol
*
);
HRESULT
protocol_unlock_request
(
Protocol
*
);
void
protocol_close_connection
(
Protocol
*
);
static
inline
void
*
heap_alloc
(
size_t
len
)
{
...
...
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