[gnutls-devel] GnuTLS | Sockets: implement sendmsg()-like function on Win32 (!1377)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Tue Jan 26 08:00:07 CET 2021




Daiki Ueno commented on a discussion on lib/system/sockets.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1377#note_493858036

>  }
> +
> +ssize_t
> +system_writev(gnutls_transport_ptr_t ptr, const giovec_t * iovec,
> +	      int iovec_cnt)
> +{
> +	WSABUF bufs[iovec_cnt];
> +	DWORD bytes_sent;
> +	int to_send_cnt;
> +	size_t to_send_bytes = 0;
> +	bool ovrflwn = false;
> +
> +	for (to_send_cnt = 0; to_send_cnt < iovec_cnt && !ovrflwn;
> +			++to_send_cnt) {
> +		if (to_send_bytes + iovec[to_send_cnt].iov_len > SSIZE_MAX ||
> +				iovec[to_send_cnt].iov_len > SSIZE_MAX) {

By the way, given those limits (`SSIZE_MAX`, `ULONG_MAX`, etc) are known at compile time, could the `if`s be turned into preprocessor directives, like `#if SSIZE_MAX > ULONG_MAX ... #endif`?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1377#note_493858036
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20210126/17048aca/attachment-0001.html>


More information about the Gnutls-devel mailing list