diff options
author | Hafiz Abid Qadeer <abidh@codesourcery.com> | 2021-01-29 15:26:27 +0000 |
---|---|---|
committer | Hafiz Abid Qadeer <abidh@codesourcery.com> | 2021-01-29 15:26:27 +0000 |
commit | 9f78e94912f911d325302c115f47d9ddf8865b64 (patch) | |
tree | 1f4654ad3d0308080ef5a488d6c1fe35a0786487 /src/tcp_subr.c | |
parent | 5dce846e3ee82d93462bc637bb0db2fd49f0fc5a (diff) | |
download | slirp-9f78e94912f911d325302c115f47d9ddf8865b64.zip slirp-9f78e94912f911d325302c115f47d9ddf8865b64.tar.gz slirp-9f78e94912f911d325302c115f47d9ddf8865b64.tar.bz2 |
[PATCH] Fix a typo that can cause slow socket response on Windows.
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:
748f8f4 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 748f8f4 made similar change in tcp_fconnect but I have not touched it.
Signed-off-by: Hafiz Abid Qadeer <abidh@codesourcery.com>
Diffstat (limited to 'src/tcp_subr.c')
-rw-r--r-- | src/tcp_subr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tcp_subr.c b/src/tcp_subr.c index ca1fad8..b39381f 100644 --- a/src/tcp_subr.c +++ b/src/tcp_subr.c @@ -493,7 +493,7 @@ void tcp_connect(struct socket *inso) return; } slirp_set_nonblock(s); - so->slirp->cb->register_poll_fd(so->s, so->slirp->opaque); + so->slirp->cb->register_poll_fd(s, so->slirp->opaque); slirp_socket_set_fast_reuse(s); opt = 1; setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int)); |