Skip to content

[PATCH] Fix a typo that can cause slow socket response on Windows.

abidh requested to merge abidh/libslirp:socket_delay into master

We observed slow responses on a host forwarded port on Windows. Investigation revealed that qemu_fd_register was being called with fd=-1 and this caused g_poll in qemu_poll_ns timing out. I tracked this behavior to following commit: 748f8f4b slirp: replace qemu_set_nonblock()

@@ -482,7 +483,8 @@ void tcp_connect(struct socket inso) tcp_close(sototcpcb(so)); / This will sofree() as well */ return; }

  • qemu_set_nonblock(s);
  • slirp_set_nonblock(s);
  • so->slirp->cb->register_poll_fd(so->s);

It seems that calling register_poll_fd with so->s instead of s may be a typo. Changing it back to s solves this issue. The commit 748f8f4b made similar change in tcp_fconnect but I have not touched it.

Signed-off-by: Hafiz Abid Qadeer abidh@codesourcery.com

Merge request reports