[Bug 54287] Implement Stream Tubes over ICE-UDP

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Sep 3 15:55:30 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=54287

--- Comment #6 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-09-03 13:55:30 UTC ---
(In reply to comment #4)
> > +  len = GPOINTER_TO_UINT (g_hash_table_lookup (priv->length_for_buffers, li->data));
> > +  if (!gibber_transport_send (transport, (const guint8 *) li->data, len,
> > +      &error))
> 
> This list+hashtable is a really strange data-structure...

I think a better way to do buffer management would be:

* have a single GByteArray
* when asked to write a blob of data, append it to the GByteArray
  and then attempt to write (you never know, it might work)
* when the socket becomes writeable, attempt to write

where "attempt to write" means:

* write up to array->length bytes of array->data
  * if n >= 1 bytes are written, g_byte_array_remove_range (array, 0, n)
    and try again
  * if write fails with EINTR, try again
  * if write fails with EAGAIN or EWOULDBLOCK, go back to the main loop
  * if write fails with another error, close the connection

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.



More information about the telepathy-bugs mailing list