- 31 Jan, 2014 30 commits
-
-
Philip Withnall authored
If the Component’s I/O receiver machinery is invoked from a thread which can’t acquire the main context specified for the I/O callbacks, the callbacks need to be queued as idle handlers in that main context. This is needed for the case where blocking reads are being performed in one thread, with their callbacks needing to be delivered in another thread. This introduces a new fine-grained lock to Component: io_mutex. This protects accesses to Component->io_callback, Component->io_user_data and Component->pending_io_callbacks. If being locked at the same time as the main agent lock, it must always be locked afterwards, but the agent lock does not *have* to be held in order to lock io_mutex.
-
Philip Withnall authored
-
Philip Withnall authored
It was allocated separately and always set, which is a wasted allocation. Instead, pull the NiceAgent and Stream pointers into the Component directly, and eliminate the redundant allocation. This also means the NiceAgent and Stream are available for use elsewhere in the Component code (not just with TCP stuff).
-
Philip Withnall authored
Add ‘_locked’ to the name to clarify that it must be called with the agent’s lock already held.
-
Philip Withnall authored
…rather than gchar*. This differentiates binary buffers from strings a little better, although the two types are functionally equivalent. Also use gsize for buffer sizes, rather than guint.
-
Philip Withnall authored
Compartmentalise the handling of setting and clearing the user-provided per-Component I/O callbacks. Data flows from the socket, through nice_agent_g_source_cb(), to component_emit_io_callback() which calls the callback provided by the user when originally attaching to the stream/component.
-
Philip Withnall authored
This compartmentalises it a little more, reducing the spread of state-changing code from three files down to one. The key change is the switch from using two GSLists of NiceSockets and GSources in Component, to using a single GSList of a struct { NiceSocket, GSource }. This is possible because there is at most one GSource per NiceSocket. This change reduces memory overhead (from the GSList structures) slightly, and makes the relationship between sockets and sources much clearer.
-
Philip Withnall authored
Move all functionality which is unrelated to the GSource into _nice_agent_recv().
-
Philip Withnall authored
This is emitted when one or more streams are removed from the agent due to a call to nice_agent_remove_stream().
-
Philip Withnall authored
A g_usleep() was introduced in commit e22ecb19 to fix a potential race where the non-main threads would finish all their work before the error_loop was started, leaving the error_loop to run for 30s then abort the test. A better fix, instead of doing a racy sleep, is to have the non-main threads spin until the error_loop is running. GLib takes care of all the locking for us, and since we don’t care about efficiency for test cases, spinning is fine (the wait is also going to be quite short).
-
Philip Withnall authored
Add various compiler warnings to the different levels of --enable-compile-warnings. No particular scheme has been used to assign different warnings to different levels, other than that more critical ones are typically enabled at lower levels upwards. All code in libnice except the tests currently compiles with --enable-compile-warnings=error.
-
Philip Withnall authored
This appeases GCC’s -Wswitch-enum warning, and makes it more obvious that those enum cases have been explicitly considered, rather than just forgotten about. This introduces no functional changes.
-
Philip Withnall authored
This appeases GCC’s -Wswitch-enum warning, and makes it more obvious that those enum cases have been explicitly considered, rather than just forgotten about. This introduces no functional changes.
-
Philip Withnall authored
This appeases GCC’s -Wswitch-enum warning, and makes it more obvious that those enum cases have been explicitly considered, rather than just forgotten about. This introduces no functional changes.
-
Philip Withnall authored
GCC warns about this. Might as well prevent the warning.
-
Philip Withnall authored
This appeases GCC’s -Wswitch-enum warning, and makes it more obvious that those enum cases have been explicitly considered, rather than just forgotten about. This introduces no functional changes.
-
Philip Withnall authored
Casting from one struct sockaddr type to another breaks C’s strict aliasing rules (variables of different types cannot alias). Fix this cleanly by using unions of struct sockaddrs to convert between the types (i.e. type-punning). I wish sockaddr didn’t have to be this painful. See: http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Optimize-Options.html#Type_002dpunning
-
Olivier Crête authored
-
Philip Withnall authored
-
Olivier Crête authored
-
Olivier Crête authored
Syncs with libjingle SVN rev 77
-
Olivier Crête authored
-
Olivier Crête authored
-
Olivier Crête authored
-
Olivier Crête authored
-
Olivier Crête authored
This can only be called after we received a packet, where we already adjust the clock
-
Olivier Crête authored
-
Olivier Crête authored
Should improve receive performance a bit. Syncs with libjingle SVN rev 76
-
Olivier Crête authored
Syncs with libjingle SVN rev 56
-
Olivier Crête authored
Also document that fact.
-
- 27 Jan, 2014 1 commit
-
-
Philip Withnall authored
Add to the documentation to note that it can be called several times to set details for several relay servers during discovery.
-
- 07 Jan, 2014 2 commits
-
-
Philip Withnall authored
Do not unconditionally enable -Werror, since that breaks the build for people who have stricter compilation warnings enabled. Instead, add an --enable-compile-warnings configure flag which enables -Werror when passed as --enable-compile-warnings=error. This mimics the flag in gnome-common, for consistency. But we enable errors by default on non-released versions.
-
Livio Madaro authored
-
- 02 Jan, 2014 4 commits
-
-
Philip Withnall authored
This shuts a compiler warning up and allows for format string checking of debug messages.
-
Philip Withnall authored
This fix may not be entirely cross-platform, and I have been unable to test whether it is; making it cross-platform is made more difficult by the fact that the STUN code doesn’t use GLib. The PRIuPTR macro was defined in POSIX:2004, and later in C99. http://pubs.opengroup.org/onlinepubs/009696799/basedefs/inttypes.h.html
-
Philip Withnall authored
-
Philip Withnall authored
It gets automatically generated by autotools, so just gets in the way if checked into git.
-
- 27 Dec, 2013 1 commit
-
-
Olivier Crête authored
Older compilers don't understand all of the flags
-
- 24 Dec, 2013 2 commits
-
-
Olivier Crête authored
-
Olivier Crête authored
-