]> granicus.if.org Git - transmission/commitdiff
better nat-pmp error logging. (this will very briefly break the mac build)
authorCharles Kerr <charles@transmissionbt.com>
Tue, 15 Jul 2008 03:26:53 +0000 (03:26 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Tue, 15 Jul 2008 03:26:53 +0000 (03:26 +0000)
libtransmission/natpmp.c
third-party/libnatpmp/Makefile.am

index c18cfe2a6aecc2dc66da25cc5d4fef015894e0b9..529f350783916605b561a754fa9403af3f3d0504 100644 (file)
@@ -21,6 +21,7 @@
 #include <arpa/inet.h> /* inet_ntoa */
 #endif
 
+#define ENABLE_STRNATPMPERR
 #include <libnatpmp/natpmp.h>
 
 #include "transmission.h"
@@ -69,7 +70,9 @@ logVal( const char * func, int ret )
     if( ret >= 0 )
         tr_ninf( getKey(), _( "%s succeeded (%d)" ), func, ret );
     else
-        tr_ndbg( getKey(), "%s failed (%d): %s (%d)", func, ret, tr_strerror(errno), errno );
+        tr_ndbg( getKey(), "%s failed.  natpmp returned %d (%s); errno is %d (%s)",
+                 func, ret, strnatpmperr(ret), errno, tr_strerror(errno) );
+
 }
 
 struct tr_natpmp*
index 3fca7d53c5082a8122299b7c68d10116d5187335..923ab169d691c127db6aec7d0c1dfab47e04568b 100644 (file)
@@ -1,5 +1,7 @@
 noinst_LIBRARIES = libnatpmp.a
 
+AM_CPPFLAGS = -DENABLE_STRNATPMPERR
+
 libnatpmp_a_SOURCES = \
     getgateway.c \
     natpmp.c