54 Commits

Author SHA1 Message Date
deadbeef
9922016ee4 Fix "IsLoopbackIp" to cover all loopback addresses; not just 127.0.0.1.
The loopback range is 127.0.0.0/8, which is everything from 127.0.0.0 to
127.255.255.255.

BUG=chromium:649118

Review-Url: https://codereview.webrtc.org/2445933003
Cr-Commit-Position: refs/heads/master@{#14807}
2016-10-28 01:30:28 +00:00
deadbeef
fb70b45030 Preventing TURN redirects to loopback addresses.
This can be used for a certain security exploit, and doesn't have any
other practical applications we know of.

BUG=chromium:649118

Review-Url: https://codereview.webrtc.org/2440043004
Cr-Commit-Position: refs/heads/master@{#14751}
2016-10-24 20:16:07 +00:00
Honghai Zhang
d00c05788f Fix the turn and udp port type.
The port type was not set if it was created on a shared socket.

BUG=
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13313}
2016-06-28 16:44:55 +00:00
Taylor Brandstetter
6bb1ef2b86 Fixing bug where Connection drops packets when presumed writable.
The "should I simulate EWOULDBLOCK?" determination now happens
solely in P2PTransportChannel. This also fixes a bug where the
"last packet id" was set even if no packet was sent.

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

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

Cr-Commit-Position: refs/heads/master@{#13307}
2016-06-28 01:09:10 +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
Honghai Zhang
f4ae6dc763 Fix an issue in IPv6 support.
When creating connections on turn port, check whether the local and remote candidates have the same IP address family, instead of checking the address family of the local socket against the remote candidate.

BUG=5871
R=deadbeef@webrtc.org, pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13269}
2016-06-23 05:35:06 +00:00
honghaiz
079a7a197f Reland of Do not delete a connection in the turn port with permission error or refresh error. (patchset #1 id:1 of https://codereview.webrtc.org/2090833002/ )
Reason for revert:
The Webrtc waterfall indicates that this revert is not necessary.

Original issue's description:
> Revert of Do not delete a connection in the turn port with permission error or refresh error. (patchset #6 id:260001 of https://codereview.webrtc.org/2068263003/ )
>
> Reason for revert:
> It broke webrtc builds.
>
> Original issue's description:
> > Do not delete a connection in the turn port with permission error,  refresh error, or binding error.
> >
> > Even if those error happened, the connection may still be able to receive packets for a while.
> > If we delete the connections, all packets arriving will be dropped.
> >
> > BUG=webrtc:6007
> > R=deadbeef@webrtc.org, pthatcher@webrtc.org
> >
> > Committed: https://crrev.com/3d77deb29c15bfb8f794ef3413837a0ec0f0c131
> > Cr-Commit-Position: refs/heads/master@{#13262}
>
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:6007
>
> Committed: https://crrev.com/3159ffae6b1d5cba2ad972bd3d8074ac85f2c7f9
> Cr-Commit-Position: refs/heads/master@{#13265}

TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6007

Review-Url: https://codereview.webrtc.org/2090073003
Cr-Commit-Position: refs/heads/master@{#13266}
2016-06-22 23:27:08 +00:00
honghaiz
3159ffae6b Revert of Do not delete a connection in the turn port with permission error or refresh error. (patchset #6 id:260001 of https://codereview.webrtc.org/2068263003/ )
Reason for revert:
It broke webrtc builds.

Original issue's description:
> Do not delete a connection in the turn port with permission error,  refresh error, or binding error.
>
> Even if those error happened, the connection may still be able to receive packets for a while.
> If we delete the connections, all packets arriving will be dropped.
>
> BUG=webrtc:6007
> R=deadbeef@webrtc.org, pthatcher@webrtc.org
>
> Committed: https://crrev.com/3d77deb29c15bfb8f794ef3413837a0ec0f0c131
> Cr-Commit-Position: refs/heads/master@{#13262}

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6007

Review-Url: https://codereview.webrtc.org/2090833002
Cr-Commit-Position: refs/heads/master@{#13265}
2016-06-22 23:18:37 +00:00
Honghai Zhang
3d77deb29c Do not delete a connection in the turn port with permission error, refresh error, or binding error.
Even if those error happened, the connection may still be able to receive packets for a while.
If we delete the connections, all packets arriving will be dropped.

BUG=webrtc:6007
R=deadbeef@webrtc.org, pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13262}
2016-06-22 23:01: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
Sergey Ulanov
17fa67214c Fix AllocationSequence to handle the case when TurnPort stops using shared socket.
AllocationSequence is responsible for receiving incoming packets on
a shared UDP socket and passing them to the Port objects. TurnPort
may stop sharing UDP socket in which case it allocates a new socket.
AllocationSequence::OnReadPacket() wasn't handling that case properly
which was causing an assert in TurnPort::OnReadPacket().

BUG=webrtc:5757
R=honghaiz@webrtc.org, jiayl@chromium.org, pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12675}
2016-05-10 17:20:54 +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
kwiberg
3ec4679dd2 Replace scoped_ptr with unique_ptr in webrtc/p2p/
But keep #including scoped_ptr.h in .h files, so as not to break
WebRTC users who expect those .h files to give them rtc::scoped_ptr.

BUG=webrtc:5520

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

Cr-Commit-Position: refs/heads/master@{#12532}
2016-04-27 14:22:58 +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
kjellander
f475277547 Rename constants files in webrtc/{media,p2p}
Multiple sources with the same names forces ugly GYP hacks in
Chromium's libjingle.gyp. Rename the sources in WebRTC to
enable cleaning this up in Chromium.

To summarize:
webrtc/media/base/constants.{cc,h} -> mediaconstants.{cc,h}
webrtc/p2p/base/constants.{cc,h} -> p2pconstants.{cc,h}

This CL will require coordinating landing a roll in Chromium.

BUG=webrtc:4256
NOTRY=True

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

Cr-Commit-Position: refs/heads/master@{#11842}
2016-03-02 13:42:35 +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
honghaiz
9dfed79f3f Stop processing any incoming packets when turn port is disconnected.
If it still handle packets, when a ping arrives, it will pass the packet to p2ptransportchannel, eventually causing an ASSERT error there (when p2ptransportchannel tries to create a connection from the ping request from unknown address).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#11430}
2016-01-29 21:22:36 +00:00
Honghai Zhang
b6802749f1 Fix a flaky turnport test failure
The connection was deleted asynchronously, so need to use EXPECT_TRUE_WAIT.

BUG=
TBR=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11153}
2016-01-05 21:51:07 +00:00
honghaiz
6b9ab9204b Cease all future TURN requests when a TURN refresh request fails for a given TURN port.
This fixes an assert error in Turnport::OnSendStunPacket

BUG=webrtc:5388

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

Cr-Commit-Position: refs/heads/master@{#11152}
2016-01-05 17:06:20 +00:00
Taylor Brandstetter
e86e15b2a2 Increasing timeout for TestResolverShutdown.
getaddrinfo() seems to take longer than a second occasionally.

BUG=webrtc:5191
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11138}
2015-12-29 20:51:21 +00:00
Honghai Zhang
f67c548576 Handle Turn error response to RefreshRequest, CreatePermissionRequest, and ChanelBindRequest
BUG=webrtc:5116
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10994}
2015-12-11 23:16:58 +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
honghaiz
32f39968ce Re-apply change https://codereview.webrtc.org/1426673007/
Do not delete the turn port entry right away when the respective
connection is deleted. The dependency on asyncinvoker has been added
in chromium libjingle-nacl.

BUG=webrtc:5120

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

Cr-Commit-Position: refs/heads/master@{#10679}
2015-11-17 19:36:37 +00:00
tommi
54e92326af Revert of Do not delete the turn port entry right away when the respective connection is deleted. (patchset #5 id:260001 of https://codereview.webrtc.org/1426673007/ )
Reason for revert:
I have to revert this unfortunately because it adds a dependency on AsyncInvoker, which is not included when building libjingle_nacl in Chromium.
AsyncInvoker needs to first be added to the list of sources in Chromium.

Original issue's description:
> Do not delete the turn port entry right away when the respective connection is deleted.
> BUG=webrtc:5120
>
> Committed: https://crrev.com/e58fe8ef0e6d959f54adee3ed77764927d3845cc
> Cr-Commit-Position: refs/heads/master@{#10641}

TBR=pthatcher@webrtc.org,honghaiz@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5120

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

Cr-Commit-Position: refs/heads/master@{#10649}
2015-11-16 12:13:02 +00:00
honghaiz
e58fe8ef0e Do not delete the turn port entry right away when the respective connection is deleted.
BUG=webrtc:5120

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

Cr-Commit-Position: refs/heads/master@{#10641}
2015-11-14 01:54:47 +00:00
Honghai Zhang
8597543ae8 Schedule a CreatePermissionRequest after the success of a previous request
unless a channel binding request is already scheduled.

BUG=5178
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10625}
2015-11-12 19:07:25 +00:00
Peter Thatcher
04ac81f2fd Replace readable with receiving where receiving means receiving anything (stun ping, response or data packet).
BUG=4937
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10004}
2015-09-21 18:48:37 +00:00
tommi
275a2f16fd Revert of Replace readable with receiving where receiving means receiving anything (stun ping, response or da… (patchset #7 id:340001 of https://codereview.webrtc.org/1351673003/ )
Reason for revert:
Broke the Windows build:

[226/365] LINK_EMBED cc_perftests.exe
FAILED: ninja -t msvc -e environment.x86 -- E:\b\build\goma/gomacc "E:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\remoting\protocol\remoting_unittests.channel_socket_adapter_unittest.obj.rsp /c ..\..\remoting\protocol\channel_socket_adapter_unittest.cc /Foobj\remoting\protocol\remoting_unittests.channel_socket_adapter_unittest.obj /Fdobj\remoting\remoting_unittests.cc.pdb
e:\b\build\slave\win\build\src\remoting\protocol\channel_socket_adapter_unittest.cc(36) : error C3861: 'set_readable': identifier not found
ninja: build stopped: subcommand failed.

Original issue's description:
> Replace readable with receiving where receiving means receiving anything (stun ping, response or data packet).
> If a connection does not receive for 30 seconds, it will be deleted.
> BUG=
>
> Committed: https://crrev.com/ae16f8547d3b447f62f6660f13688585c6c3de15
> Cr-Commit-Position: refs/heads/master@{#10001}

TBR=pthatcher@webrtc.org,honghaiz@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#10002}
2015-09-21 14:20:43 +00:00
honghaiz
ae16f8547d Replace readable with receiving where receiving means receiving anything (stun ping, response or data packet).
If a connection does not receive for 30 seconds, it will be deleted.
BUG=

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

Cr-Commit-Position: refs/heads/master@{#10001}
2015-09-21 13:54:19 +00:00
Peter Thatcher
7cbd188c5e Remove GICE (again).
R=guoweis@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9979}
2015-09-18 01:55:03 +00:00
guoweis
d12140a68e Revert change which removes GICE.
There are still dependencies on this functionality.

TBR=pthatcher@webrtc.org

BUG=526399

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

Cr-Commit-Position: refs/heads/master@{#9920}
2015-09-10 20:32:21 +00:00
deadbeef
71cfe690b7 For TestResolverShutdown, use address that can't be resolved.
This test only currently works because stun.l.google.com has an IPv4
address and the TURN port is created with an IPv6 address. But the test
would start failing if/when it starts providing an IPv6 address. Which
may already be happening, as indicated by a recent test failure.

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

Cr-Commit-Position: refs/heads/master@{#9841}
2015-09-02 02:01:40 +00:00
Peter Thatcher
2159b89fa2 Reland "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becauese remoting code is using dead constants and breaks the FYI bots.
This reverts commit 5bdafd44c86ee46bd7e040f19828324583418b33.

Original CL: https://codereview.webrtc.org/1263663002/

R=guoweis@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9761}
2015-08-22 03:46:18 +00:00
guoweis
ea1012b2a4 address comments from https://codereview.webrtc.org/1277263002/
TBR=juberti@webrtc.org,pthather@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9757}
2015-08-21 16:06:37 +00:00
minyuel
5bdafd44c8 Revert "Reland "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becauese remoting code is using dead constants and breaks the FYI bots.""
This reverts commit 081f34b564e1a26ffbbe9515eba1fef7c736fdde.

Original code review see
https://codereview.webrtc.org/1291363005

The revert is due to a suspicion of "Reland "Remove GICE..." being the cause of failure on Linux memcheck, see
https://build.chromium.org/p/client.webrtc/builders/Linux%20Memcheck/builds/4137

TBR=pthatcher@webrtc.org,

BUG=

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

Cr-Commit-Position: refs/heads/master@{#9756}
2015-08-21 13:52:58 +00:00
Guo-wei Shieh
fe3bc9d5ae Relanding "Generate localhost candidate when no STUN/TURN and portallocator has the right flag spefied."
Migrated from https://codereview.webrtc.org/1275703006/ which causes test failures for android. On android, loopback interface was used as local interface to generate candidates. Add a test case to make sure this won't be broken in the future.

Also observed some failures under content_browsertests in chromium.fyi bot but can't repro locally. Might just be temporary test issue.

BUG=webrtc:4517
TBR=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9746}
2015-08-20 15:48:27 +00:00
Peter Thatcher
081f34b564 Reland "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becauese remoting code is using dead constants and breaks the FYI bots."
This reverts commit 475243a134be003aab30bb17294ca6c664d0ef81.

R=guoweis@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9738}
2015-08-20 03:37:59 +00:00
Guo-wei Shieh
3d564c1015 Add instrumentation to track the IceEndpointType.
The IceEndpointType has the format of <local_endpoint>_<remote_endpoint>. It is recorded on the BestConnection when we have the first OnTransportCompleted signaled.

BUG=webrtc:4918
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9737}
2015-08-19 23:51:22 +00:00
Guo-wei Shieh
370c8848ad Revert "Generate localhost candidate when no STUN/TURN and portallocator has the right flag spefied."
This reverts commit 0a2955f227666efd87b2a303a69c083ef801c528.

Revert "In the past, P2PPortAllocator.enable_multiple_routes is the indicator whether we should bind to the any address. It's easy to translate that into a port allocator flag in P2PPortAllocator's ctor. Going forward, we have to depend on an asynchronous permission check to determine whether gathering local address is allowed or not, hence the current way of passing it through constructor approach won't work any more. The asynchronous check will trigger SignalNetowrksChanged so we could only check that inside DoAllocate."

This reverts commit ba9ab4cd8d2e8fbc068dc36b5e6f6331d7deeccf.

TBR=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9729}
2015-08-19 00:00:21 +00:00
Guo-wei Shieh
0a2955f227 Generate localhost candidate when no STUN/TURN and portallocator has the right flag spefied.
BUG=webrtc:4517
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9726}
2015-08-18 20:05:29 +00:00
pthatcher
fa301809b6 Revert "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becauese remoting code is using dead constants and breaks the FYI bots.
This reverts commit 3449faa553ec94c52ef2d0949867befb60992c88.

TBR=deadbeef@webrtc.org, juberti@webrtc.org
NOPRESUBMIT=true

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

Cr-Commit-Position: refs/heads/master@{#9698}
2015-08-11 11:13:00 +00:00
Peter Thatcher
3449faa553 Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever).
R=deadbeef@webrtc.org, juberti@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9692}
2015-08-10 19:22:59 +00:00
honghaiz
b19eba3d4b Fix Turn TCP port issue.
Sometimes the port still try to send stun packet when the connection is disconnected,
causing an assertion error.

BUG=4859

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

Cr-Commit-Position: refs/heads/master@{#9671}
2015-08-03 17:23:40 +00:00
kwiberg@webrtc.org
eebcab5ce9 rtc::Buffer: Rename length to size, for conformance with the STL
And add a constructor for creating an uninitialized Buffer of a
specified size.

(I intend to follow up with more Buffer changes, but since it's rather
widely used, the rename is quite noisy and works better as a separate
CL.)

R=tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8841}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8841 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-24 09:20:19 +00:00
bjornv@webrtc.org
95a32ec098 Revert 8271 "VirtualSocketServer out-of-order issue with closing..."
Failed on Linux_Memcheck bot.
http://chromegw/i/client.webrtc/builders/Linux%20Memcheck/builds/3182

> VirtualSocketServer out-of-order issue with closing TCP sockets
> 
> https://webrtc-codereview.appspot.com/41449004 added a TURN TCP
> allocation release test which was disabled as it triggered an assert
> in the turnserver.
> 
> This was caused by VirtualSockerServer delivering the last TCP packet
> after closing the connection. Calling
>     VirtualSocketServer::SendTcp
> and
>     VirtualSocket::Close
> from TestTurnTCPReleaseAllocation led to the following order of
> messages in VirtualSocket::OnMessage:
>     MSG_ID_DISCONNECT
>     MSG_ID_PACKET
> 
> This is out of order and triggers an assert in turnserver.cc since the
> socket from which the message arrives has already been discarded,
> subsequently breaking the test.
> 
> In VirtualSocketServer::Disconnect the MSG_ID_DISCONNECT is posted to the
> msg_queue immediately, thus getting ahead of any (slightly delayed)
> actual packets.
> 
> Maybe PostAt(network_delay_ + 1, ...) would be better?
> 
> Re-enables TestTurnTCPReleaseAllocation.
> 
> BUG=
> R=juberti@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/34759004

TBR=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8280}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8280 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-07 06:47:21 +00:00
pthatcher@webrtc.org
4770437da9 VirtualSocketServer out-of-order issue with closing TCP sockets
https://webrtc-codereview.appspot.com/41449004 added a TURN TCP
allocation release test which was disabled as it triggered an assert
in the turnserver.

This was caused by VirtualSockerServer delivering the last TCP packet
after closing the connection. Calling
    VirtualSocketServer::SendTcp
and
    VirtualSocket::Close
from TestTurnTCPReleaseAllocation led to the following order of
messages in VirtualSocket::OnMessage:
    MSG_ID_DISCONNECT
    MSG_ID_PACKET

This is out of order and triggers an assert in turnserver.cc since the
socket from which the message arrives has already been discarded,
subsequently breaking the test.

In VirtualSocketServer::Disconnect the MSG_ID_DISCONNECT is posted to the
msg_queue immediately, thus getting ahead of any (slightly delayed)
actual packets.

Maybe PostAt(network_delay_ + 1, ...) would be better?

Re-enables TestTurnTCPReleaseAllocation.

BUG=
R=juberti@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8271}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8271 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-06 16:33:47 +00:00
pthatcher@webrtc.org
fe672e3839 release the turn allocation by sending a refresh request with lifetime 0
BUG=406578

Patch originally from philipp.hancke@googlemail.com

R=juberti@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8087 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-17 00:58:15 +00:00
guoweis@webrtc.org
19e4e8d751 Add support for trying alternate server (STUN 300 error message) on TCP
BUG=3774
R=juberti@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8036 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-10 02:41: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