Skip to content
  • Sebastian Dröge's avatar
    Clamp number of vectors to IOV_MAX / UIO_MAXIOV for GOutputStream writev()... · 20a2c379
    Sebastian Dröge authored
    Clamp number of vectors to IOV_MAX / UIO_MAXIOV for GOutputStream writev() calls in the implementations
    
    More vectors will give an error and we can simply clamp here and
    consider it like a short write instead.
    
    In case of GSocketOutputStream this is done here instead of inside
    GSocket before calling sendmsg() because we we can't generically handle
    short writes when sending messages on a socket, e.g. for datagram
    sockets this causes only part of the datagram to be sent and an error
    would be more useful in this case than sending corrupted data.
    
    Also reduce the fallback limit to 16 in gsocket.c as that's the minimum
    value required by POSIX and add a static assertion that the limit is
    never bigger than G_MAXINT as that's the type recvmmsg/sendmmsg take.
    20a2c379