kazu-yamamoto / http2

HTTP/2.0 library including HPACK
BSD 3-Clause "New" or "Revised" License
86 stars 22 forks source link

duplicated contents in streaming #49

Closed kazu-yamamoto closed 1 year ago

kazu-yamamoto commented 1 year ago

cabal test sometime fails:

  test/HTTP2/ServerSpec.hs:39:9: 
  1) HTTP2.Server.server handles normal cases
       uncaught exception: IOException of type ResourceVanished
       Network.Socket.sendBuf: resource vanished (Broken pipe)
  1. The server sends ConnectionErrorIsSent ProtocolError 1768910346 "stream id should be odd.

  2. The client tries to send GOAWAY or somting and got Network.Socket.sendBuf: resource vanished (Broken pipe).

1768910346 comes from client3'' of repeated 't'. This means that the contents is parsed as an HTTP/2 header. tcpdump says that the contents is duplicated.

So, the streaming implementation has a bug.

We need to check 2., too.

Cc: @epoberezkin

epoberezkin commented 1 year ago

I do have an issue that on long leaving connections, that have multiple streaming requests with large bodies, at first the performance deteriorates and then it is stalled (client hangs on receiving response). I worked around this by re-setting connection on timeout errors, so it works for now - but it's interesting if it's related.