[Pkg-telepathy-commits] [libnice] 209/265: pseudotcp: Also cause Writable callback to be emitted if can_send() says no

Simon McVittie smcv at debian.org
Wed May 14 12:05:09 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 b032107483eb86913033c4c53da7955e731715d2
Author: Olivier Crête <olivier.crete at collabora.com>
Date:   Tue Apr 8 22:43:30 2014 -0400

    pseudotcp: Also cause Writable callback to be emitted if can_send() says no
    
    The GOutputStream based systems can sometimes call this, decide the stream is
    not writable and then poll for it. We have to make sure that poll is woken up.
---
 agent/pseudotcp.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/agent/pseudotcp.c b/agent/pseudotcp.c
index 3444086..ba49c7a 100644
--- a/agent/pseudotcp.c
+++ b/agent/pseudotcp.c
@@ -1890,23 +1890,23 @@ pseudo_tcp_socket_get_available_bytes (PseudoTcpSocket *self)
 gboolean
 pseudo_tcp_socket_can_send (PseudoTcpSocket *self)
 {
-  PseudoTcpSocketPrivate *priv = self->priv;
-
-  if (priv->state != TCP_ESTABLISHED) {
-    return FALSE;
-  }
-
-  return (pseudo_tcp_fifo_get_write_remaining (&priv->sbuf) != 0);
+  return (pseudo_tcp_socket_get_available_send_space (self) > 0);
 }
 
 gsize
 pseudo_tcp_socket_get_available_send_space (PseudoTcpSocket *self)
 {
   PseudoTcpSocketPrivate *priv = self->priv;
+  gsize ret;
 
-  if (priv->state != TCP_ESTABLISHED) {
-    return 0;
-  }
 
-  return pseudo_tcp_fifo_get_write_remaining (&priv->sbuf);
+  if (priv->state == TCP_ESTABLISHED)
+    ret = pseudo_tcp_fifo_get_write_remaining (&priv->sbuf);
+  else
+    ret = 0;
+
+  if (ret == 0)
+    priv->bWriteEnable = TRUE;
+
+  return ret;
 }

-- 
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