Title: [226475] trunk/Source/ThirdParty/libwebrtc
Revision
226475
Author
[email protected]
Date
2018-01-05 17:19:30 -0800 (Fri, 05 Jan 2018)

Log Message

Close WebRTC sockets when marked as defunct
https://bugs.webkit.org/show_bug.cgi?id=177324
rdar://problem/35244931

Patch by Youenn Fablet <[email protected]> on 2018-01-05
Reviewed by Eric Carlson.

In case selected sockets return an error when trying to accept an incoming socket,
check whether the socket is defunct or not.
If so, close it properly.

* Source/webrtc/base/asynctcpsocket.cc:
* Source/webrtc/base/physicalsocketserver.cc:
* Source/webrtc/base/socket.h:

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (226474 => 226475)


--- trunk/Source/ThirdParty/libwebrtc/ChangeLog	2018-01-06 00:37:08 UTC (rev 226474)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog	2018-01-06 01:19:30 UTC (rev 226475)
@@ -1,3 +1,19 @@
+2018-01-05  Youenn Fablet  <[email protected]>
+
+        Close WebRTC sockets when marked as defunct
+        https://bugs.webkit.org/show_bug.cgi?id=177324
+        rdar://problem/35244931
+
+        Reviewed by Eric Carlson.
+
+        In case selected sockets return an error when trying to accept an incoming socket,
+        check whether the socket is defunct or not.
+        If so, close it properly.
+
+        * Source/webrtc/base/asynctcpsocket.cc:
+        * Source/webrtc/base/physicalsocketserver.cc:
+        * Source/webrtc/base/socket.h:
+
 2017-12-15  Dan Bernstein  <[email protected]>
 
         libwebrtc installs an extra copy of encoder_vcp.h under /usr/local/include

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/asynctcpsocket.cc (226474 => 226475)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/asynctcpsocket.cc	2018-01-06 00:37:08 UTC (rev 226474)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/asynctcpsocket.cc	2018-01-06 01:19:30 UTC (rev 226475)
@@ -191,6 +191,11 @@
       // TODO(stefan): Do something better like forwarding the error
       // to the user.
       LOG(LS_ERROR) << "TCP accept failed with error " << socket_->GetError();
+#if defined(WEBRTC_IOS)
+      int is_defunct = 0;
+      if (!socket->GetOption(Socket::OPT_ISDEFUNCT, &is_defunct) && is_defunct)
+        SignalClose(this, -1);
+#endif
       return;
     }
 

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/physicalsocketserver.cc (226474 => 226475)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/physicalsocketserver.cc	2018-01-06 00:37:08 UTC (rev 226474)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/physicalsocketserver.cc	2018-01-06 01:19:30 UTC (rev 226475)
@@ -568,6 +568,15 @@
       *sopt = IP_MTU_DISCOVER;
       break;
 #endif
+    case OPT_ISDEFUNCT:
+#if defined(SO_ISDEFUNCT)
+      *slevel = SOL_SOCKET;
+      *sopt = SO_ISDEFUNCT;
+      break;
+#else
+      return -1;
+#endif
+      break;
     case OPT_RCVBUF:
       *slevel = SOL_SOCKET;
       *sopt = SO_RCVBUF;

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/socket.h (226474 => 226475)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/socket.h	2018-01-06 00:37:08 UTC (rev 226474)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/socket.h	2018-01-06 01:19:30 UTC (rev 226475)
@@ -181,6 +181,7 @@
     OPT_RTP_SENDTIME_EXTN_ID,  // This is a non-traditional socket option param.
                                // This is specific to libjingle and will be used
                                // if SendTime option is needed at socket level.
+    OPT_ISDEFUNCT
   };
   virtual int GetOption(Option opt, int* value) = 0;
   virtual int SetOption(Option opt, int value) = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to