Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
f5670326
Commit
f5670326
authored
3 years ago
by
Kevin Saul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: handle long custom headers
parent
e85ef778
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
src/libgit2/transports/winhttp.c
+9
-4
No files found.
src/libgit2/transports/winhttp.c
View file @
f5670326
...
...
@@ -562,18 +562,23 @@ static int winhttp_stream_connect(winhttp_stream *s)
for
(
i
=
0
;
i
<
t
->
owner
->
connect_opts
.
custom_headers
.
count
;
i
++
)
{
if
(
t
->
owner
->
connect_opts
.
custom_headers
.
strings
[
i
])
{
wchar_t
*
custom_header_wide
=
NULL
;
git_str_clear
(
&
buf
);
git_str_puts
(
&
buf
,
t
->
owner
->
connect_opts
.
custom_headers
.
strings
[
i
]);
if
(
git__utf8_to_16
(
ct
,
MAX_CONTENT_TYPE_LEN
,
git_str_cstr
(
&
buf
))
<
0
)
{
git_error_set
(
GIT_ERROR_OS
,
"failed to convert custom header to wide characters"
);
/* Convert header to wide characters */
if
((
error
=
git__utf8_to_16_alloc
(
&
custom_header_wide
,
git_str_cstr
(
&
buf
)))
<
0
)
goto
on_error
;
}
if
(
!
WinHttpAddRequestHeaders
(
s
->
request
,
c
t
,
(
ULONG
)
-
1L
,
if
(
!
WinHttpAddRequestHeaders
(
s
->
request
,
c
ustom_header_wide
,
(
ULONG
)
-
1L
,
WINHTTP_ADDREQ_FLAG_ADD
|
WINHTTP_ADDREQ_FLAG_REPLACE
))
{
git_error_set
(
GIT_ERROR_OS
,
"failed to add a header to the request"
);
git__free
(
custom_header_wide
);
goto
on_error
;
}
git__free
(
custom_header_wide
);
}
}
...
...
This diff is collapsed.
Click to expand it.
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