TURN server sockets were being destroyed asynchronously, which could
happen after the TurnServer itself (and even the VirtualSocketServer
used by the sockets) were destroyed.
This is fixed easily by using an AsyncInvoker (to ensure the async
operation doesn't occur after its initiator is destroyed), and keeping
the objects waiting for deletion in a unique_ptr vector.
Review-Url: https://codereview.webrtc.org/2264343002
Cr-Commit-Position: refs/heads/master@{#13907}
It was possible that "A < B" and "B < A" both evaluated to true.
This manifested as an assert on Windows, and a memory leak on Linux.
Note that the concept of "less than" is meaningless for this object.
The operator is only needed so the object can be used as a key in an
std::map.
BUG=webrtc:6068
R=honghaiz@webrtc.org, kjellander@webrtc.org, skvlad@webrtc.org
Review URL: https://codereview.webrtc.org/2187913002 .
Cr-Commit-Position: refs/heads/master@{#13598}
If the test TURN server received two allocate requests from the same
address, it was replacing the old allocation but not deleting it.
Also switching to std::unique_ptr to make it less likely for this to
pop up again.
Review-Url: https://codereview.webrtc.org/2114063002
Cr-Commit-Position: refs/heads/master@{#13449}
The fake clock has a few advantages:
1. It lets use verify that operations take the expected number of
round trips.
2. It makes the tests faster by letting us remove the equivalent
of "Sleep(500)" all over the tests.
3. It makes the tests less flaky, because sometimes sleeping for
500ms or waiting for 1s is not enough.
R=honghaiz@webrtc.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2097793003 .
Cr-Commit-Position: refs/heads/master@{#13304}
Every message will now be traced with the location from which it was
posted, including function name, file and line number.
This CL also writes a normal LOG message when the dispatch took more
than a certain amount of time (currently 50ms).
This logging should help us identify messages that are taking
longer than expected to be dispatched.
R=pthatcher@webrtc.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/2019423006 .
Cr-Commit-Position: refs/heads/master@{#13104}
This allows the reader to reference data, thus avoiding unnecessary
allocations and memory copies.
BUG=webrtc:5155,webrtc:5670
Review URL: https://codereview.webrtc.org/1821083002
Cr-Commit-Position: refs/heads/master@{#12160}
Also changed from unsigned to signed integer per the style guide.
By the way, I kept all delta-times to be 32-bit int.
The only things left in the p2p dir are
1. proberprober/main.cc where Time() is used as the input for a random number.
2. pseudotcp.cc: where 32-bit time info is sent over the wire.
BUG=webrtc:5636
Review URL: https://codereview.webrtc.org/1793553002
Cr-Commit-Position: refs/heads/master@{#12019}
For example, when the TURN port has an ALLOCATE_MISMATCH error.
BUG=webrtc:5432
Review URL: https://codereview.webrtc.org/1595613004
Cr-Commit-Position: refs/heads/master@{#11453}
This means that if a TURN server denies permission for an
unreachable address, we'll no longer ping it fruitlessly.
BUG=webrtc:4917
Review URL: https://codereview.webrtc.org/1415313004
Cr-Commit-Position: refs/heads/master@{#10789}