• Show log

    Commit

  • Hash : ed045f09
    Author : Edward Thomson
    Date : 2020-06-01T19:10:38

    httpclient: read_body should return 0 at EOF
    
    When users call `git_http_client_read_body`, it should return 0 at the
    end of a message.  When the `on_message_complete` callback is called,
    this will set `client->state` to `DONE`.  In our read loop, we look for
    this condition and exit.
    
    Without this, when there is no data left except the end of message chunk
    (`0\r\n`) in the http stream, we would block by reading the three bytes
    off the stream but not making progress in any `on_body` callbacks.
    Listening to the `on_message_complete` callback allows us to stop trying
    to read from the socket when we've read the end of message chunk.