mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-01 04:12:07 +00:00
fixed bug #49725 (send-timeout: netwonn_write() can return ERR_OK without all bytes being written)
This commit is contained in:
parent
6f1304e03e
commit
ca9342c549
@ -14,6 +14,10 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2016-11-28: Simon Goldschmidt
|
||||||
|
* api_lib.c: fixed bug #49725 (send-timeout: netwonn_write() can return
|
||||||
|
ERR_OK without all bytes being written)
|
||||||
|
|
||||||
2016-11-28: Ambroz Bizjak
|
2016-11-28: Ambroz Bizjak
|
||||||
* tcpi_in.c: fixed bug #49717 (window size in received SYN and SYN-ACK
|
* tcpi_in.c: fixed bug #49717 (window size in received SYN and SYN-ACK
|
||||||
assumed scaled)
|
assumed scaled)
|
||||||
|
@ -745,6 +745,11 @@ netconn_write_partly(struct netconn *conn, const void *dataptr, size_t size,
|
|||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
dontblock = netconn_is_nonblocking(conn) || (apiflags & NETCONN_DONTBLOCK);
|
dontblock = netconn_is_nonblocking(conn) || (apiflags & NETCONN_DONTBLOCK);
|
||||||
|
#if LWIP_SO_SNDTIMEO
|
||||||
|
if (conn->send_timeout != 0) {
|
||||||
|
dontblock = 1;
|
||||||
|
}
|
||||||
|
#endif /* LWIP_SO_SNDTIMEO */
|
||||||
if (dontblock && !bytes_written) {
|
if (dontblock && !bytes_written) {
|
||||||
/* This implies netconn_write() cannot be used for non-blocking send, since
|
/* This implies netconn_write() cannot be used for non-blocking send, since
|
||||||
it has no way to return the number of bytes written. */
|
it has no way to return the number of bytes written. */
|
||||||
@ -772,11 +777,7 @@ netconn_write_partly(struct netconn *conn, const void *dataptr, size_t size,
|
|||||||
non-blocking version here. */
|
non-blocking version here. */
|
||||||
err = netconn_apimsg(lwip_netconn_do_write, &API_MSG_VAR_REF(msg));
|
err = netconn_apimsg(lwip_netconn_do_write, &API_MSG_VAR_REF(msg));
|
||||||
if ((err == ERR_OK) && (bytes_written != NULL)) {
|
if ((err == ERR_OK) && (bytes_written != NULL)) {
|
||||||
if (dontblock
|
if (dontblock) {
|
||||||
#if LWIP_SO_SNDTIMEO
|
|
||||||
|| (conn->send_timeout != 0)
|
|
||||||
#endif /* LWIP_SO_SNDTIMEO */
|
|
||||||
) {
|
|
||||||
/* nonblocking write: maybe the data has been sent partly */
|
/* nonblocking write: maybe the data has been sent partly */
|
||||||
*bytes_written = API_MSG_VAR_REF(msg).msg.w.len;
|
*bytes_written = API_MSG_VAR_REF(msg).msg.w.len;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user