OSX: uses SO_NOSIGPIPE instead of MSG_NOSIGNAL
authorJustin Dickow <jjdickow@gmail.com>
Thu, 20 Mar 2014 17:45:22 +0000 (13:45 -0400)
committerJustin Dickow <jjdickow@gmail.com>
Thu, 20 Mar 2014 17:45:22 +0000 (13:45 -0400)
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
SDL_Core/src/components/media_manager/src/socket_streamer_adapter.cc

index 30b90c7..65e823d 100644 (file)
@@ -289,15 +289,22 @@ bool SocketStreamerAdapter::Streamer::send(
                   "Server: SDL\r\n"
                   "Content-Type: video/mp4\r\n\r\n"
                  };
-
+#ifdef OS_MACOSX
+    if (-1 == ::send(new_socket_fd_, hdr, strlen(hdr), SO_NOSIGPIPE)) {
+#else
     if (-1 == ::send(new_socket_fd_, hdr, strlen(hdr), MSG_NOSIGNAL)) {
+#endif
       LOG4CXX_ERROR_EXT(logger, " Unable to send");
       return false;
     }
   }
-
+#ifdef OS_MACOSX
+  if (-1 == ::send(new_socket_fd_, (*msg).data(),
+                   (*msg).data_size(), SO_NOSIGPIPE)) {
+#else
   if (-1 == ::send(new_socket_fd_, (*msg).data(),
                    (*msg).data_size(), MSG_NOSIGNAL)) {
+#endif
     LOG4CXX_ERROR_EXT(logger, " Unable to send");
     return false;
   }