mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
THRIFT-4984: Ignore EOF error in TSimpleServer ReadFrame call
EOF isn't an error that should be bubbled up to the
caller and we are already ignoring other EOF errors in
TSimpleServer.processRequest [0].
Client: go
This closes #1904.
[0]: cecee50308/lib/go/thrift/simple_server.go (L265-L266)
This commit is contained in:
parent
6e4c581fdd
commit
c03e2aa196
@ -20,6 +20,7 @@
|
||||
package thrift
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log"
|
||||
"runtime/debug"
|
||||
"sync"
|
||||
@ -231,7 +232,7 @@ func (p *TSimpleServer) processRequests(client TTransport) error {
|
||||
|
||||
defer func() {
|
||||
if e := recover(); e != nil {
|
||||
log.Printf("panic in processor: %s: %s", e, debug.Stack())
|
||||
log.Printf("panic in processor: %v: %s", e, debug.Stack())
|
||||
}
|
||||
}()
|
||||
|
||||
@ -255,9 +256,12 @@ func (p *TSimpleServer) processRequests(client TTransport) error {
|
||||
// won't break when it's called again later when we
|
||||
// actually start to read the message.
|
||||
if err := headerProtocol.ReadFrame(); err != nil {
|
||||
if err == io.EOF {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
ctx = AddReadTHeaderToContext(defaultCtx, headerProtocol.GetReadHeaders())
|
||||
ctx = AddReadTHeaderToContext(ctx, headerProtocol.GetReadHeaders())
|
||||
ctx = SetWriteHeaderList(ctx, p.forwardHeaders)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user