mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08:00
api_msg.c: Trivial code cleanup
Slightly improve readability by testing apiflags with NETCONN_DONTBLOCK. Also remove an empty else clause. Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
f5f8ab5acf
commit
4dffe521a3
@ -1511,9 +1511,8 @@ lwip_netconn_do_writemore(struct netconn *conn WRITE_DELAYED_PARAM)
|
|||||||
LWIP_ASSERT("conn->write_offset < conn->current_msg->msg.w.len",
|
LWIP_ASSERT("conn->write_offset < conn->current_msg->msg.w.len",
|
||||||
conn->write_offset < conn->current_msg->msg.w.len);
|
conn->write_offset < conn->current_msg->msg.w.len);
|
||||||
|
|
||||||
dontblock = netconn_is_nonblocking(conn) ||
|
|
||||||
(conn->current_msg->msg.w.apiflags & NETCONN_DONTBLOCK);
|
|
||||||
apiflags = conn->current_msg->msg.w.apiflags;
|
apiflags = conn->current_msg->msg.w.apiflags;
|
||||||
|
dontblock = netconn_is_nonblocking(conn) || (apiflags & NETCONN_DONTBLOCK);
|
||||||
|
|
||||||
#if LWIP_SO_SNDTIMEO
|
#if LWIP_SO_SNDTIMEO
|
||||||
if ((conn->send_timeout != 0) &&
|
if ((conn->send_timeout != 0) &&
|
||||||
@ -1603,7 +1602,6 @@ err_mem:
|
|||||||
err = out_err;
|
err = out_err;
|
||||||
write_finished = 1;
|
write_finished = 1;
|
||||||
conn->current_msg->msg.w.len = 0;
|
conn->current_msg->msg.w.len = 0;
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* On errors != ERR_MEM, we don't try writing any more but return
|
/* On errors != ERR_MEM, we don't try writing any more but return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user