Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
072fef2e
Commit
072fef2e
authored
1 year ago
by
Adrien Béraud
Committed by
Sébastien Blin
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
gitserver: use fmt for ack formating
Change-Id: Icda0ff63de0d57640b02d0ca580dda230b870276
parent
6a09d839
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/jamidht/gitserver.cpp
+5
-10
5 additions, 10 deletions
src/jamidht/gitserver.cpp
with
5 additions
and
10 deletions
src/jamidht/gitserver.cpp
+
5
−
10
View file @
072fef2e
...
@@ -227,7 +227,6 @@ GitServer::Impl::sendReferenceCapabilities(bool sendVersion)
...
@@ -227,7 +227,6 @@ GitServer::Impl::sendReferenceCapabilities(bool sendVersion)
// Answer with the version number
// Answer with the version number
// **** When the client initially connects the server will immediately respond
// **** When the client initially connects the server will immediately respond
// **** with a version number (if "version=1" is sent as an Extra Parameter),
// **** with a version number (if "version=1" is sent as an Extra Parameter),
std
::
string
currentHead
;
std
::
error_code
ec
;
std
::
error_code
ec
;
if
(
sendVersion
)
{
if
(
sendVersion
)
{
auto
toSend
=
"000eversion 1
\0
"
sv
;
auto
toSend
=
"000eversion 1
\0
"
sv
;
...
@@ -247,7 +246,7 @@ GitServer::Impl::sendReferenceCapabilities(bool sendVersion)
...
@@ -247,7 +246,7 @@ GitServer::Impl::sendReferenceCapabilities(bool sendVersion)
socket_
->
shutdown
();
socket_
->
shutdown
();
return
;
return
;
}
}
currentHead
=
git_oid_tostr_s
(
&
commit_id
);
std
::
string
currentHead
=
git_oid_tostr_s
(
&
commit_id
);
// Send references
// Send references
std
::
ostringstream
packet
;
std
::
ostringstream
packet
;
...
@@ -287,10 +286,8 @@ GitServer::Impl::ACKCommon()
...
@@ -287,10 +286,8 @@ GitServer::Impl::ACKCommon()
std
::
error_code
ec
;
std
::
error_code
ec
;
// Ack common base
// Ack common base
if
(
!
common_
.
empty
())
{
if
(
!
common_
.
empty
())
{
std
::
ostringstream
packet
;
auto
toSend
=
fmt
::
format
(
FMT_COMPILE
(
"{:04x}ACK {} continue
\n
"
),
packet
<<
toGitHex
(
18
/* size + ACK + space * 2 + continue + \n */
+
common_
.
size
());
18
+
common_
.
size
()
/* size + ACK + space * 2 + continue + \n */
,
common_
);
packet
<<
"ACK "
<<
common_
<<
" continue
\n
"
;
auto
toSend
=
packet
.
str
();
socket_
->
write
(
reinterpret_cast
<
const
unsigned
char
*>
(
toSend
.
c_str
()),
toSend
.
size
(),
ec
);
socket_
->
write
(
reinterpret_cast
<
const
unsigned
char
*>
(
toSend
.
c_str
()),
toSend
.
size
(),
ec
);
if
(
ec
)
{
if
(
ec
)
{
JAMI_WARNING
(
"Couldn't send data for {}: {}"
,
repository_
,
ec
.
message
());
JAMI_WARNING
(
"Couldn't send data for {}: {}"
,
repository_
,
ec
.
message
());
...
@@ -305,10 +302,8 @@ GitServer::Impl::ACKFirst()
...
@@ -305,10 +302,8 @@ GitServer::Impl::ACKFirst()
std
::
error_code
ec
;
std
::
error_code
ec
;
// Ack common base
// Ack common base
if
(
!
common_
.
empty
())
{
if
(
!
common_
.
empty
())
{
std
::
ostringstream
packet
;
auto
toSend
=
fmt
::
format
(
FMT_COMPILE
(
"{:04x}ACK {}
\n
"
),
packet
<<
toGitHex
(
9
/* size + ACK + space + \n */
+
common_
.
size
());
9
+
common_
.
size
()
/* size + ACK + space + \n */
,
common_
);
packet
<<
"ACK "
<<
common_
<<
"
\n
"
;
auto
toSend
=
packet
.
str
();
socket_
->
write
(
reinterpret_cast
<
const
unsigned
char
*>
(
toSend
.
c_str
()),
toSend
.
size
(),
ec
);
socket_
->
write
(
reinterpret_cast
<
const
unsigned
char
*>
(
toSend
.
c_str
()),
toSend
.
size
(),
ec
);
if
(
ec
)
{
if
(
ec
)
{
JAMI_WARNING
(
"Couldn't send data for {}: {}"
,
repository_
,
ec
.
message
());
JAMI_WARNING
(
"Couldn't send data for {}: {}"
,
repository_
,
ec
.
message
());
...
...
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