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
b7a26db5
Commit
b7a26db5
authored
Dec 06, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Use IUri for storing XMLHTTPRequest URL.
parent
10a832cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
43 deletions
+57
-43
httprequest.c
dlls/msxml3/httprequest.c
+57
-43
No files found.
dlls/msxml3/httprequest.c
View file @
b7a26db5
...
...
@@ -82,8 +82,8 @@ typedef struct
/* request */
BINDVERB
verb
;
BSTR
custom
;
BSTR
siteurl
;
BSTR
url
;
IUri
*
uri
;
IUri
*
base_uri
;
BOOL
async
;
struct
list
reqheaders
;
/* cached resulting custom request headers string length in WCHARs */
...
...
@@ -736,7 +736,7 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
{
IMoniker
*
moniker
;
hr
=
CreateURLMoniker
(
NULL
,
This
->
url
,
&
moniker
);
hr
=
CreateURLMoniker
Ex2
(
NULL
,
This
->
uri
,
&
moniker
,
URL_MK_UNIFORM
);
if
(
hr
==
S_OK
)
{
IStream
*
stream
;
...
...
@@ -772,10 +772,14 @@ static HRESULT httprequest_open(httprequest *This, BSTR method, BSTR url,
if
(
!
method
||
!
url
)
return
E_INVALIDARG
;
/* free previously set data */
SysFreeString
(
This
->
url
);
if
(
This
->
uri
)
{
IUri_Release
(
This
->
uri
);
This
->
uri
=
NULL
;
}
SysFreeString
(
This
->
user
);
SysFreeString
(
This
->
password
);
This
->
u
rl
=
This
->
u
ser
=
This
->
password
=
NULL
;
This
->
user
=
This
->
password
=
NULL
;
if
(
!
strcmpiW
(
method
,
MethodGetW
))
{
...
...
@@ -802,22 +806,14 @@ static HRESULT httprequest_open(httprequest *This, BSTR method, BSTR url,
return
E_FAIL
;
}
/* try to combine with site url */
if
(
This
->
siteurl
&&
PathIsRelativeW
(
url
))
{
DWORD
len
=
INTERNET_MAX_URL_LENGTH
;
WCHAR
*
fullW
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
hr
=
UrlCombineW
(
This
->
siteurl
,
url
,
fullW
,
&
len
,
0
);
if
(
hr
==
S_OK
)
{
TRACE
(
"combined url %s
\n
"
,
debugstr_w
(
fullW
));
This
->
url
=
SysAllocString
(
fullW
);
}
heap_free
(
fullW
);
}
if
(
This
->
base_uri
)
hr
=
CoInternetCombineUrlEx
(
This
->
base_uri
,
url
,
0
,
&
This
->
uri
,
0
);
else
This
->
url
=
SysAllocString
(
url
);
hr
=
CreateUri
(
url
,
0
,
0
,
&
This
->
uri
);
if
(
FAILED
(
hr
))
{
WARN
(
"Could not create IUri object: %08x
\n
"
,
hr
);
return
hr
;
}
VariantInit
(
&
is_async
);
hr
=
VariantChangeType
(
&
is_async
,
&
async
,
0
,
VT_BOOL
);
...
...
@@ -1141,10 +1137,12 @@ static void httprequest_release(httprequest *This)
if
(
This
->
site
)
IUnknown_Release
(
This
->
site
);
if
(
This
->
uri
)
IUri_Release
(
This
->
uri
);
if
(
This
->
base_uri
)
IUri_Release
(
This
->
base_uri
);
SysFreeString
(
This
->
custom
);
SysFreeString
(
This
->
siteurl
);
SysFreeString
(
This
->
url
);
SysFreeString
(
This
->
user
);
SysFreeString
(
This
->
password
);
...
...
@@ -1444,6 +1442,38 @@ static HRESULT WINAPI httprequest_ObjectWithSite_GetSite( IObjectWithSite *iface
return
IUnknown_QueryInterface
(
This
->
site
,
iid
,
ppvSite
);
}
static
void
get_base_uri
(
httprequest
*
This
)
{
IServiceProvider
*
provider
;
IHTMLDocument2
*
doc
;
IUri
*
uri
;
BSTR
url
;
HRESULT
hr
;
hr
=
IUnknown_QueryInterface
(
This
->
site
,
&
IID_IServiceProvider
,
(
void
**
)
&
provider
);
if
(
FAILED
(
hr
))
return
;
hr
=
IServiceProvider_QueryService
(
provider
,
&
SID_SContainerDispatch
,
&
IID_IHTMLDocument2
,
(
void
**
)
&
doc
);
IServiceProvider_Release
(
provider
);
if
(
FAILED
(
hr
))
return
;
hr
=
IHTMLDocument2_get_URL
(
doc
,
&
url
);
IHTMLDocument2_Release
(
doc
);
if
(
FAILED
(
hr
)
||
!
url
||
!*
url
)
return
;
TRACE
(
"host url %s
\n
"
,
debugstr_w
(
url
));
hr
=
CreateUri
(
url
,
0
,
0
,
&
uri
);
SysFreeString
(
url
);
if
(
FAILED
(
hr
))
return
;
This
->
base_uri
=
uri
;
}
static
HRESULT
WINAPI
httprequest_ObjectWithSite_SetSite
(
IObjectWithSite
*
iface
,
IUnknown
*
punk
)
{
httprequest
*
This
=
impl_from_IObjectWithSite
(
iface
);
...
...
@@ -1452,32 +1482,15 @@ static HRESULT WINAPI httprequest_ObjectWithSite_SetSite( IObjectWithSite *iface
if
(
This
->
site
)
IUnknown_Release
(
This
->
site
);
if
(
This
->
base_uri
)
IUri_Release
(
This
->
base_uri
);
SysFreeString
(
This
->
siteurl
);
This
->
siteurl
=
NULL
;
This
->
site
=
punk
;
if
(
punk
)
{
IServiceProvider
*
provider
;
HRESULT
hr
;
IUnknown_AddRef
(
punk
);
hr
=
IUnknown_QueryInterface
(
This
->
site
,
&
IID_IServiceProvider
,
(
void
**
)
&
provider
);
if
(
hr
==
S_OK
)
{
IHTMLDocument2
*
doc
;
hr
=
IServiceProvider_QueryService
(
provider
,
&
SID_SContainerDispatch
,
&
IID_IHTMLDocument2
,
(
void
**
)
&
doc
);
if
(
hr
==
S_OK
)
{
hr
=
IHTMLDocument2_get_URL
(
doc
,
&
This
->
siteurl
);
IHTMLDocument2_Release
(
doc
);
TRACE
(
"host url %s, 0x%08x
\n
"
,
debugstr_w
(
This
->
siteurl
),
hr
);
}
IServiceProvider_Release
(
provider
);
}
get_base_uri
(
This
);
}
return
S_OK
;
...
...
@@ -1831,7 +1844,8 @@ static void init_httprequest(httprequest *req)
req
->
async
=
FALSE
;
req
->
verb
=
-
1
;
req
->
custom
=
NULL
;
req
->
url
=
req
->
siteurl
=
req
->
user
=
req
->
password
=
NULL
;
req
->
uri
=
req
->
base_uri
=
NULL
;
req
->
user
=
req
->
password
=
NULL
;
req
->
state
=
READYSTATE_UNINITIALIZED
;
req
->
sink
=
NULL
;
...
...
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