Skip to content

Clamp number of vectors to IOV_MAX / UIO_MAXIOV for GOutputStream writev()...

Sebastian Dröge requested to merge sdroege/glib:writev-max-num-vectors into master

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.

Merge request reports