Giter Site home page Giter Site logo

Comments (2)

creativeid00 avatar creativeid00 commented on May 26, 2024

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:

  1. frame.type WINDOW_UPDATE (1 '\x1')
    frame.length 0
    frame.flags 1
  2. frame.type DATA (0 '\0')
    frame.length 248
    frame.flags 0
  3. 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.

from cpp-libp2p.

creativeid00 avatar creativeid00 commented on May 26, 2024

Detailed investigation has shown that YamuxStream::doRead returns corresponding error

return deferReadCallback(Error::STREAM_NOT_READABLE, std::move(read_cb_));
only when no pending data is available in the internal_read_buffer_.
if (bytes_available_now >= bytes || (some && bytes_available_now > 0)) {

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 cpp-libp2p.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.