From c76ded0c3560f86167aa02d5f2cab93fedd59e38 Mon Sep 17 00:00:00 2001 From: darkeye Date: Wed, 28 Aug 2002 18:24:46 +0000 Subject: [PATCH] ported to FreeBSD (removed reference to MSG_NOSIGNAL in TcpSocket.cpp) --- darkice/trunk/ChangeLog | 1 + darkice/trunk/TODO | 1 - darkice/trunk/configure.in | 19 +++++++++++++++++++ darkice/trunk/src/TcpSocket.cpp | 8 +++++++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/darkice/trunk/ChangeLog b/darkice/trunk/ChangeLog index 491740f..db56a59 100644 --- a/darkice/trunk/ChangeLog +++ b/darkice/trunk/ChangeLog @@ -1,5 +1,6 @@ DarkIce next release + o ported to FreeBSD (removed reference to MSG_NOSIGNAL in TcpSocket.cpp) o bug fix: maximum bitrate setting fixed for Ogg Vorbis streams 20-08-2002: DarkIce 0.11 released diff --git a/darkice/trunk/TODO b/darkice/trunk/TODO index 7ed10b3..8544fa9 100644 --- a/darkice/trunk/TODO +++ b/darkice/trunk/TODO @@ -10,4 +10,3 @@ o set comment fields for Ogg Vorbis streams as in http://www.xiph.org/ogg/vorbis/doc/v-comment.html o change config file to separate descriptions of input, streams and stream targets (servers, files, etc.) -o don't refer to MSG_NOSIGNAL in TcpSocket.cpp on FreeBSD diff --git a/darkice/trunk/configure.in b/darkice/trunk/configure.in index c2abdec..e6c7d24 100644 --- a/darkice/trunk/configure.in +++ b/darkice/trunk/configure.in @@ -102,11 +102,30 @@ else fi +dnl----------------------------------------------------------------------------- dnl make sure at least one of lame and vorbis present +dnl----------------------------------------------------------------------------- if test "x${LAME_LDFLAGS}" = "x" -a "x${VORBIS_LDFLAGS}" = "x" ; then AC_MSG_ERROR( [neither lame nor Ogg Vorbis configured]) fi +dnl----------------------------------------------------------------------------- +dnl check for MSG_NOSIGNAL for the send() function in libsocket +dnl----------------------------------------------------------------------------- +AC_MSG_CHECKING(for MSG_NOSIGNAL) +AC_TRY_COMPILE([#include ], [ + int f = MSG_NOSIGNAL; +], [ + # Yes, we have it... + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [use MSG_NOSIGNAL for send()]) +], [ + # We'll have to use signals + AC_MSG_RESULT(no) +]) + + + AC_OUTPUT(Makefile src/Makefile man/Makefile) diff --git a/darkice/trunk/src/TcpSocket.cpp b/darkice/trunk/src/TcpSocket.cpp index 619e93e..ac44fc3 100644 --- a/darkice/trunk/src/TcpSocket.cpp +++ b/darkice/trunk/src/TcpSocket.cpp @@ -312,8 +312,11 @@ TcpSocket :: write ( const void * buf, return 0; } -// ret = send( sockfd, buf, len, MSG_DONTWAIT); +#ifdef HAVE_MSG_NOSIGNAL ret = send( sockfd, buf, len, MSG_NOSIGNAL); +#else + ret = send( sockfd, buf, len, 0); +#endif if ( ret == -1 ) { if ( errno == EAGAIN ) { @@ -349,6 +352,9 @@ TcpSocket :: close ( void ) throw ( Exception ) $Source$ $Log$ + Revision 1.8 2002/08/28 18:24:46 darkeye + ported to FreeBSD (removed reference to MSG_NOSIGNAL in TcpSocket.cpp) + Revision 1.7 2002/07/20 16:37:06 darkeye added fault tolerance in case a server connection is dropped