You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From testing of my program, after YamuxStream tagging stream being unreadable in onFINReceived at this line, there may still be remaining data to be processed in onLengthRead.
So I think tagging stream being unreadable in onFINReceived is too early.
I have no better idea for now, so I just comment this line to workaround this issue.
The text was updated successfully, but these errors were encountered:
I would say that it is more like the stream acceptance callback is called too late.
I got the same issue during bitswap message receiving from a remote go-ipfs peer. The go-ipfs peers sends 3 frames:
frame.type DATA (0 '\0')
frame.length 248
frame.flags 0
frame.type WINDOW_UPDATE (1 '\x1')
frame.length 0
frame.flags 4
The last frame contains FIN flag that leads to onFINReceived call. Protocol handler is not called neither after the 1st frame nor after the second one. It is called when the last frame received, some response sent to the remote ipfs peer and Multiselect instance is closed. By that time the yamux stream has already been tagged as Unreadable.
I'm not sure what is a semantics of YamuxStream::isClosedForRead method but it looks like the size of pending data should be checked within the method also.
From testing of my program, after YamuxStream tagging stream being unreadable in onFINReceived at this line, there may still be remaining data to be processed in onLengthRead.
So I think tagging stream being unreadable in onFINReceived is too early.
I have no better idea for now, so I just comment this line to workaround this issue.
The text was updated successfully, but these errors were encountered: