mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-01 04:12:07 +00:00
Correctly set TCP_WRITE_FLAG_MORE when netconn_write is split into multiple calls to tcp_write.
This commit is contained in:
parent
b6542b977e
commit
0b5d60db5e
@ -141,6 +141,10 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2010-03-05: Simon Goldschmidt
|
||||||
|
* api_msg.c: Correctly set TCP_WRITE_FLAG_MORE when netconn_write is split
|
||||||
|
into multiple calls to tcp_write.
|
||||||
|
|
||||||
2010-02-21: Simon Goldschmidt
|
2010-02-21: Simon Goldschmidt
|
||||||
* opt.h, mem.h, dns.c: task #10140: Remove DNS_USES_STATIC_BUF (keep
|
* opt.h, mem.h, dns.c: task #10140: Remove DNS_USES_STATIC_BUF (keep
|
||||||
the implementation of DNS_USES_STATIC_BUF==1)
|
the implementation of DNS_USES_STATIC_BUF==1)
|
||||||
|
@ -1142,6 +1142,7 @@ do_writemore(struct netconn *conn)
|
|||||||
size_t diff;
|
size_t diff;
|
||||||
u8_t dontblock = netconn_is_nonblocking(conn) ||
|
u8_t dontblock = netconn_is_nonblocking(conn) ||
|
||||||
(conn->current_msg->msg.w.apiflags & NETCONN_DONTBLOCK);
|
(conn->current_msg->msg.w.apiflags & NETCONN_DONTBLOCK);
|
||||||
|
u8_t apiflags = conn->current_msg->msg.w.apiflags;
|
||||||
|
|
||||||
LWIP_ASSERT("conn != NULL", conn != NULL);
|
LWIP_ASSERT("conn != NULL", conn != NULL);
|
||||||
LWIP_ASSERT("conn->state == NETCONN_WRITE", (conn->state == NETCONN_WRITE));
|
LWIP_ASSERT("conn->state == NETCONN_WRITE", (conn->state == NETCONN_WRITE));
|
||||||
@ -1157,6 +1158,7 @@ do_writemore(struct netconn *conn)
|
|||||||
#if LWIP_TCPIP_CORE_LOCKING
|
#if LWIP_TCPIP_CORE_LOCKING
|
||||||
conn->flags |= NETCONN_FLAG_WRITE_DELAYED;
|
conn->flags |= NETCONN_FLAG_WRITE_DELAYED;
|
||||||
#endif
|
#endif
|
||||||
|
apiflags |= TCP_WRITE_FLAG_MORE;
|
||||||
} else {
|
} else {
|
||||||
len = (u16_t)diff;
|
len = (u16_t)diff;
|
||||||
}
|
}
|
||||||
@ -1167,6 +1169,7 @@ do_writemore(struct netconn *conn)
|
|||||||
#if LWIP_TCPIP_CORE_LOCKING
|
#if LWIP_TCPIP_CORE_LOCKING
|
||||||
conn->flags |= NETCONN_FLAG_WRITE_DELAYED;
|
conn->flags |= NETCONN_FLAG_WRITE_DELAYED;
|
||||||
#endif
|
#endif
|
||||||
|
apiflags |= TCP_WRITE_FLAG_MORE;
|
||||||
}
|
}
|
||||||
if (dontblock && (len < conn->current_msg->msg.w.len)) {
|
if (dontblock && (len < conn->current_msg->msg.w.len)) {
|
||||||
/* failed to send all data at once -> nonblocking write not possible */
|
/* failed to send all data at once -> nonblocking write not possible */
|
||||||
@ -1174,7 +1177,7 @@ do_writemore(struct netconn *conn)
|
|||||||
}
|
}
|
||||||
if (err == ERR_OK) {
|
if (err == ERR_OK) {
|
||||||
LWIP_ASSERT("do_writemore: invalid length!", ((conn->write_offset + len) <= conn->current_msg->msg.w.len));
|
LWIP_ASSERT("do_writemore: invalid length!", ((conn->write_offset + len) <= conn->current_msg->msg.w.len));
|
||||||
err = tcp_write(conn->pcb.tcp, dataptr, len, conn->current_msg->msg.w.apiflags);
|
err = tcp_write(conn->pcb.tcp, dataptr, len, apiflags);
|
||||||
}
|
}
|
||||||
if (dontblock && (err == ERR_MEM)) {
|
if (dontblock && (err == ERR_MEM)) {
|
||||||
/* nonblocking write failed */
|
/* nonblocking write failed */
|
||||||
|
Loading…
Reference in New Issue
Block a user