| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
To match debug_enable in agent/debug.c. Debug can still be enabled by
calling stun_debug_enable() or nice_debug_enable().
Spotted on the mailing list by Tom Chen.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As per [MS-TURN] Section 2.2.1, TURN message type 0x0104 "Send request
response" isn't supported and the TURN server MUST NOT send them. Thus,
libnice should not remember Send requests in agent->sent_ids because
without replies coming, the number of allowed pending transaction gets
quickly exhausted, causing our data packets to be dropped until a
request timeout frees some space in the queue.
This behavior resulted in choppy reception of our audio on a Lync client
when connected via Lync Edge (TURN) Server.
Maniphest Tasks: T126
Reviewers: pwithnall
Projects: #libnice
Reviewed By: pwithnall
Subscribers: pwithnall
Differential Revision: https://phabricator.freedesktop.org/D223
|
| |
|
|
|
|
| |
This fixes some compiler warnings.
|
|
|
|
| |
This remove a gcc warning
|
|
|
|
| |
As detected by GCC 4.9.
|
|
|
|
|
| |
NULL is ((gpointer) 0). nul is '\0'. Arrays can be NULL terminated.
Strings can be nul terminated.
|
|
|
|
|
|
|
| |
Dynamic on-stack arrays are not supported in Visual Studio.
This has the downside of introducing an extra memory allocation into
libstun, but it’s on a debug path so should be harmless.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Visual Studio 2010 still doesn’t support C99, and snprintf() is a C99
function, so compilation fails with:
error: C3861: 'snprintf': identifier not found
Use sprintf() instead, which is C89 and thus supported. This does not
make the code unsafe, as the format specifier is constrained to two
characters (+ trailing nul), which are guaranteed to fit in the array
bounds.
Reported on the mailing list:
http://lists.freedesktop.org/archives/nice/2014-October/000978.html
|
|
|
|
|
| |
This straightens out the last few bits of the documentation and almost
allows `make check` to pass in docs/.
|
|
|
|
|
|
|
|
|
| |
The symbol is not exported, but nevertheless leaks in the static version
of libnice, due to limitations on symbol visibilities with static
libraries. OpenSSL has a symbol named RAND_bytes(), which ours clashes
with if the two are linked together statically.
Avoid this by prefixing ours with ‘nice_’.
|
|
|
|
|
|
| |
Since dropping a STUN message due to having insufficient buffer space in
libstun can cause ICE negotiation to fail. So we want it to be more
obvious in the logs.
|
|
|
|
| |
ssize_t should definitely be signed, not unsigned.
|
|
|
|
|
|
| |
Send thing one line at a time, so no explicit \n
Also make it possible to set a log handler explicitly
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
The farstream unit tests were using it.
|
|
|
|
| |
be read
|
|
|
|
| |
libnice
|
| |
|
|
|
|
|
|
| |
MinGW defines size_t and ssize_t for us, so we should not
unconditionally redefine them in stun/win32_common.h. Add an
AC_CHECK_TYPES configure check to avoid this.
|
|
|
|
|
|
| |
Some platforms have a larger alignment requirement for struct sockaddr_* than
for plain struct sockaddr, in that case, we need to make sure that the incoming pointer
has the right alignement before taking it in.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
stun_message_validate_buffer_length() is already fast, but requires the
entire message to be in a single monolithic buffer. For introducing
vectored I/O, this becomes impossible to guarantee.
Rather than rewriting the STUN code to natively support vectors of
buffers (which would be a huge undertaking, and would probably slow
the code down considerably), implement a fast check of whether a message
is likely to be a STUN packet which *does* support vectored I/O. This
can then be used to determine whether to compact the vector of buffers
to a single monolithic one in order to validate the message more
thoroughly.
|
|
|
|
|
|
|
|
|
| |
Rather than using an intermediate method which takes a vector of
buffers, just use the SHA1 iteration functions directly in the HMAC
calculations. This eliminates several cases where the vector of buffers
was of fixed length, and it was actually taking more code to set up and
pass the vector than it would have to call the iteration functions
directly.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
GCC warns about this. Might as well prevent the warning.
|
| |
|
|
|
|
|
| |
This shuts a compiler warning up and allows for format string checking
of debug messages.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Older compilers don't understand all of the flags
|
| |
|
|
|
|
|
|
|
|
|
|
| |
div() has an aggregate return, which GCC doesn’t like, although this
seems like a pretty pointless warning because div_t is the same size as
a pointer on 64-bit platforms (probably) and hardly going to cause
performance problems by passing it by value.
Anyway, it seems easier to simplify the code by using explicit / and %
operators inline, than it does to add pragmas and shut the warning up.
|
|
|
|
|
|
|
|
|
|
|
|
| |
If stun_message_append_bytes() is called through
stun_message_append_flag(), data will be NULL and len will be 0. This
will result in a memcpy(ptr, NULL, 0) call. This probably won’t do any
harm (since any reasonable memcpy() implementation will immediately
return if (len == 0)), but the standard allows for memcpy() to explode
if (data == NULL), regardless of the value of len.
In order to be conformant, and to shut up the scan-build static analysis
warning about it, only do the memcpy() if (len > 0).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This shuts GCC’s -Wswitch-default warning, and makes the code flow a
little more explicit.
This introduces no functional changes.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
WSAStartup/WSACleanup on win32
|
| |
|
| |
|
| |
|
|
|
|
| |
platform
|
|
|
|
| |
stdint.h on WIN32 platform
|
| |
|