Commit e56a1388 authored by alexstocks's avatar alexstocks

do not use SetReadDeadline/SetWriteDeadline refers to https://github.com/golang/go/issues/15133

parent a3b4d639
...@@ -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()
......
...@@ -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() {
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
package getty package getty
const ( const (
Version = "0.3.13" Version = "0.3.14"
GETTY_MAJOR = 0 GETTY_MAJOR = 0
GETTY_MINOR = 3 GETTY_MINOR = 3
GETTY_BUILD = 13 GETTY_BUILD = 14
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment