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
e56a1388
Commit
e56a1388
authored
Oct 01, 2016
by
alexstocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not use SetReadDeadline/SetWriteDeadline refers to
https://github.com/golang/go/issues/15133
parent
a3b4d639
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
dev.list
dev.list
+6
-1
session.go
session.go
+2
-2
version.go
version.go
+2
-2
No files found.
dev.list
View file @
e56a1388
...
@@ -11,12 +11,17 @@
...
@@ -11,12 +11,17 @@
## develop history ##
## develop history ##
---
---
- 2016/10/01
> 1 remark SetReadDeadline & SetWriteDeadline in session.go (ref: https://github.com/golang/go/issues/15133)
>
> 3 version: 0.3.14
- 2016/09/30
- 2016/09/30
> 1 modify wheel time interval from 1 second to 100ms.
> 1 modify wheel time interval from 1 second to 100ms.
>
>
> 2 modify session.go:(Session)WritePkg timeout
> 2 modify session.go:(Session)WritePkg timeout
>
>
>
2
version: 0.3.13
>
3
version: 0.3.13
- 2016/09/27
- 2016/09/27
> 1 fix bug: getty panic when conn.RemoteAddr() is nil in session.go:(Session)sessionToken()
> 1 fix bug: getty panic when conn.RemoteAddr() is nil in session.go:(Session)sessionToken()
...
...
session.go
View file @
e56a1388
...
@@ -347,7 +347,7 @@ func (this *Session) WritePkg(pkg interface{}) error {
...
@@ -347,7 +347,7 @@ func (this *Session) WritePkg(pkg interface{}) error {
// for codecs
// for codecs
func
(
this
*
Session
)
WriteBytes
(
pkg
[]
byte
)
error
{
func
(
this
*
Session
)
WriteBytes
(
pkg
[]
byte
)
error
{
this
.
conn
.
SetWriteDeadline
(
time
.
Now
()
.
Add
(
this
.
wDeadline
))
//
this.conn.SetWriteDeadline(time.Now().Add(this.wDeadline))
_
,
err
:=
this
.
write
(
pkg
)
_
,
err
:=
this
.
write
(
pkg
)
return
err
return
err
}
}
...
@@ -504,7 +504,7 @@ func (this *Session) handlePackage() {
...
@@ -504,7 +504,7 @@ func (this *Session) handlePackage() {
bufLen
=
0
bufLen
=
0
for
{
// for clause for the network timeout condition check
for
{
// for clause for the network timeout condition check
this
.
conn
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
this
.
rDeadline
))
//
this.conn.SetReadDeadline(time.Now().Add(this.rDeadline))
bufLen
,
err
=
this
.
read
(
buf
)
bufLen
,
err
=
this
.
read
(
buf
)
if
err
!=
nil
{
if
err
!=
nil
{
if
nerr
,
ok
=
err
.
(
net
.
Error
);
ok
&&
nerr
.
Timeout
()
{
if
nerr
,
ok
=
err
.
(
net
.
Error
);
ok
&&
nerr
.
Timeout
()
{
...
...
version.go
View file @
e56a1388
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
package
getty
package
getty
const
(
const
(
Version
=
"0.3.1
3
"
Version
=
"0.3.1
4
"
GETTY_MAJOR
=
0
GETTY_MAJOR
=
0
GETTY_MINOR
=
3
GETTY_MINOR
=
3
GETTY_BUILD
=
1
3
GETTY_BUILD
=
1
4
)
)
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