Browse Source

Remove setsockopt for SIGPIPE; disable SIGPIPE via signal() on non-WIN32

Palana 11 years ago
parent
commit
07ab8271b6
2 changed files with 6 additions and 2 deletions
  1. 6 0
      obs/obs-app.cpp
  2. 0 2
      plugins/obs-outputs/librtmp/rtmp.c

+ 6 - 0
obs/obs-app.cpp

@@ -31,6 +31,8 @@
 #ifdef _WIN32
 #include <fstream>
 #include <windows.h>
+#else
+#include <signal.h>
 #endif
 
 using namespace std;
@@ -217,6 +219,10 @@ struct NoFocusFrameStyle : QProxyStyle
 
 int main(int argc, char *argv[])
 {
+#ifndef WIN32
+	signal(SIGPIPE, SIG_IGN);
+#endif
+
 	int ret = -1;
 	QCoreApplication::addLibraryPath(".");
 #ifdef _WIN32

+ 0 - 2
plugins/obs-outputs/librtmp/rtmp.c

@@ -1220,8 +1220,6 @@ RTMP_Connect0(RTMP *r, struct sockaddr * service)
         }
     }
 
-    setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_NOSIGPIPE, (char *) &on, sizeof(on));
-
     if(!r->m_bUseNagle)
         setsockopt(r->m_sb.sb_socket, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on));