Unverified Commit c2739a68 authored by Nimrod Gilboa Markevich's avatar Nimrod Gilboa Markevich Committed by GitHub
Browse files

Don't stop dissecting long lasting HTTP connections after 10 seconds timeout (#720)

* Set HTTP as protocol after parsing of first message

* Remove unnecessary local variable dissected
parent d0ef6c9f
Showing with 5 additions and 6 deletions
+5 -6
......@@ -100,7 +100,6 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co
http2Assembler = createHTTP2Assembler(b)
}
dissected := false
switchingProtocolsHTTP2 := false
for {
if switchingProtocolsHTTP2 {
......@@ -121,7 +120,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co
} else if err != nil {
continue
}
dissected = true
superIdentifier.Protocol = &http11protocol
} else if isClient {
var req *http.Request
switchingProtocolsHTTP2, req, err = handleHTTP1ClientStream(b, tcpID, counterPair, superTimer, emitter, options)
......@@ -130,7 +129,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co
} else if err != nil {
continue
}
dissected = true
superIdentifier.Protocol = &http11protocol
// In case of an HTTP2 upgrade, duplicate the HTTP1 request into HTTP2 with stream ID 1
if switchingProtocolsHTTP2 {
......@@ -161,14 +160,14 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co
} else if err != nil {
continue
}
dissected = true
superIdentifier.Protocol = &http11protocol
}
}
if !dissected {
if superIdentifier.Protocol == nil {
return err
}
superIdentifier.Protocol = &http11protocol
return nil
}
......
Supports Markdown
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