30 Commits

Author SHA1 Message Date
skvlad
c309e0e3ea Don't stop sending media on EWOULDBLOCK
This change makes WebRTC no longer stop sending video when we receive an
EWOULDBLOCK error from the operating system. This was previously
causing calls on a slow link (where the first hop is slow) to rapidly
oscillate between starting and stopping video.

We still do need to stop sending packets if there is no known good
connection we can use for that. We used to generate a synthetic
EWOULDBLOCK error in that case. This CL replaces it with a different
code (ENOTCONN); EWOULDBLOCK no longer stops the stream but ENOTCONN
does.

I've updated all the places where we seemed to be generating EWOULDBLOCK
for reasons other than some buffer been full; please give it a thorough
look in case I missed something.

R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13566}
2016-07-29 00:15:30 +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
zhihuang
5ecf16c072 Add Stats to Stun ping.
Add sent_ping_requests, recv_ping_responses to ConnectionInfo.
recv_ping_responses_ will be incremented when OnConnectionRequestResponse() is called.
ent_ping_requests_ will be incremented when OnConnectionRequestSent() is called.

BUG=webrtc:5695

Review-Url: https://codereview.webrtc.org/1940493002
Cr-Commit-Position: refs/heads/master@{#13001}
2016-06-02 00:09:24 +00:00
honghaiz
36f50e8e4e Create a new connection if a candidate reuses an address
If the remote side sends a candidate with the same address and port with an existing candidate,
but with a new ufrag and pwd, the local client will create a new connection from it
and destroy the old connection with the same remote address.

BUG=webrtc:5915

Review-Url: https://codereview.webrtc.org/2018693002
Cr-Commit-Position: refs/heads/master@{#13000}
2016-06-01 22:57:12 +00:00
tommi
5ce1a2a629 Reland of Allow the localhost IP address even if it does not match the tcp port address (patchset #1 id:1 of https://codereview.webrtc.org/1979463003/ )
Reason for revert:
Relanding this change since the revert didn't make a difference.

Original issue's description:
> Revert of Allow the localhost IP address even if it does not match the tcp port address (patchset #4 id:120001 of https://codereview.webrtc.org/1914803002/ )
>
> Reason for revert:
> Speculatively reverting due to failures on the memcheck bot (and possibly other bots):
>
> https://build.chromium.org/p/client.webrtc/builders/Linux%20Memcheck/builds/5910/steps/video_engine_tests/logs/EndToEndTest.SendsAndReceivesH264
>
> Original issue's description:
> > This fixes an issue similar to
> > https://bugs.chromium.org/p/webrtc/issues/detail?id=3927
> > where the localhost IP does not match the turn port address.
> > The issue here is in the TCP port.
> >
> > BUG=
> > R=pthatcher@webrtc.org
> >
> > Committed: https://crrev.com/6705012904e6cbbefce6fbce0a3f615b7aeafd8f
> > Cr-Commit-Position: refs/heads/master@{#12707}
>
> TBR=pthatcher@webrtc.org,deadbeef@webrtc.org,honghaiz@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=
>
> Committed: https://crrev.com/1cbf0a73eb4b475e8beb878ea3a4d650191f0c08
> Cr-Commit-Position: refs/heads/master@{#12728}

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

Review-Url: https://codereview.webrtc.org/1979073002
Cr-Commit-Position: refs/heads/master@{#12746}
2016-05-14 10:19:39 +00:00
tommi
1cbf0a73eb Revert of Allow the localhost IP address even if it does not match the tcp port address (patchset #4 id:120001 of https://codereview.webrtc.org/1914803002/ )
Reason for revert:
Speculatively reverting due to failures on the memcheck bot (and possibly other bots):

https://build.chromium.org/p/client.webrtc/builders/Linux%20Memcheck/builds/5910/steps/video_engine_tests/logs/EndToEndTest.SendsAndReceivesH264

Original issue's description:
> This fixes an issue similar to
> https://bugs.chromium.org/p/webrtc/issues/detail?id=3927
> where the localhost IP does not match the turn port address.
> The issue here is in the TCP port.
>
> BUG=
> R=pthatcher@webrtc.org
>
> Committed: https://crrev.com/6705012904e6cbbefce6fbce0a3f615b7aeafd8f
> Cr-Commit-Position: refs/heads/master@{#12707}

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

Review-Url: https://codereview.webrtc.org/1979463003
Cr-Commit-Position: refs/heads/master@{#12728}
2016-05-13 14:39:45 +00:00
Honghai Zhang
6705012904 This fixes an issue similar to
https://bugs.chromium.org/p/webrtc/issues/detail?id=3927
where the localhost IP does not match the turn port address.
The issue here is in the TCP port.

BUG=
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#12707}
2016-05-12 16:28:08 +00:00
kwiberg
1d50ee44fd Stop using some scoped_ptr features that unique_ptr doesn't have
No operator== that accepts one unique_ptr<T> and one T*. No implicit
conversion to bool. No rtc_make_scoped_ptr function.

BUG=webrtc:5520

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

Cr-Commit-Position: refs/heads/master@{#12048}
2016-03-18 05:54:49 +00:00
Stefan Holmer
2734d77c95 Remove assert which was incorrectly added to TcpPort::OnSentPacket.
TBR=pthatcher@webrtc.org

BUG=webrtc:4173

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

Cr-Commit-Position: refs/heads/master@{#11252}
2016-01-14 16:04:04 +00:00
Stefan Holmer
55674ffb32 Reland Connect TurnPort and TCPPort to AsyncPacketSocket::SignalSentPacket.
Chromium reported errors when building libjingle_nacl due to some methods used virtual instead of override when they were overriding the base class. My guess is that when one method starts using override, all other in the same class must too.

R=tommi@webrtc.org
TBR=pthatcher@webtrc.org

BUG=4173

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

Cr-Commit-Position: refs/heads/master@{#11251}
2016-01-14 14:49:23 +00:00
tommi
e5e0e57bdf Revert of Connect TurnPort and TCPPort to AsyncPacketSocket::SignalSentPacket. (patchset #3 id:40001 of https://codereview.webrtc.org/1577873003/ )
Reason for revert:
Broke Chrome:

https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_compile_dbg_ng/builds/143025/steps/compile%20%28with%20patch%29/logs/stdio

FAILED: cd ../../third_party/libjingle; python ../../native_client/build/build_nexe.py --root ../.. --product-dir ../../out/Debug/xyz --config-name Debug -t ../../native_client/toolchain/ --arch pnacl --build newlib_plib --name ../../out/Debug/gen/tc_pnacl_newlib/lib/libjingle_nacl.a --objdir ../../out/Debug/obj/third_party/libjingle/libjingle_nacl.gen/pnacl_newlib-pnacl/libjingle_nacl "--include-dirs=../../out/Debug/gen/tc_pnacl_newlib/include ../.. \"../../out/Debug/gen\" ./source ../ ../../native_client_sdk/src/libraries ../../native_client_sdk/src/libraries/nacl_io/include ../../native_client_sdk/src/libraries/third_party/newlib-extras ../expat/files/lib ../boringssl/src/include" "--compile_flags=-O2 -g -Wall -fdiagnostics-show-option -Werror  -Wno-unused-function -Wno-char-subscripts -Wno-c++11-extensions -Wno-unnamed-type-template-args -Wno-extra-semi -Wno-unused-private-field -Wno-char-subscripts -Wno-unused-function \"-std=gnu++11\" " --gomadir /b/build/goma "--defines=\"__STDC_LIMIT_MACROS=1\" \"__STDC_FORMAT_MACROS=1\" \"_GNU_SOURCE=1\" \"_POSIX_C_SOURCE=199506\" \"_XOPEN_SOURCE=600\" \"DYNAMIC_ANNOTATIONS_ENABLED=1\" \"DYNAMIC_ANNOTATIONS_PREFIX=NACL_\" \"NACL_BUILD_ARCH=x86\" V8_DEPRECATION_WARNINGS \"CLD_VERSION=2\" \"_FILE_OFFSET_BITS=64\" CHROMIUM_BUILD \"CR_CLANG_REVISION=255169-1\" COMPONENT_BUILD UI_COMPOSITOR_IMAGE_TRANSPORT \"USE_AURA=1\" \"USE_ASH=1\" \"USE_PANGO=1\" \"USE_CAIRO=1\" \"USE_DEFAULT_RENDER_THEME=1\" \"USE_LIBJPEG_TURBO=1\" \"USE_X11=1\" \"IMAGE_LOADER_EXTENSION=1\" \"ENABLE_WEBRTC=1\" \"ENABLE_MEDIA_ROUTER=1\" USE_PROPRIETARY_CODECS ENABLE_PEPPER_CDMS ENABLE_CONFIGURATION_POLICY ENABLE_NOTIFICATIONS \"ENABLE_HIDPI=1\" \"ENABLE_TOPCHROME_MD=1\" USE_UDEV DONT_EMBED_BUILD_METADATA \"DCHECK_ALWAYS_ON=1\" FIELDTRIAL_TESTING_ENABLED \"ENABLE_TASK_MANAGER=1\" \"ENABLE_EXTENSIONS=1\" \"ENABLE_PDF=1\" \"ENABLE_PLUGINS=1\" \"ENABLE_SESSION_SERVICE=1\" \"ENABLE_THEMES=1\" \"ENABLE_AUTOFILL_DIALOG=1\" \"ENABLE_BACKGROUND=1\" \"ENABLE_PRINTING=1\" \"ENABLE_PRINT_PREVIEW=1\" \"ENABLE_SPELLCHECK=1\" \"ENABLE_CAPTIVE_PORTAL_DETECTION=1\" \"ENABLE_APP_LIST=1\" \"ENABLE_SUPERVISED_USERS=1\" \"ENABLE_MDNS=1\" \"ENABLE_SERVICE_DISCOVERY=1\" V8_USE_EXTERNAL_STARTUP_DATA FULL_SAFE_BROWSING SAFE_BROWSING_CSD SAFE_BROWSING_DB_LOCAL EXPAT_RELATIVE_PATH FEATURE_ENABLE_SSL GTEST_RELATIVE_PATH HAVE_OPENSSL_SSL_H NO_MAIN_THREAD_WRAPPING NO_SOUND_SYSTEM WEBRTC_POSIX SRTP_RELATIVE_PATH SSL_USE_OPENSSL USE_WEBRTC_DEV_BRANCH \"timezone=_timezone\" XML_STATIC \"USE_LIBPCI=1\" \"USE_OPENSSL=1\" \"USE_OPENSSL_CERTS=1\"" "--link_flags=-B../../out/Debug/gen/tc_pnacl_newlib/lib  " "--source-list=../../out/gypfiles/third_party/libjingle/pnacl_newlib.libjingle_nacl.source_list.gypcmd"
In file included from ../webrtc/p2p/base/tcpport.cc:67:
../webrtc/p2p/base/tcpport.h:50:23: error: 'CreateConnection' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  virtual Connection* CreateConnection(const Candidate& address,
                      ^
../webrtc/p2p/base/portinterface.h:71:23: note: overridden virtual function is here
  virtual Connection* CreateConnection(
                      ^
In file included from ../webrtc/p2p/base/tcpport.cc:67:
../webrtc/p2p/base/tcpport.h:53:16: error: 'PrepareAddress' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  virtual void PrepareAddress();
               ^
../webrtc/p2p/base/portinterface.h:63:16: note: overridden virtual function is here
  virtual void PrepareAddress() = 0;
               ^

(etc)

Original issue's description:
> Connect TurnPort and TCPPort to AsyncPacketSocket::SignalSentPacket.
>
> To reduce the risk of future mistakes when connecting Ports, Port::OnSentPacket was made pure virtual to ensure that new implementations take care of it.
>
> BUG=4173
> R=pthatcher@webrtc.org
>
> Committed: https://crrev.com/7307952a5bf63311e5f9a2a90089a06177e42716
> Cr-Commit-Position: refs/heads/master@{#11247}

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

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

Cr-Commit-Position: refs/heads/master@{#11249}
2016-01-14 12:57:03 +00:00
Stefan Holmer
7307952a5b Connect TurnPort and TCPPort to AsyncPacketSocket::SignalSentPacket.
To reduce the risk of future mistakes when connecting Ports, Port::OnSentPacket was made pure virtual to ensure that new implementations take care of it.

BUG=4173
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11247}
2016-01-14 12:15:56 +00:00
Honghai Zhang
f9945b2d1a Only try to pair protocol matching candidates for creating connections.
If the local port and the remote candidate's protocols do not match,
do not even try to pair them.
This avoids printing out confusing logs like
"Attempt to change a remote candidate..." in p2ptransportchannel
when two remote candidates have the same port number but different
protocols.

BUG=
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#11034}
2015-12-15 20:20:22 +00:00
Guo-wei Shieh
310b093aa4 Fix active tcp port to 9
In tcp only call:
Tested with hangout.
Tested with firefox.

To test firefox, goto about:config, search for media.peerconnection.ice.tcp and turn it on.

Existing test case should be suffice to cover this.

R=juberti@google.com
TBR=jubert@webrtc.org
BUG=webrtc:3849

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

Cr-Commit-Position: refs/heads/master@{#10683}
2015-11-18 03:15:57 +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
Guo-wei Shieh
53eee43e78 Address the comment from 1367553002.
Remove duplication introduced by
https://codereview.webrtc.org/1367553002

BUG=webrtc:5030
TBR=juberti@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#10039}
2015-09-23 21:09:18 +00:00
Guo-wei Shieh
2e4b620471 TcpPort doesn't connect when calling gmail with non-proxied UDP disabled.
The same check has been made into turnport.cc but missed this place.

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

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

Cr-Commit-Position: refs/heads/master@{#10038}
2015-09-23 20:57:17 +00:00
Tim Psiaki
6304626268 Add a rate tracker that tracks rate over a given interval split up into buckets that accumulate unit counts for their portion of said interval and use this instead of the standard rate tracker so that the values of retrieved frame rate stats are completely independent of the polling rate.
BUG=
R=asapersson@webrtc.org, noahric@chromium.org, pbos@webrtc.org, pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9933}
2015-09-14 17:38:20 +00:00
Guo-wei Shieh
1eb87c7d94 TCPConnection can never be deteted if they fail to connect.
Since the TCPConnection has never been connected, they are not scheduled for ping hence will never be detected.

Also fix the case when reconnect fails, as it has become READABLE before, it also will not be deleted.

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

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

Cr-Commit-Position: refs/heads/master@{#9782}
2015-08-25 18:03:02 +00:00
Guo-wei Shieh
b594041ec8 TcpPort Reconnect should inform upper layer to start sending again.
During the reconnection phase, EWOULDBLOCK has been returned to upper layer which stops the sending of video stream.

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

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

Cr-Commit-Position: refs/heads/master@{#9767}
2015-08-24 18:58:07 +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
be508a1d36 Implement Tcp Reconnect for TCPPort.
UDP case should not be changed.

Active TCPConnection will initiate Reconnect after OnClose and when Send or Ping fails.
Passive TCPConnection will prune itself as usual as the active side will create a new connection.

The Reconnect could make P2PCT choose a different best_connection in the case where connectivities exist b/w more than 1 Network.

Also, to avoid upper layer triggers ice restart, the WRITE_TIMEOUT caused by the socket disconnection is delayed  to give the reconnect mechanism chance to kick in. The timeout event is only fired if the reconnect can't work in 5 sec. If the reconnect, there should be no ICE disconnected state trigger either in active or passive side.

BUG=1926
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8929}
2015-04-06 19:48:53 +00:00
guoweis@webrtc.org
930e004a81 Add jmi field for packets discarded due to network error
Also included the total packets attempted to send.

BUG=427555

Copied from https://webrtc-codereview.appspot.com/25959004/

R=harryjin@google.com, juberti@webrtc.org

Committed: https://code.google.com/p/webrtc/source/detail?r=7693

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7713 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-17 19:42:14 +00:00
henrike@webrtc.org
6a782c2a46 Revert 7693 "Add jmi field for packets discarded due to network error" breaks chromium's webrtc_cases.
TBR=guoweis@webrtc.org

BUG=N/A

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7706 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-14 22:33:13 +00:00
guoweis@webrtc.org
312614a438 Add jmi field for packets discarded due to network error
Also included the total packets attempted to send.

BUG=427555

Copied from https://webrtc-codereview.appspot.com/25959004/

R=harryjin@google.com, juberti@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7693 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-13 03:38:05 +00:00
henrike@webrtc.org
43e033e778 Change from talk/p2p (r7572): "Improve the logging when a TCP connection is deleted."
BUG=3379
R=jiayl@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7673 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-10 19:40:29 +00:00
pkasting@chromium.org
332331fb01 Use uint16s for port numbers in webrtc/p2p/base.
This is a necessary precursor to using uint16s for port numbers more
consistently in Chromium code.

This also makes some minor formatting changes in surrounding code (function declaration wrapping, virtual -> override).

BUG=chromium:81439
TEST=none
R=henrike@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7656 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-06 20:19:22 +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