Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-workhorse
Commits
45d7c0c1
Commit
45d7c0c1
authored
Sep 30, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit size of errors
parent
e01a78e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
internal/git/pktline.go
internal/git/pktline.go
+7
-2
No files found.
internal/git/pktline.go
View file @
45d7c0c1
...
...
@@ -34,9 +34,14 @@ func scanDeepen(body io.Reader) (bool, error) {
}
func
pktLineSplitter
(
data
[]
byte
,
atEOF
bool
)
(
advance
int
,
token
[]
byte
,
err
error
)
{
truncatedData
:=
data
if
len
(
data
)
>
100
{
truncatedData
=
truncatedData
[
:
100
]
}
if
len
(
data
)
<
4
{
if
atEOF
&&
len
(
data
)
>
0
{
return
0
,
nil
,
fmt
.
Errorf
(
"pktLineSplitter: incomplete length prefix on %q"
,
d
ata
)
return
0
,
nil
,
fmt
.
Errorf
(
"pktLineSplitter: incomplete length prefix on %q"
,
truncatedD
ata
)
}
return
0
,
nil
,
nil
// want more data
}
...
...
@@ -62,7 +67,7 @@ func pktLineSplitter(data []byte, atEOF bool) (advance int, token []byte, err er
if
len
(
data
)
<
pktLength
{
if
atEOF
{
return
0
,
nil
,
fmt
.
Errorf
(
"pktLineSplitter: less than %d bytes in input %q"
,
pktLength
,
d
ata
)
return
0
,
nil
,
fmt
.
Errorf
(
"pktLineSplitter: less than %d bytes in input %q"
,
pktLength
,
truncatedD
ata
)
}
return
0
,
nil
,
nil
// want more data
}
...
...
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