16 Commits

Author SHA1 Message Date
deadbeef
824f586213 Fixing segfault caused by TurnServer.
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}
2016-08-24 22:06:58 +00:00
Taylor Brandstetter
734262c765 Fixing invalid operator< implementation.
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}
2016-08-01 23:37:21 +00:00
deadbeef
9794366ff0 Fixing memory leak in TurnServer.
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}
2016-07-12 18:04:57 +00:00
Taylor Brandstetter
716d07a241 Using fake clock for TURN port tests and un-disabling some tests.
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}
2016-06-27 21:07:51 +00:00
Taylor Brandstetter
ef184702f6 Allow receiving a packet on a TURN port from an unknown address.
This may occur if the TURN server allows the packet through due
to its policies around CreatePermission requirements, but the
candidate has not yet been signaled.

R=honghaiz@webrtc.org, pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2086203004 .

Cr-Commit-Position: refs/heads/master@{#13278}
2016-06-24 00:35:55 +00:00
Taylor Brandstetter
5d97a9a05b Adding more detail to MessageQueue::Dispatch logging.
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}
2016-06-10 21:17:33 +00:00
nisse
1bffc1d1a4 Rename rtc::Time64 --> rtc::TimeMillis.
In the discussion on https://codereview.webrtc.org/1888593004/, a more
decriptive name was suggested for Time64.

BUG=webrtc:5740

Review-Url: https://codereview.webrtc.org/1923213002
Cr-Commit-Position: refs/heads/master@{#12594}
2016-05-02 15:19:00 +00:00
jbauch
f1f87203d7 Split ByteBuffer into writer/reader objects.
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}
2016-03-30 13:43:44 +00:00
honghaiz
34b11eb66e Using 64-bit timestamp to replace the 32-bit one in webrtc/p2p.
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}
2016-03-16 15:55:48 +00:00
honghaiz
c463e20069 Reset TURN port NONCE when a new socket is created.
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}
2016-02-01 23:19:24 +00:00
deadbeef
376e1235c7 Destroy a Connection if a CreatePermission request fails.
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}
2015-11-25 17:00:12 +00:00
Peter Boström
0c4e06b4c6 Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.

BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org

Review URL: https://codereview.webrtc.org/1362503003 .

Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 10:23:32 +00:00
pthatcher@webrtc.org
0ba1533fdb Added support for an Origin header in STUN messages.
For WebRTC there are instances where it may be desirable to provide
information to the STUN/TURN server about the website that initiated
a peer connection. This modification allows an origin string to be
included in the MediaConstraints object provided by the browser, which
is then passed as a STUN header in communications with the server.
A separate change will be submitted to the Chromium project that
uses and is dependent on this change, implementing IETF draft
http://tools.ietf.org/html/draft-johnston-tram-stun-origin-02

Originally a patch from skobalt@gmail.com.

(https://webrtc-codereview.appspot.com/12839005/edit)

R=juberti@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/41409004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8035 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-10 00:47:02 +00:00
henrike@webrtc.org
269fb4bc90 move xmpp and p2p to webrtc
Create a copy of talk/xmpp and talk/p2p under webrtc/libjingle/xmpp and
webrtc/p2p. Also makes libjingle use those version instead of the one in the talk folder.

BUG=3379

Review URL: https://webrtc-codereview.appspot.com/26999004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7549 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-28 22:20:11 +00:00
henrike@webrtc.org
28100cb388 Reverts r7459 "Create a copy of talk/xmpp and talk/p2p under webrtc/libjingle/xmpp and webrtc/p2p."
BUG=N/A
TBR=niklas.enbom@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/29829004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7472 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-17 22:03:39 +00:00
henrike@webrtc.org
d1ba6d9cbf Create a copy of talk/xmpp and talk/p2p under webrtc/libjingle/xmpp and webrtc/p2p.
BUG=3379
R=niklas.enbom@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/27709005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7459 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-15 17:30:28 +00:00