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
95d8f6fc
Commit
95d8f6fc
authored
Jan 18, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implemented IXMLHttpRequest::get_statusText().
parent
3935124d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
5 deletions
+38
-5
httprequest.c
dlls/msxml3/httprequest.c
+27
-5
domdoc.c
dlls/msxml3/tests/domdoc.c
+11
-0
No files found.
dlls/msxml3/httprequest.c
View file @
95d8f6fc
...
...
@@ -98,6 +98,7 @@ typedef struct
/* bind callback */
BindStatusCallback
*
bsc
;
LONG
status
;
BSTR
status_text
;
/* IObjectWithSite*/
IUnknown
*
site
;
...
...
@@ -517,8 +518,10 @@ static HRESULT WINAPI BSCHttpNegotiate_OnResponse(IHttpNegotiate *iface, DWORD c
debugstr_w
(
req_headers
),
add_reqheaders
);
This
->
request
->
status
=
code
;
/* store headers */
/* store headers
and status text
*/
free_response_headers
(
This
->
request
);
SysFreeString
(
This
->
request
->
status_text
);
This
->
request
->
status_text
=
NULL
;
if
(
resp_headers
)
{
const
WCHAR
*
ptr
,
*
line
;
...
...
@@ -530,7 +533,19 @@ static HRESULT WINAPI BSCHttpNegotiate_OnResponse(IHttpNegotiate *iface, DWORD c
{
if
(
*
ptr
==
'\r'
&&
*
(
ptr
+
1
)
==
'\n'
)
{
line
=
++
ptr
+
1
;
const
WCHAR
*
end
=
ptr
-
1
;
line
=
ptr
+
2
;
/* scan back to get status phrase */
while
(
ptr
>
resp_headers
)
{
if
(
*
ptr
==
' '
)
{
This
->
request
->
status_text
=
SysAllocStringLen
(
ptr
+
1
,
end
-
ptr
);
TRACE
(
"status text %s
\n
"
,
debugstr_w
(
This
->
request
->
status_text
));
break
;
}
ptr
--
;
}
break
;
}
ptr
++
;
...
...
@@ -789,6 +804,7 @@ static ULONG WINAPI httprequest_Release(IXMLHTTPRequest *iface)
}
/* response headers */
free_response_headers
(
This
);
SysFreeString
(
This
->
status_text
);
/* detach callback object */
BindStatusCallback_Detach
(
This
->
bsc
);
...
...
@@ -1093,13 +1109,18 @@ static HRESULT WINAPI httprequest_get_status(IXMLHTTPRequest *iface, LONG *statu
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_get_statusText
(
IXMLHTTPRequest
*
iface
,
BSTR
*
pbstrS
tatus
)
static
HRESULT
WINAPI
httprequest_get_statusText
(
IXMLHTTPRequest
*
iface
,
BSTR
*
s
tatus
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
FIXME
(
"stub %p %p
\n
"
,
This
,
pbstrS
tatus
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
s
tatus
);
return
E_NOTIMPL
;
if
(
!
status
)
return
E_INVALIDARG
;
if
(
This
->
state
!=
READYSTATE_COMPLETE
)
return
E_FAIL
;
*
status
=
SysAllocString
(
This
->
status_text
);
return
S_OK
;
}
static
HRESULT
WINAPI
httprequest_get_responseXML
(
IXMLHTTPRequest
*
iface
,
IDispatch
**
body
)
...
...
@@ -1475,6 +1496,7 @@ HRESULT XMLHTTPRequest_create(IUnknown *pUnkOuter, void **ppObj)
req
->
bsc
=
NULL
;
req
->
status
=
0
;
req
->
status_text
=
NULL
;
req
->
reqheader_size
=
0
;
req
->
raw_respheaders
=
NULL
;
req
->
use_utf8_content
=
FALSE
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
95d8f6fc
...
...
@@ -4744,6 +4744,9 @@ static void test_XMLHTTP(void)
ok
(
hr
==
E_FAIL
||
broken
(
hr
==
E_UNEXPECTED
)
/* win2k */
,
"got 0x%08x
\n
"
,
hr
);
ok
(
status
==
0xdeadbeef
,
"got %d
\n
"
,
status
);
hr
=
IXMLHttpRequest_get_statusText
(
xhr
,
&
str
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
/* invalid parameters */
hr
=
IXMLHttpRequest_open
(
xhr
,
NULL
,
NULL
,
async
,
dummy
,
dummy
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
...
...
@@ -4862,6 +4865,14 @@ static void test_XMLHTTP(void)
EXPECT_HR
(
hr
,
S_OK
);
ok
(
status
==
200
,
"got %d
\n
"
,
status
);
hr
=
IXMLHttpRequest_get_statusText
(
xhr
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
IXMLHttpRequest_get_statusText
(
xhr
,
&
str
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
!
lstrcmpW
(
str
,
_bstr_
(
"OK"
)),
"got status %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
/* another ::send() after completed request */
V_VT
(
&
varbody
)
=
VT_BSTR
;
V_BSTR
(
&
varbody
)
=
_bstr_
(
bodyA
);
...
...
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