Opened 8 years ago
Closed 8 years ago
#1424 closed defect (wontfix)
Not consistent type cast in ngx_unix_send()
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | other | Version: | 1.13.x |
| Keywords: | ngx_unix_send, ngx_unix_recv | Cc: | |
| uname -a: | |||
| nginx -V: | https://github.com/nginx/nginx/blob/master/src | ||
Description
Maybe their is a reason for this, but below are 2 functions.
The check to determine if all data is send/received is inconsistent.
See below:
os/unix/ngx_recv.c:
124: if ((size_t) n < size) {
137: if ((size_t) n < size
os/unix/ngx_send.c:
40: if (n < (ssize_t) size) {
Variables n is ssize_t and size of size_t.
Note:
See TracTickets
for help on using tickets.

There is no real difference. In all cases both
nandsizeare expected fit into bothsize_tandssize_t, it is up to the author of the particular code to choose how to write the condition.