Skip to content
  • Eric Blake's avatar
    e8ffaa31
    io: Add new qio_channel_read{, v}_all_eof functions · e8ffaa31
    Eric Blake authored
    
    
    Some callers want to distinguish between clean EOF (no bytes read)
    vs. a short read (at least one byte read, but EOF encountered
    before reaching the desired length), as it allows clients the
    ability to do a graceful shutdown when a server shuts down at
    defined safe points in the protocol, rather than treating all
    shutdown scenarios as an error due to EOF.  However, we don't want
    to require all callers to have to check for early EOF.  So add
    another wrapper function that can be used by the callers that care
    about the distinction.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20170905191114.5959-3-eblake@redhat.com>
    Acked-by: default avatarDaniel P. Berrange <berrange@redhat.com>
    e8ffaa31
    io: Add new qio_channel_read{, v}_all_eof functions
    Eric Blake authored
    
    
    Some callers want to distinguish between clean EOF (no bytes read)
    vs. a short read (at least one byte read, but EOF encountered
    before reaching the desired length), as it allows clients the
    ability to do a graceful shutdown when a server shuts down at
    defined safe points in the protocol, rather than treating all
    shutdown scenarios as an error due to EOF.  However, we don't want
    to require all callers to have to check for early EOF.  So add
    another wrapper function that can be used by the callers that care
    about the distinction.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20170905191114.5959-3-eblake@redhat.com>
    Acked-by: default avatarDaniel P. Berrange <berrange@redhat.com>
Loading