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
276f6aa0
Commit
276f6aa0
authored
Sep 08, 2015
by
Matt Burke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hook up the custom_headers to the http transport
parent
4f2b6093
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
src/transports/http.c
+3
-4
src/transports/smart.c
+12
-0
src/transports/smart.h
+1
-0
No files found.
src/transports/http.c
View file @
276f6aa0
...
...
@@ -211,10 +211,9 @@ static int gen_request(
}
else
git_buf_puts
(
buf
,
"Accept: */*
\r\n
"
);
if
(
t
->
connection_data
.
extra_headers
)
{
for
(
i
=
0
;
i
<
t
->
connection_data
.
extra_headers
->
count
;
i
++
)
{
git_buf_puts
(
buf
,
t
->
connection_data
.
extra_headers
->
strings
[
i
]);
git_buf_puts
(
buf
,
"
\r\n
"
);
if
(
t
->
owner
->
custom_headers
)
{
for
(
i
=
0
;
i
<
t
->
owner
->
custom_headers
->
count
;
i
++
)
{
git_buf_printf
(
buf
,
"%s
\r\n
"
,
t
->
owner
->
custom_headers
->
strings
[
i
]);
}
}
...
...
src/transports/smart.c
View file @
276f6aa0
...
...
@@ -66,6 +66,17 @@ static int git_smart__set_callbacks(
return
0
;
}
static
int
git_smart__set_custom_headers
(
git_transport
*
transport
,
const
git_strarray
*
custom_headers
)
{
transport_smart
*
t
=
(
transport_smart
*
)
transport
;
t
->
custom_headers
=
custom_headers
;
return
0
;
}
int
git_smart__update_heads
(
transport_smart
*
t
,
git_vector
*
symrefs
)
{
size_t
i
;
...
...
@@ -399,6 +410,7 @@ int git_transport_smart(git_transport **out, git_remote *owner, void *param)
t
->
parent
.
version
=
GIT_TRANSPORT_VERSION
;
t
->
parent
.
set_callbacks
=
git_smart__set_callbacks
;
t
->
parent
.
set_custom_headers
=
git_smart__set_custom_headers
;
t
->
parent
.
connect
=
git_smart__connect
;
t
->
parent
.
close
=
git_smart__close
;
t
->
parent
.
free
=
git_smart__free
;
...
...
src/transports/smart.h
View file @
276f6aa0
...
...
@@ -139,6 +139,7 @@ typedef struct {
git_transport_message_cb
error_cb
;
git_transport_certificate_check_cb
certificate_check_cb
;
void
*
message_cb_payload
;
const
git_strarray
*
custom_headers
;
git_smart_subtransport
*
wrapped
;
git_smart_subtransport_stream
*
current_stream
;
transport_smart_caps
caps
;
...
...
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