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:
Axel Lin 2016-10-13 23:37:14 +08:00 committed by Dirk Ziegelmeier
parent f5f8ab5acf
commit 4dffe521a3

View File

@ -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",
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;
dontblock = netconn_is_nonblocking(conn) || (apiflags & NETCONN_DONTBLOCK);
#if LWIP_SO_SNDTIMEO
if ((conn->send_timeout != 0) &&
@ -1603,7 +1602,6 @@ err_mem:
err = out_err;
write_finished = 1;
conn->current_msg->msg.w.len = 0;
} else {
}
} else {
/* On errors != ERR_MEM, we don't try writing any more but return