[Pkg-telepathy-commits] [libnice] 52/265: tests: Close pseudosocket as soon as it's done sending
Simon McVittie
smcv at debian.org
Wed May 14 12:04:52 UTC 2014
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian
in repository libnice.
commit 5c3a9056eb7f2adaebeb3227126eef244135303f
Author: Olivier Crête <olivier.crete at collabora.com>
Date: Mon Jan 6 18:31:04 2014 -0500
tests: Close pseudosocket as soon as it's done sending
---
tests/test-pseudotcp.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/tests/test-pseudotcp.c b/tests/test-pseudotcp.c
index 48e4860..1d8da99 100644
--- a/tests/test-pseudotcp.c
+++ b/tests/test-pseudotcp.c
@@ -116,15 +116,13 @@ static void readable (PseudoTcpSocket *sock, gpointer data)
total_wrote += len;
g_debug ("Written %d bytes, need %d bytes", total_wrote, total_read);
- if (total_wrote >= total_read && feof (in)) {
- pseudo_tcp_socket_close (left, FALSE);
- pseudo_tcp_socket_close (right, FALSE);
+ if (total_wrote == total_read && feof (in)) {
+ pseudo_tcp_socket_close (sock, FALSE);
}
}
} else {
if (len == 26 && strncmp (buf, "abcdefghijklmnopqrstuvwxyz", len) == 0) {
- pseudo_tcp_socket_close (left, FALSE);
- pseudo_tcp_socket_close (right, FALSE);
+ pseudo_tcp_socket_close (sock, FALSE);
} else {
g_debug ("Error reading data.. read %d bytes : %s", len, buf);
exit (-1);
@@ -144,7 +142,7 @@ static void readable (PseudoTcpSocket *sock, gpointer data)
static void writable (PseudoTcpSocket *sock, gpointer data)
{
g_debug ("Socket %p Writable", sock);
- if (in)
+ if (in && sock == left)
write_to_sock (sock);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/libnice.git
More information about the Pkg-telepathy-commits
mailing list