[Slirp] [Git][slirp/libslirp][master] 2 commits: [PATCH] Fix a typo that can cause slow socket response on Windows.

Samuel Thibault gitlab at gitlab.freedesktop.org
Fri Jan 29 21:49:19 UTC 2021



Samuel Thibault pushed to branch master at slirp / libslirp


Commits:
9f78e949 by Hafiz Abid Qadeer at 2021-01-29T15:26:27+00:00
[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 at codesourcery.com>

- - - - -
4284fc86 by Samuel Thibault at 2021-01-29T21:49:15+00:00
Merge branch 'socket_delay' into 'master'

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

See merge request slirp/libslirp!64
- - - - -


1 changed file:

- src/tcp_subr.c


Changes:

=====================================
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));



View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/5dce846e3ee82d93462bc637bb0db2fd49f0fc5a...4284fc86c23e5727bdb97bcce83fd36a4bfc13af

-- 
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/5dce846e3ee82d93462bc637bb0db2fd49f0fc5a...4284fc86c23e5727bdb97bcce83fd36a4bfc13af
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20210129/2da46bdf/attachment.htm>


More information about the Slirp mailing list