runtime: disable the Nagle algorithm entirely.

See also commit feed91d; that commit fixed the test_rpc_timing test,
but caused frequent hangs elsewhere, which were also caused by buggy
Nagle implementation. Just disable this entirely, as with our
explicit buffering it provides no benefit anyway.
This commit is contained in:
whitequark 2016-11-13 00:33:24 +00:00
parent feed91d8b2
commit 18c394976e
3 changed files with 6 additions and 0 deletions

View File

@ -149,6 +149,7 @@ extern {
// nonstandard
pub fn tcp_sndbuf_(pcb: *mut tcp_pcb) -> u16;
pub fn tcp_so_options_(pcb: *mut tcp_pcb) -> *mut u8;
pub fn tcp_nagle_disable_(pcb: *mut tcp_pcb);
pub fn udp_new() -> *mut udp_pcb;
pub fn udp_new_ip_type(type_: ip_addr_type) -> *mut udp_pcb;

View File

@ -549,6 +549,7 @@ impl TcpStream {
lwip_sys::tcp_recv(raw, Some(recv));
lwip_sys::tcp_sent(raw, Some(sent));
lwip_sys::tcp_err(raw, Some(err));
lwip_sys::tcp_nagle_disable_(raw);
TcpStream { raw: raw, state: state }
}
}

View File

@ -177,6 +177,10 @@ u8_t* tcp_so_options_(struct tcp_pcb *pcb) {
return &pcb->so_options;
}
void tcp_nagle_disable_(struct tcp_pcb *pcb) {
tcp_nagle_disable(pcb);
}
int main(void)
{
irq_setmask(0);