Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
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
a2461f81
Unverified
Commit
a2461f81
authored
Oct 28, 2021
by
Xin.Zh
Committed by
GitHub
Oct 28, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #81 from apache/feature/gxbytes-buffer
Imp: using gxbytes.Buffer WriteNextBegin/WriteNextEnd
parents
66f25061
43cebf12
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
11 deletions
+5
-11
go.mod
go.mod
+1
-1
go.sum
go.sum
+0
-2
session.go
session.go
+4
-8
No files found.
go.mod
View file @
a2461f81
...
...
@@ -3,7 +3,7 @@ module github.com/apache/dubbo-getty
go 1.14
require (
github.com/dubbogo/gost v1.11.1
2
github.com/dubbogo/gost v1.11.1
9
github.com/golang/snappy v0.0.1
github.com/gorilla/websocket v1.4.2
github.com/montanaflynn/stats v0.6.6
...
...
go.sum
View file @
a2461f81
...
...
@@ -79,8 +79,6 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c=
github.com/dubbogo/gost v1.11.12 h1:e3861DxHWe509whpMxS6mFBmgmm7r9+bT5iJ/PRufcw=
github.com/dubbogo/gost v1.11.12/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI=
github.com/dubbogo/gost v1.11.19 h1:R1rZ3TNJKV9W5XHLMv+GDO2Wy6UDnwGQtVWbsWYvo0A=
github.com/dubbogo/gost v1.11.19/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI=
github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU=
...
...
session.go
View file @
a2461f81
...
...
@@ -597,17 +597,12 @@ func (s *session) handleTCPPackage() error {
exit
bool
bufLen
int
pkgLen
int
bufp
*
[]
byte
buf
[]
byte
pktBuf
*
bytes
.
Buffer
pktBuf
*
gx
bytes
.
Buffer
pkg
interface
{}
)
// buf = make([]byte, maxReadBufLen)
bufp
=
gxbytes
.
GetBytes
(
maxReadBufLen
)
buf
=
*
bufp
pktBuf
=
new
(
bytes
.
Buffer
)
pktBuf
=
gxbytes
.
NewBuffer
(
nil
)
conn
=
s
.
Connection
.
(
*
gettyTCPConn
)
for
{
...
...
@@ -622,6 +617,7 @@ func (s *session) handleTCPPackage() error {
for
{
// for clause for the network timeout condition check
// s.conn.SetReadTimeout(time.Now().Add(s.rTimeout))
buf
=
pktBuf
.
WriteNextBegin
(
maxReadBufLen
)
bufLen
,
err
=
conn
.
recv
(
buf
)
if
err
!=
nil
{
if
netError
,
ok
=
perrors
.
Cause
(
err
)
.
(
net
.
Error
);
ok
&&
netError
.
Timeout
()
{
...
...
@@ -646,7 +642,7 @@ func (s *session) handleTCPPackage() error {
break
}
if
0
!=
bufLen
{
pktBuf
.
Write
(
buf
[
:
bufLen
]
)
pktBuf
.
Write
NextEnd
(
bufLen
)
for
{
if
pktBuf
.
Len
()
<=
0
{
break
...
...
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