Git Product home page Git Product logo

libccnx-transport-rta's People

Contributors

isolis avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libccnx-transport-rta's Issues

Partial Message Body

In connector_Forwarder_Metis.c, the function _readPacket is responsible for consuming the available socket buffer to read 0 or more CCNx packets. The first if statement reads the header and then, optionally, the second statement continues and reads the body. The problem lies in the if (returnCode == ReturnCode_Finished) portion of the second statement.

static ReadReturnCode
_readPacket(FwdMetisState *fwd_state)
{
    ReadReturnCode returnCode = ReadReturnCode_PartialRead;

    // are we still reading the header?
    if (fwd_state->nextMessage.remainingReadLength > 0) {
        returnCode = _readPacketHeader(fwd_state);
    }

    // After reading the header, it may be possible to read the body too
    if (returnCode == ReadReturnCode_Finished && fwd_state->nextMessage.remainingReadLength == 0) {
        returnCode = _readPacketBody(fwd_state);
    }

    return returnCode;
}

Let's say we have a partial body read as a result of one call of this function from the parcEvent handler. On the next invocation of this function, due to data being available on the socket fd, we see the problem. fwd_state->nextMessage.remainingReadLength is 0 since the header has already been read and added to the packet buffer. The first if statement is not executed. This leaves the returnCode variable with a value of ReadReturnCode_PartialRead. Now, the second if statement will never be executed to complete the read of the packet body. We end up in an endless loop of parcEvent notifications (since the socket fd is available for reading), but no actual reads of the socket ever take place.

Use rpath

Let Libccnx-transport move around, use rpath

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.