Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
getty
Project
Project
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
wei.xuan
getty
Commits
e6f6178b
Commit
e6f6178b
authored
May 22, 2019
by
u0x01
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mod: fix pkg/errors import & improve some err format
parent
ff16ffe3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
conn.go
conn.go
+2
-2
getty.go
getty.go
+2
-1
No files found.
conn.go
View file @
e6f6178b
...
@@ -250,7 +250,7 @@ func (t *gettyTCPConn) read(p []byte) (int, error) {
...
@@ -250,7 +250,7 @@ func (t *gettyTCPConn) read(p []byte) (int, error) {
}
}
length
,
err
=
t
.
reader
.
Read
(
p
)
length
,
err
=
t
.
reader
.
Read
(
p
)
log
.
Debug
(
"now:%s, length:%d, err:%
s
"
,
currentTime
,
length
,
err
)
log
.
Debug
(
"now:%s, length:%d, err:%
v
"
,
currentTime
,
length
,
err
)
atomic
.
AddUint32
(
&
t
.
readBytes
,
uint32
(
length
))
atomic
.
AddUint32
(
&
t
.
readBytes
,
uint32
(
length
))
return
length
,
perrors
.
WithStack
(
err
)
return
length
,
perrors
.
WithStack
(
err
)
//return length, err
//return length, err
...
@@ -285,7 +285,7 @@ func (t *gettyTCPConn) Write(pkg interface{}) (int, error) {
...
@@ -285,7 +285,7 @@ func (t *gettyTCPConn) Write(pkg interface{}) (int, error) {
if
length
,
err
=
t
.
writer
.
Write
(
p
);
err
==
nil
{
if
length
,
err
=
t
.
writer
.
Write
(
p
);
err
==
nil
{
atomic
.
AddUint32
(
&
t
.
writeBytes
,
(
uint32
)(
len
(
p
)))
atomic
.
AddUint32
(
&
t
.
writeBytes
,
(
uint32
)(
len
(
p
)))
}
}
log
.
Debug
(
"now:%s, length:%d, err:%
s
"
,
currentTime
,
length
,
err
)
log
.
Debug
(
"now:%s, length:%d, err:%
v
"
,
currentTime
,
length
,
err
)
return
length
,
perrors
.
WithStack
(
err
)
return
length
,
perrors
.
WithStack
(
err
)
//return length, err
//return length, err
}
}
...
...
getty.go
View file @
e6f6178b
...
@@ -11,9 +11,10 @@ package getty
...
@@ -11,9 +11,10 @@ package getty
import
(
import
(
"compress/flate"
"compress/flate"
"errors"
"net"
"net"
"time"
"time"
perrors
"github.com/pkg/errors"
)
)
// NewSessionCallback will be invoked when server accepts a new client connection or client connects to server successfully.
// NewSessionCallback will be invoked when server accepts a new client connection or client connects to server successfully.
...
...
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