You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The status of C ::send and ::recv is read as an int, but if the buffer size is larger than that, it will deduce there is an error when there is not. In pseudo-code:
char*buf, longlong intsize;
intstatus= ::send(buf, size);
if (status<0)
report_error();
However, if size is larger than MAX_INT and this is successfully returned by ::send, status will be smaller than zero through casting.
I think its reasonable to assume that the input size should be an int, or that ::send will always return less than MAX_INT, but maybe an explicit comment about these assumptions would be good.
The text was updated successfully, but these errors were encountered:
The status of C ::send and ::recv is read as an int, but if the buffer size is larger than that, it will deduce there is an error when there is not. In pseudo-code:
However, if
size
is larger thanMAX_INT
and this is successfully returned by::send
,status
will be smaller than zero through casting.I think its reasonable to assume that the input
size
should be an int, or that::send
will always return less than MAX_INT, but maybe an explicit comment about these assumptions would be good.The text was updated successfully, but these errors were encountered: