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
370af48b
Commit
370af48b
authored
Mar 13, 2018
by
AlexStocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set default CompressType for tcpconn
parent
450e6da2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
conn.go
conn.go
+4
-1
No files found.
conn.go
View file @
370af48b
...
...
@@ -247,6 +247,7 @@ func (t *gettyTCPConn) SetCompressType(c CompressType) {
default
:
panic
(
fmt
.
Sprintf
(
"illegal comparess type %d"
,
c
))
}
t
.
compress
=
c
}
// tcp connection read
...
...
@@ -257,7 +258,7 @@ func (t *gettyTCPConn) read(p []byte) (int, error) {
length
int
)
if
t
.
rTimeout
>
0
{
if
t
.
compress
==
CompressNone
&&
t
.
rTimeout
>
0
{
// Optimization: update read deadline only if more than 25%
// of the last read deadline exceeded.
// See https://github.com/golang/go/issues/15133 for details.
...
...
@@ -353,6 +354,7 @@ func newGettyWSConn(conn *websocket.Conn) *gettyWSConn {
wTimeout
:
netIOTimeout
,
local
:
localAddr
,
peer
:
peerAddr
,
compress
:
CompressNone
,
},
}
conn
.
EnableWriteCompression
(
false
)
...
...
@@ -372,6 +374,7 @@ func (w *gettyWSConn) SetCompressType(c CompressType) {
default
:
panic
(
fmt
.
Sprintf
(
"illegal comparess type %d"
,
c
))
}
w
.
compress
=
c
}
func
(
w
*
gettyWSConn
)
handlePing
(
message
string
)
error
{
...
...
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