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
8ca78fa1
Commit
8ca78fa1
authored
Aug 03, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved headers parsing to separated function.
parent
6ae84b0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
31 deletions
+42
-31
navigate.c
dlls/mshtml/navigate.c
+42
-31
No files found.
dlls/mshtml/navigate.c
View file @
8ca78fa1
...
...
@@ -638,6 +638,39 @@ static void call_docview_84(HTMLDocumentObj *doc)
FIXME
(
"handle result
\n
"
);
}
static
HRESULT
parse_headers
(
const
WCHAR
*
headers
,
struct
list
*
headers_list
)
{
const
WCHAR
*
header
,
*
header_end
,
*
colon
,
*
value
;
HRESULT
hres
;
header
=
headers
;
while
(
*
header
)
{
if
(
header
[
0
]
==
'\r'
&&
header
[
1
]
==
'\n'
&&
!
header
[
2
])
break
;
for
(
colon
=
header
;
*
colon
&&
*
colon
!=
':'
&&
*
colon
!=
'\r'
;
colon
++
);
if
(
*
colon
!=
':'
)
return
E_FAIL
;
value
=
colon
+
1
;
while
(
*
value
==
' '
)
value
++
;
if
(
!*
value
)
return
E_FAIL
;
for
(
header_end
=
value
+
1
;
*
header_end
&&
*
header_end
!=
'\r'
;
header_end
++
);
hres
=
set_http_header
(
headers_list
,
header
,
colon
-
header
,
value
,
header_end
-
value
);
if
(
FAILED
(
hres
))
return
hres
;
header
=
header_end
;
if
(
header
[
0
]
==
'\r'
&&
header
[
1
]
==
'\n'
)
header
+=
2
;
}
return
S_OK
;
}
static
void
parse_post_data
(
nsIInputStream
*
post_data_stream
,
LPWSTR
*
headers_ret
,
HGLOBAL
*
post_data_ret
,
ULONG
*
post_data_len_ret
)
{
...
...
@@ -1109,38 +1142,16 @@ static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code,
This
->
nschannel
->
response_status
=
response_code
;
if
(
response_headers
)
{
const
WCHAR
*
hdr_start
,
*
hdr_end
;
hdr_start
=
strchrW
(
response_headers
,
'\r'
);
while
(
hdr_start
)
{
const
WCHAR
*
colon
,
*
value
;
hdr_start
+=
2
;
hdr_end
=
strchrW
(
hdr_start
,
'\r'
);
if
(
!
hdr_end
)
{
WARN
(
"Header doesn't end with CRLF: %s
\n
"
,
wine_dbgstr_w
(
hdr_start
));
break
;
}
if
(
hdr_end
==
hdr_start
)
break
;
for
(
colon
=
hdr_start
;
*
colon
!=
':'
&&
colon
!=
hdr_end
;
++
colon
);
if
(
*
colon
!=
':'
)
{
WARN
(
"Header missing colon: %s
\n
"
,
wine_dbgstr_w
(
hdr_start
));
hdr_start
=
strchrW
(
hdr_start
,
'\r'
);
continue
;
}
value
=
colon
+
1
;
while
(
*
value
==
' '
)
value
++
;
hres
=
set_http_header
(
&
This
->
nschannel
->
response_headers
,
hdr_start
,
colon
-
hdr_start
,
value
,
hdr_end
-
value
);
if
(
FAILED
(
hres
))
const
WCHAR
*
headers
;
headers
=
strchrW
(
response_headers
,
'\r'
);
if
(
headers
&&
headers
[
1
]
==
'\n'
)
{
headers
+=
2
;
hres
=
parse_headers
(
headers
,
&
This
->
nschannel
->
response_headers
);
if
(
FAILED
(
hres
))
{
WARN
(
"parsing headers failed: %08x
\n
"
,
hres
);
return
hres
;
hdr_start
=
strchrW
(
hdr_start
,
'\r'
);
}
}
}
...
...
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