Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
b1c6f41d
Commit
b1c6f41d
authored
14 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mshtml: Moved getting HTTP header to separated function.
parent
dd0894c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/mshtml/mshtml_private.h
+13
-0
13 additions, 0 deletions
dlls/mshtml/mshtml_private.h
dlls/mshtml/nsio.c
+40
-25
40 additions, 25 deletions
dlls/mshtml/nsio.c
with
53 additions
and
25 deletions
dlls/mshtml/mshtml_private.h
+
13
−
0
View file @
b1c6f41d
...
...
@@ -943,6 +943,19 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
return
ret
;
}
static
inline
LPWSTR
heap_strndupW
(
LPCWSTR
str
,
unsigned
len
)
{
LPWSTR
ret
=
NULL
;
if
(
str
)
{
ret
=
heap_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
ret
,
str
,
len
*
sizeof
(
WCHAR
));
ret
[
len
]
=
0
;
}
return
ret
;
}
static
inline
char
*
heap_strdupA
(
const
char
*
str
)
{
char
*
ret
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
dlls/mshtml/nsio.c
+
40
−
25
View file @
b1c6f41d
...
...
@@ -311,6 +311,45 @@ static inline BOOL is_http_channel(nsChannel *This)
return
This
->
url_scheme
==
URL_SCHEME_HTTP
||
This
->
url_scheme
==
URL_SCHEME_HTTPS
;
}
static
http_header_t
*
find_http_header
(
struct
list
*
headers
,
const
WCHAR
*
name
,
int
len
)
{
http_header_t
*
iter
;
LIST_FOR_EACH_ENTRY
(
iter
,
headers
,
http_header_t
,
entry
)
{
if
(
!
strcmpiW
(
iter
->
header
,
name
))
return
iter
;
}
return
NULL
;
}
static
nsresult
get_channel_http_header
(
struct
list
*
headers
,
const
nsACString
*
header_name_str
,
nsACString
*
_retval
)
{
const
char
*
header_namea
;
http_header_t
*
header
;
WCHAR
*
header_name
;
char
*
data
;
nsACString_GetData
(
header_name_str
,
&
header_namea
);
header_name
=
heap_strdupAtoW
(
header_namea
);
if
(
!
header_name
)
return
NS_ERROR_UNEXPECTED
;
header
=
find_http_header
(
headers
,
header_name
,
strlenW
(
header_name
));
heap_free
(
header_name
);
if
(
!
header
)
return
NS_ERROR_NOT_AVAILABLE
;
data
=
heap_strdupWtoA
(
header
->
data
);
if
(
!
data
)
return
NS_ERROR_UNEXPECTED
;
nsACString_SetData
(
_retval
,
data
);
heap_free
(
data
);
return
NS_OK
;
}
static
void
free_http_headers
(
struct
list
*
list
)
{
http_header_t
*
iter
,
*
iter_next
;
...
...
@@ -1079,34 +1118,10 @@ static nsresult NSAPI nsChannel_GetResponseHeader(nsIHttpChannel *iface,
const
nsACString
*
header
,
nsACString
*
_retval
)
{
nsChannel
*
This
=
NSCHANNEL_THIS
(
iface
);
const
char
*
header_str
;
WCHAR
*
header_wstr
;
struct
ResponseHeader
*
this_header
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_nsacstr
(
header
),
_retval
);
nsACString_GetData
(
header
,
&
header_str
);
header_wstr
=
heap_strdupAtoW
(
header_str
);
if
(
!
header_wstr
)
return
NS_ERROR_UNEXPECTED
;
LIST_FOR_EACH_ENTRY
(
this_header
,
&
This
->
response_headers
,
struct
ResponseHeader
,
entry
)
{
if
(
!
strcmpW
(
this_header
->
header
,
header_wstr
))
{
char
*
data
=
heap_strdupWtoA
(
this_header
->
data
);
if
(
!
data
)
{
heap_free
(
header_wstr
);
return
NS_ERROR_UNEXPECTED
;
}
nsACString_SetData
(
_retval
,
data
);
heap_free
(
data
);
heap_free
(
header_wstr
);
return
NS_OK
;
}
}
heap_free
(
header_wstr
);
return
NS_ERROR_NOT_AVAILABLE
;
return
get_channel_http_header
(
&
This
->
response_headers
,
header
,
_retval
);
}
static
nsresult
NSAPI
nsChannel_SetResponseHeader
(
nsIHttpChannel
*
iface
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment