Changes between Version 1 and Version 2 of BuildingTransmissionQtWindows/transmission-2.00-Qt-build.diff


Ignore:
Timestamp:
Jun 20, 2010, 9:27:41 PM (12 years ago)
Author:
rb07
Comment:

Updated patch (cleanup and fix to inet_pton)

Legend:

Unmodified
Added
Removed
Modified
  • BuildingTransmissionQtWindows/transmission-2.00-Qt-build.diff

    v1 v2  
    1 diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/configure transmission-2.00/configure
    2 --- transmission-2.00-orig/configure    2010-06-15 20:33:46.000000000 -0500
    3 +++ transmission-2.00/configure 2010-06-17 18:52:25.000000000 -0500
    4 @@ -19312,6 +19312,11 @@
    5    WIN32_FALSE=
    6  fi
    7  
    8 +case $host_os in
    9 +    mingw*)
    10 +            libevent_extra_libs+="-lws2_32"
    11 +    ;;
    12 +esac
    13  
    14  
    15  ac_config_files="$ac_config_files Makefile transmission.spec cli/Makefile daemon/Makefile doc/Makefile libtransmission/Makefile third-party/Makefile third-party/miniupnp/Makefile third-party/libnatpmp/Makefile third-party/dht/Makefile macosx/Makefile gtk/Makefile gtk/icons/Makefile web/Makefile web/images/Makefile web/images/buttons/Makefile web/images/graphics/Makefile web/images/progress/Makefile web/javascript/Makefile web/javascript/jquery/Makefile web/stylesheets/Makefile po/Makefile.in"
    161diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/JSON_parser.h transmission-2.00/libtransmission/JSON_parser.h
    172--- transmission-2.00-orig/libtransmission/JSON_parser.h        2010-06-15 20:32:58.000000000 -0500
     
    2611 #              define JSON_PARSER_DLL_API __declspec(dllexport)
    2712 #      else
    28 diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/Makefile.in transmission-2.00/libtransmission/Makefile.in
    29 --- transmission-2.00-orig/libtransmission/Makefile.in  2010-06-15 20:33:47.000000000 -0500
    30 +++ transmission-2.00/libtransmission/Makefile.in       2010-06-17 18:52:25.000000000 -0500
    31 @@ -88,7 +88,7 @@
    32  bencode_test_OBJECTS = $(am_bencode_test_OBJECTS)
    33  am__DEPENDENCIES_1 = ./libtransmission.a \
    34         $(top_builddir)/third-party/miniupnp/libminiupnp.a \
    35 -       $(top_builddir)/third-party/libnatpmp/libnatpmp.a
    36 +       $(top_builddir)/third-party/libnatpmp/libnatpmp.a
    37  bencode_test_DEPENDENCIES = $(am__DEPENDENCIES_1)
    38  AM_V_lt = $(am__v_lt_$(V))
    39  am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
    40 @@ -501,6 +501,7 @@
     13diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/Makefile.am transmission-2.00/libtransmission/Makefile.am
     14--- transmission-2.00-orig/libtransmission/Makefile.am  2010-06-15 20:32:58.000000000 -0500
     15+++ transmission-2.00/libtransmission/Makefile.am       2010-06-18 20:39:57.000000000 -0500
     16@@ -136,6 +136,7 @@
    4117     ./libtransmission.a  \
    4218     $(top_builddir)/third-party/miniupnp/libminiupnp.a \
     
    4622     @DHT_LIBS@ \
    4723     @LIBCURL_LIBS@ \
    48 diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/announcer.c transmission-2.00/libtransmission/announcer.c
    49 --- transmission-2.00-orig/libtransmission/announcer.c  2010-06-15 20:32:58.000000000 -0500
    50 +++ transmission-2.00/libtransmission/announcer.c       2010-06-17 18:52:25.000000000 -0500
    51 @@ -1407,7 +1407,7 @@
    52              /* %1$ld - http status code, such as 404
    53               * %2$s - human-readable explanation of the http status code */
    54              char * buf = tr_strdup_printf(
    55 -                _( "tracker gave HTTP Response Code %1$ld (%2$s)" ),
    56 +                _( "tracker gave HTTP Response Code %ld (%s)" ),
    57                  responseCode,
    58                  tr_webGetResponseStr( responseCode ) );
    59  
    60 @@ -1733,7 +1733,7 @@
    61                                                 tier->lastScrapeStr, sizeof( tier->lastScrapeStr ) );
    62              else
    63                  tr_snprintf( tier->lastScrapeStr, sizeof( tier->lastScrapeStr ),
    64 -                             _( "tracker gave HTTP Response Code %1$ld (%2$s)" ),
    65 +                             _( "tracker gave HTTP Response Code %ld (%s)" ),
    66                               responseCode, tr_webGetResponseStr( responseCode ) );
    67              tr_tordbg( tier->tor, "%s", tier->lastScrapeStr );
    68          }
    69 @@ -1764,7 +1764,7 @@
    70                              sizeof( tier->lastScrapeStr ) );
    71              else
    72                  tr_snprintf( tier->lastScrapeStr, sizeof( tier->lastScrapeStr ),
    73 -                             _( "tracker gave HTTP Response Code %1$ld (%2$s)" ),
    74 +                             _( "tracker gave HTTP Response Code %ld (%s)" ),
    75                               responseCode, tr_webGetResponseStr( responseCode ) );
    76          }
    77  
    7824diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/bencode.c transmission-2.00/libtransmission/bencode.c
    7925--- transmission-2.00-orig/libtransmission/bencode.c    2010-06-15 20:32:58.000000000 -0500
    80 +++ transmission-2.00/libtransmission/bencode.c 2010-06-17 18:52:25.000000000 -0500
    81 @@ -17,6 +17,11 @@
     26+++ transmission-2.00/libtransmission/bencode.c 2010-06-18 20:58:51.000000000 -0500
     27@@ -17,6 +17,10 @@
    8228 #include <stdio.h>
    8329 #include <stdlib.h> /* realpath() */
     
    8632+ #include <fcntl.h>
    8733+ #define fsync         _commit
    88 + static char *realpath();
    8934+#endif
    9035 
    9136 #include <sys/types.h> /* stat() */
    9237 #include <sys/stat.h> /* stat() */
    93 @@ -1629,7 +1634,12 @@
     38@@ -1625,11 +1629,16 @@
     39 
     40     /* follow symlinks to find the "real" file, to make sure the temporary
     41      * we build with mkstemp() is created on the right partition */
     42-    if( realpath( filename, buf ) != NULL )
     43+    if( tr_realpath( filename, buf ) != NULL )
    9444         filename = buf;
    9545 
     
    10454     if( fd >= 0 )
    10555     {
    106 @@ -1653,21 +1663,21 @@
    107                  else
    108                  {
    109                      err = errno;
    110 -                    tr_err( _( "Couldn't save file \"%1$s\": %2$s" ), filename, tr_strerror( err ) );
    111 +                    tr_err( _( "Couldn't save file \"%s\": %s" ), filename, tr_strerror( err ) );
    112                      unlink( tmp );
    113                  }
    114              }
    115              else
    116              {
    117                  err = errno;
    118 -                tr_err( _( "Couldn't save file \"%1$s\": %2$s" ), filename, tr_strerror( err ) );
    119 +                tr_err( _( "Couldn't save file \"%s\": %s" ), filename, tr_strerror( err ) );
    120                  unlink( tmp );
    121              }
    122          }
    123          else
    124          {
    125              err = errno;
    126 -            tr_err( _( "Couldn't save temporary file \"%1$s\": %2$s" ), tmp, tr_strerror( err ) );
    127 +            tr_err( _( "Couldn't save temporary file \"%s\": %s" ), tmp, tr_strerror( err ) );
    128              close( fd );
    129              unlink( tmp );
    130          }
    131 @@ -1677,7 +1687,7 @@
    132      else
    133      {
    134          err = errno;
    135 -        tr_err( _( "Couldn't save temporary file \"%1$s\": %2$s" ), tmp, tr_strerror( err ) );
    136 +        tr_err( _( "Couldn't save temporary file \"%s\": %s" ), tmp, tr_strerror( err ) );
    137      }
    138  
    139      tr_free( tmp );
    140 @@ -1710,3 +1720,16 @@
     56@@ -1710,3 +1719,4 @@
    14157     tr_free( content );
    14258     return err;
    14359 }
    14460+
    145 +#ifdef WIN32
    146 +/* From a message to the Mingw-msys list, circa Jun 2, 2005
    147 + * by Mark Junker.
    148 + */
    149 +static
    150 +char *realpath(const char *path, char *resolved_path)
    151 +{
    152 +    if (GetFullPathNameA(path, TR_PATH_MAX, resolved_path, NULL) == 0)
    153 +        return NULL;
    154 +    return resolved_path;
    155 +}
    156 +#endif
    15761diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/blocklist.c transmission-2.00/libtransmission/blocklist.c
    15862--- transmission-2.00-orig/libtransmission/blocklist.c  2010-06-15 20:32:58.000000000 -0500
    159 +++ transmission-2.00/libtransmission/blocklist.c       2010-06-17 19:08:58.000000000 -0500
    160 @@ -73,14 +73,14 @@
    161  {
    162      int          fd;
    163      struct stat  st;
    164 -    const char * err_fmt = _( "Couldn't read \"%1$s\": %2$s" );
    165 +    const char * err_fmt = _( "Couldn't read \"%s\": %s" );
    166  
    167      blocklistClose( b );
    168  
     63+++ transmission-2.00/libtransmission/blocklist.c       2010-06-19 18:15:49.000000000 -0500
     64@@ -15,6 +15,8 @@
     65 #include <string.h>
     66 
     67 #ifdef WIN32
     68+ #include <w32api.h>
     69+ #define WINVER  WindowsXP
     70  #include <windows.h>
     71 #endif
     72 
     73@@ -80,7 +82,7 @@
    16974     if( stat( b->filename, &st ) == -1 )
    17075         return;
     
    17580     {
    17681         tr_err( err_fmt, b->filename, tr_strerror( errno ) );
    177 @@ -105,7 +105,7 @@
     82@@ -105,7 +107,11 @@
    17883 
    17984     {
    18085         char * base = tr_basename( b->filename );
    181 -        tr_inf( _( "Blocklist \"%s\" contains %'zu entries" ), base, b->ruleCount );
     86+#ifndef WIN32
     87         tr_inf( _( "Blocklist \"%s\" contains %'zu entries" ), base, b->ruleCount );
     88+#else
    18289+        tr_inf( _( "Blocklist \"%s\" contains %zu entries" ), base, b->ruleCount );
     90+#endif
    18391         tr_free( base );
    18492     }
    18593 }
    186 @@ -307,7 +307,7 @@
    187      int inCount = 0;
    188      int outCount = 0;
    189      char line[2048];
    190 -    const char * err_fmt = _( "Couldn't read \"%1$s\": %2$s" );
    191 +    const char * err_fmt = _( "Couldn't read \"%s\": %s" );
    192  
    193      if( !filename )
    194      {
    195 @@ -315,7 +315,7 @@
     94@@ -315,7 +321,7 @@
    19695         return 0;
    19796     }
     
    202101     {
    203102         tr_err( err_fmt, filename, tr_strerror( errno ) );
    204 @@ -352,7 +352,7 @@
    205  
    206          if( fwrite( &range, sizeof( struct tr_ip_range ), 1, out ) != 1 )
    207          {
    208 -            tr_err( _( "Couldn't save file \"%1$s\": %2$s" ), b->filename,
    209 +            tr_err( _( "Couldn't save file \"%s\": %s" ), b->filename,
    210                     tr_strerror( errno ) );
    211              break;
    212          }
    213 @@ -362,7 +362,7 @@
     103@@ -362,7 +368,11 @@
    214104 
    215105     {
    216106         char * base = tr_basename( b->filename );
    217107-        tr_inf( _( "Blocklist \"%1$s\" updated with %2$'d entries" ), base, outCount );
     108+#ifndef WIN32
     109+        tr_inf( _( "Blocklist \"%s\" updated with %'d entries" ), base, outCount );
     110+#else
    218111+        tr_inf( _( "Blocklist \"%s\" updated with %d entries" ), base, outCount );
     112+#endif
    219113         tr_free( base );
    220114     }
     
    222116diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/fdlimit.c transmission-2.00/libtransmission/fdlimit.c
    223117--- transmission-2.00-orig/libtransmission/fdlimit.c    2010-06-15 20:32:58.000000000 -0500
    224 +++ transmission-2.00/libtransmission/fdlimit.c 2010-06-17 18:52:25.000000000 -0500
     118+++ transmission-2.00/libtransmission/fdlimit.c 2010-06-18 21:10:11.000000000 -0500
    225119@@ -125,7 +125,7 @@
    226120 
     
    232126     {
    233127         LARGE_INTEGER li;
    234 @@ -338,7 +338,7 @@
    235          char * dir = tr_dirname( filename );
    236          const int err = tr_mkdirp( dir, 0777 ) ? errno : 0;
    237          if( err ) {
    238 -            tr_err( _( "Couldn't create \"%1$s\": %2$s" ), dir, tr_strerror( err ) );
    239 +            tr_err( _( "Couldn't create \"%s\": %s" ), dir, tr_strerror( err ) );
    240              tr_free( dir );
    241              return err;
    242          }
    243 @@ -366,7 +366,7 @@
    244      if( file->fd == -1 )
    245      {
    246          const int err = errno;
    247 -        tr_err( _( "Couldn't open \"%1$s\": %2$s" ), filename, tr_strerror( err ) );
    248 +        tr_err( _( "Couldn't open \"%s\": %s" ), filename, tr_strerror( err ) );
    249          return err;
    250      }
    251  
    252128diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/handshake.c transmission-2.00/libtransmission/handshake.c
    253129--- transmission-2.00-orig/libtransmission/handshake.c  2010-06-15 20:32:58.000000000 -0500
     
    262138 
    263139 static uint32_t
    264 diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/metainfo.c transmission-2.00/libtransmission/metainfo.c
    265 --- transmission-2.00-orig/libtransmission/metainfo.c   2010-06-15 20:32:58.000000000 -0500
    266 +++ transmission-2.00/libtransmission/metainfo.c        2010-06-17 18:52:25.000000000 -0500
    267 @@ -112,7 +112,7 @@
    268              out = fopen( name, "wb+" );
    269              if( !out )
    270              {
    271 -                tr_nerr( inf->name, _( "Couldn't create \"%1$s\": %2$s" ),
    272 +                tr_nerr( inf->name, _( "Couldn't create \"%s\": %s" ),
    273                          name, tr_strerror( errno ) );
    274              }
    275              else
    276140diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/net.c transmission-2.00/libtransmission/net.c
    277141--- transmission-2.00-orig/libtransmission/net.c        2010-06-15 20:32:58.000000000 -0500
    278 +++ transmission-2.00/libtransmission/net.c     2010-06-17 18:52:25.000000000 -0500
    279 @@ -32,8 +32,9 @@
     142+++ transmission-2.00/libtransmission/net.c     2010-06-20 14:03:25.000000000 -0500
     143@@ -32,8 +32,8 @@
    280144 #include <sys/types.h>
    281145 
     
    285149+ #define _WIN32_WINNT  0x0501
    286150+ #include <ws2tcpip.h>
    287 + #define EADDRINUSE    WSAEADDRINUSE
    288151 #else
    289152  #include <sys/socket.h>
    290153  #include <netinet/in.h>
     154@@ -63,61 +63,6 @@
     155 const tr_address tr_in6addr_any = { TR_AF_INET6, { IN6ADDR_ANY_INIT } };
     156 const tr_address tr_inaddr_any = { TR_AF_INET, { { { { INADDR_ANY, 0x00, 0x00, 0x00 } } } } };
     157 
     158-#ifdef WIN32
     159-static const char *
     160-inet_ntop( int af, const void *src, char *dst, socklen_t cnt )
     161-{
     162-    if (af == AF_INET)
     163-    {
     164-        struct sockaddr_in in;
     165-        memset( &in, 0, sizeof( in ) );
     166-        in.sin_family = AF_INET;
     167-        memcpy( &in.sin_addr, src, sizeof( struct in_addr ) );
     168-        getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in),
     169-                    dst, cnt, NULL, 0, NI_NUMERICHOST);
     170-        return dst;
     171-    }
     172-    else if (af == AF_INET6)
     173-    {
     174-        struct sockaddr_in6 in;
     175-        memset( &in, 0, sizeof( in ) );
     176-        in.sin6_family = AF_INET6;
     177-        memcpy( &in.sin6_addr, src, sizeof( struct in_addr6 ) );
     178-        getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in6),
     179-                    dst, cnt, NULL, 0, NI_NUMERICHOST);
     180-        return dst;
     181-    }
     182-    return NULL;
     183-}
     184-
     185-static int
     186-inet_pton(int af, const char *src, void *dst)
     187-{
     188-    struct addrinfo hints;
     189-    struct addrinfo *res;
     190-    struct addrinfo *ressave;
     191-
     192-    memset(&hints, 0, sizeof(struct addrinfo));
     193-    hints.ai_family = af;
     194-
     195-    if (getaddrinfo(src, NULL, &hints, &res) != 0)
     196-        return -1;
     197-
     198-    ressave = res;
     199-
     200-    while (res)
     201-    {
     202-        memcpy(dst, res->ai_addr, res->ai_addrlen);
     203-        res = res->ai_next;
     204-    }
     205-
     206-    freeaddrinfo(ressave);
     207-    return 0;
     208-}
     209-
     210-#endif
     211-
     212-
     213 void
     214 tr_netInit( void )
     215 {
    291216diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/net.h transmission-2.00/libtransmission/net.h
    292217--- transmission-2.00-orig/libtransmission/net.h        2010-06-15 20:32:58.000000000 -0500
    293 +++ transmission-2.00/libtransmission/net.h     2010-06-17 18:52:25.000000000 -0500
    294 @@ -31,8 +31,7 @@
     218+++ transmission-2.00/libtransmission/net.h     2010-06-19 12:37:12.000000000 -0500
     219@@ -31,9 +31,7 @@
    295220 
    296221 #ifdef WIN32
     
    298223- #include <winsock2.h>
    299224- #include <WS2tcpip.h>
     225- typedef int socklen_t;
    300226+ #include <ws2tcpip.h>
    301   typedef int socklen_t;
    302227 #else
    303228  #include <sys/types.h>
     229  #include <sys/socket.h>
     230@@ -42,6 +40,7 @@
     231 #endif
     232 
     233 #ifdef WIN32
     234+ #define EADDRINUSE              WSAEADDRINUSE
     235  #define ECONNREFUSED            WSAECONNREFUSED
     236  #define ECONNRESET              WSAECONNRESET
     237  #define EHOSTUNREACH            WSAEHOSTUNREACH
    304238diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/peer-io.c transmission-2.00/libtransmission/peer-io.c
    305239--- transmission-2.00-orig/libtransmission/peer-io.c    2010-06-15 20:32:58.000000000 -0500
    306 +++ transmission-2.00/libtransmission/peer-io.c 2010-06-17 18:52:25.000000000 -0500
     240+++ transmission-2.00/libtransmission/peer-io.c 2010-06-18 21:18:33.000000000 -0500
    307241@@ -19,8 +19,52 @@
    308242 
     
    328262+     case WSAENOPROTOOPT:      errno = 109;            break;
    329263+     case WSAEAFNOSUPPORT:     errno = werror;         break;
    330 +     case WSAEADDRINUSE:       errno = 112;            break;
     264+     case WSAEADDRINUSE:       errno = werror;         break;
    331265+     case WSAEADDRNOTAVAIL:    errno = 125;            break;
    332266+     case WSAENETDOWN:         errno = 115;            break;
     
    397331         /* eof case */
    398332         what |= EVBUFFER_EOF;
    399 @@ -769,7 +806,7 @@
    400      struct tr_datatype * datatype;
    401  
    402      assert( tr_amInEventThread( io->session ) );
    403 -    dbgmsg( io, "adding %zu bytes into io->output", byteCount );
    404 +    dbgmsg( io, "adding %u bytes into io->output", byteCount );
    405  
    406      datatype = tr_new( struct tr_datatype, 1 );
    407      datatype->isPieceData = isPieceData != 0;
    408333@@ -881,7 +918,7 @@
    409334         int e;
     
    439364diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/platform.c transmission-2.00/libtransmission/platform.c
    440365--- transmission-2.00-orig/libtransmission/platform.c   2010-06-15 20:32:58.000000000 -0500
    441 +++ transmission-2.00/libtransmission/platform.c        2010-06-17 18:52:25.000000000 -0500
    442 @@ -352,7 +352,7 @@
    443              }
    444  
    445              if( count )
    446 -                tr_inf( _( "Migrated %1$d files from \"%2$s\" to \"%3$s\"" ),
    447 +                tr_inf( _( "Migrated %d files from \"%s\" to \"%s\"" ),
    448                          count, oldDir, newDir );
    449              closedir( dirh );
    450          }
    451 @@ -436,7 +436,7 @@
     366+++ transmission-2.00/libtransmission/platform.c        2010-06-19 18:25:43.000000000 -0500
     367@@ -11,6 +11,8 @@
     368  */
     369 
     370 #ifdef WIN32
     371+ #include <w32api.h>
     372+ #define WINVER  WindowsXP
     373  #include <windows.h>
     374  #include <shlobj.h> /* for CSIDL_APPDATA, CSIDL_MYDOCUMENTS */
     375 #else
     376@@ -436,7 +438,7 @@
    452377             s = tr_buildPath( getHomeDir( ), "Library", "Application Support",
    453378                               appname, NULL );
     
    472397  #include <limits.h> /* PATH_MAX */
    473398  #ifdef PATH_MAX
    474 diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/port-forwarding.c transmission-2.00/libtransmission/port-forwarding.c
    475 --- transmission-2.00-orig/libtransmission/port-forwarding.c    2010-06-15 20:32:58.000000000 -0500
    476 +++ transmission-2.00/libtransmission/port-forwarding.c 2010-06-17 18:52:25.000000000 -0500
    477 @@ -84,7 +84,7 @@
    478      newStatus = tr_sharedTraversalStatus( s );
    479  
    480      if( newStatus != oldStatus )
    481 -        tr_ninf( getKey( ), _( "State changed from \"%1$s\" to \"%2$s\"" ),
    482 +        tr_ninf( getKey( ), _( "State changed from \"%s\" to \"%s\"" ),
    483                  getNatStateStr( oldStatus ),
    484                  getNatStateStr( newStatus ) );
    485  }
    486399diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/rpcimpl.c transmission-2.00/libtransmission/rpcimpl.c
    487400--- transmission-2.00-orig/libtransmission/rpcimpl.c    2010-06-15 20:32:58.000000000 -0500
    488 +++ transmission-2.00/libtransmission/rpcimpl.c 2010-06-17 18:52:25.000000000 -0500
     401+++ transmission-2.00/libtransmission/rpcimpl.c 2010-06-18 21:23:51.000000000 -0500
    489402@@ -859,7 +859,7 @@
    490403 
     
    496409     }
    497410     else /* success */
    498 @@ -901,19 +901,19 @@
     411@@ -901,14 +901,14 @@
    499412 
    500413     if( response_code != 200 )
     
    513426         if( fp == NULL )
    514427         {
    515              tr_snprintf( result, sizeof( result ),
    516 -                         _( "Couldn't save file \"%1$s\": %2$s" ),
    517 +                         _( "Couldn't save file \"%s\": %s" ),
    518                           filename, tr_strerror( errno ) );
    519          }
    520          else
    521 @@ -924,7 +924,7 @@
    522              if( n != response_byte_count )
    523              {
    524                  tr_snprintf( result, sizeof( result ),
    525 -                             _( "Couldn't save file \"%1$s\": %2$s" ),
    526 +                             _( "Couldn't save file \"%s\": %s" ),
    527                               filename, tr_strerror( errno ) );
    528              }
    529              else
    530428@@ -1022,7 +1022,7 @@
    531429     else
     
    539437diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/torrent.c transmission-2.00/libtransmission/torrent.c
    540438--- transmission-2.00-orig/libtransmission/torrent.c    2010-06-15 20:32:58.000000000 -0500
    541 +++ transmission-2.00/libtransmission/torrent.c 2010-06-17 18:52:25.000000000 -0500
     439+++ transmission-2.00/libtransmission/torrent.c 2010-06-18 21:25:12.000000000 -0500
    542440@@ -1666,6 +1666,19 @@
    543441     tr_torrentSetRatioLimitHitCallback( torrent, NULL, NULL );
     
    560458 static void
    561459 torrentCallScript( tr_torrent * tor, const char * script )
    562 @@ -1713,7 +1726,7 @@
    563  
    564          if( recentChange )
    565          {
    566 -            tr_torinf( tor, _( "State changed from \"%1$s\" to \"%2$s\"" ),
    567 +            tr_torinf( tor, _( "State changed from \"%s\" to \"%s\"" ),
    568                        getCompletionString( tor->completeness ),
    569                        getCompletionString( completeness ) );
    570          }
    571460diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/tr-dht.c transmission-2.00/libtransmission/tr-dht.c
    572461--- transmission-2.00-orig/libtransmission/tr-dht.c     2010-06-15 20:32:58.000000000 -0500
     
    607496diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/tr-lpd.c transmission-2.00/libtransmission/tr-lpd.c
    608497--- transmission-2.00-orig/libtransmission/tr-lpd.c     2010-06-15 20:32:58.000000000 -0500
    609 +++ transmission-2.00/libtransmission/tr-lpd.c  2010-06-17 18:52:25.000000000 -0500
     498+++ transmission-2.00/libtransmission/tr-lpd.c  2010-06-19 12:25:33.000000000 -0500
    610499@@ -25,14 +25,21 @@
    611500 #include <stdio.h>
     
    633522 /* third party */
    634523 #include <event.h>
    635 @@ -125,6 +132,59 @@
    636  * @brief a line-feed, as understood by the LPD protocol */
    637  #define CRLF "\r\n"
    638  
    639 +#ifdef WIN32
    640 +static const char *
    641 +inet_ntop( int af, const void *src, char *dst, socklen_t cnt )
    642 +{
    643 +    if (af == AF_INET)
    644 +    {
    645 +        struct sockaddr_in in;
    646 +        memset( &in, 0, sizeof( in ) );
    647 +        in.sin_family = AF_INET;
    648 +        memcpy( &in.sin_addr, src, sizeof( struct in_addr ) );
    649 +        getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in),
    650 +                    dst, cnt, NULL, 0, NI_NUMERICHOST);
    651 +        return dst;
    652 +    }
    653 +    else if (af == AF_INET6)
    654 +    {
    655 +        struct sockaddr_in6 in;
    656 +        memset( &in, 0, sizeof( in ) );
    657 +        in.sin6_family = AF_INET6;
    658 +        memcpy( &in.sin6_addr, src, sizeof( struct in_addr6 ) );
    659 +        getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in6),
    660 +                    dst, cnt, NULL, 0, NI_NUMERICHOST);
    661 +        return dst;
    662 +    }
    663 +    return NULL;
    664 +}
    665 +
    666 +static int
    667 +inet_pton(int af, const char *src, void *dst)
    668 +{
    669 +    struct addrinfo hints;
    670 +    struct addrinfo *res;
    671 +    struct addrinfo *ressave;
    672 +
    673 +    memset(&hints, 0, sizeof(struct addrinfo));
    674 +    hints.ai_family = af;
    675 +
    676 +    if (getaddrinfo(src, NULL, &hints, &res) != 0)
    677 +        return -1;
    678 +
    679 +    ressave = res;
    680 +
    681 +    while (res)
    682 +    {
    683 +        memcpy(dst, res->ai_addr, res->ai_addrlen);
    684 +        res = res->ai_next;
    685 +    }
    686 +
    687 +    freeaddrinfo(ressave);
    688 +    return 0;
    689 +}
    690 +#endif
    691 +
    692  
    693  /**
    694  * @defgroup HttpReqProc HTTP-style request handling
    695 @@ -242,6 +302,7 @@
     524@@ -242,6 +249,7 @@
    696525 * @} */
    697526 
     
    701530 * @brief Configures additional capabilities for a socket */
    702531 static inline int lpd_configureSocket( int sock, int add )
    703 @@ -257,6 +318,7 @@
     532@@ -257,6 +265,7 @@
    704533 
    705534     return add;
     
    709538 /**
    710539 * @brief Initializes Local Peer Discovery for this node
    711 @@ -291,7 +353,12 @@
     540@@ -291,7 +300,12 @@
    712541             goto fail;
    713542 
     
    722551 
    723552         if( setsockopt( lpd_socket, SOL_SOCKET, SO_REUSEADDR,
    724 @@ -331,7 +398,12 @@
     553@@ -331,7 +345,12 @@
    725554             goto fail;
    726555 
     
    728557+#ifdef WIN32
    729558+       unsigned long flags= 1;
    730 +       if (ioctlsocket(lpd_socket, FIONBIO, &flags) == SOCKET_ERROR)
     559+       if (ioctlsocket(lpd_socket2, FIONBIO, &flags) == SOCKET_ERROR)
    731560+#else
    732561         if( lpd_configureSocket( lpd_socket2, O_NONBLOCK ) < 0 )
     
    894723diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/utils.c transmission-2.00/libtransmission/utils.c
    895724--- transmission-2.00-orig/libtransmission/utils.c      2010-06-15 20:32:58.000000000 -0500
    896 +++ transmission-2.00/libtransmission/utils.c   2010-06-17 19:07:26.000000000 -0500
    897 @@ -34,6 +34,9 @@
     725+++ transmission-2.00/libtransmission/utils.c   2010-06-20 14:59:51.000000000 -0500
     726@@ -34,10 +34,15 @@
    898727 #include <sys/types.h>
    899728 #include <sys/stat.h>
     
    905734 #include "event.h"
    906735 
    907 @@ -481,7 +484,7 @@
    908      struct stat  sb;
    909      int fd;
    910      ssize_t n;
    911 -    const char * err_fmt = _( "Couldn't read \"%1$s\": %2$s" );
    912 +    const char * err_fmt = _( "Couldn't read \"%s\": %s" );
    913  
    914      /* try to stat the file */
    915      errno = 0;
    916 @@ -601,7 +604,7 @@
    917              {
    918                  const int err = errno;
    919                  tr_err( _(
    920 -                           "Couldn't create \"%1$s\": %2$s" ), path,
    921 +                           "Couldn't create \"%s\": %s" ), path,
    922                         tr_strerror( err ) );
    923                  tr_free( path );
    924                  errno = err;
    925 @@ -612,7 +615,7 @@
    926          {
    927              /* Node exists but isn't a folder */
    928              char * buf = tr_strdup_printf( _( "File \"%s\" is in the way" ), path );
    929 -            tr_err( _( "Couldn't create \"%1$s\": %2$s" ), path_in, buf );
    930 +            tr_err( _( "Couldn't create \"%s\": %s" ), path_in, buf );
    931              tr_free( buf );
    932              tr_free( path );
    933              errno = ENOTDIR;
    934 @@ -1429,7 +1432,11 @@
     736 #ifdef WIN32
     737+ #include <w32api.h>
     738+ #define WINVER WindowsXP /* freeaddrinfo(),getaddrinfo(),getnameinfo() */
     739  #include <direct.h> /* _getcwd */
     740  #include <windows.h> /* Sleep */
     741 #endif
     742@@ -1429,7 +1434,11 @@
    935743     /* copy the file */
    936744     in = tr_open_file_for_scanning( oldpath );
     
    944752     while( bytesLeft > 0 )
    945753     {
     754@@ -1492,3 +1501,87 @@
     755     tr_dbg( "tr_valloc(%zu) allocating %zu bytes", bufLen, allocLen );
     756     return buf;
     757 }
     758+
     759+char *tr_realpath(const char *path, char *resolved_path)
     760+{
     761+#ifdef WIN32
     762+/* From a message to the Mingw-msys list, circa Jun 2, 2005
     763+ * by Mark Junker.
     764+ */
     765+    if (GetFullPathNameA(path, TR_PATH_MAX, resolved_path, NULL) == 0)
     766+        return NULL;
     767+    return resolved_path;
     768+#else
     769+    return realpath(path, resolved_path);
     770+#endif
     771+}
     772+
     773+#ifdef WIN32
     774+const char *
     775+inet_ntop( int af, const void *src, char *dst, socklen_t cnt )
     776+{
     777+    if (af == AF_INET)
     778+    {
     779+        struct sockaddr_in in;
     780+        memset( &in, 0, sizeof( in ) );
     781+        in.sin_family = AF_INET;
     782+        memcpy( &in.sin_addr, src, sizeof( struct in_addr ) );
     783+        getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in),
     784+                    dst, cnt, NULL, 0, NI_NUMERICHOST);
     785+        return dst;
     786+    }
     787+    else if (af == AF_INET6)
     788+    {
     789+        struct sockaddr_in6 in;
     790+        memset( &in, 0, sizeof( in ) );
     791+        in.sin6_family = AF_INET6;
     792+        memcpy( &in.sin6_addr, src, sizeof( struct in_addr6 ) );
     793+        getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in6),
     794+                    dst, cnt, NULL, 0, NI_NUMERICHOST);
     795+        return dst;
     796+    }
     797+    return NULL;
     798+}
     799+
     800+int
     801+inet_pton(int af, const char *src, void *dst)
     802+{
     803+    struct addrinfo hints, *res, *ressave;
     804+    struct sockaddr_in  *s4;
     805+    struct sockaddr_in6 *s6;
     806+
     807+    memset(&hints, 0, sizeof(struct addrinfo));
     808+    hints.ai_family = af;
     809+    hints.ai_flags = AI_NUMERICHOST;
     810+
     811+    if (getaddrinfo(src, NULL, &hints, &res) != 0) {
     812+        if (WSAGetLastError() == WSAHOST_NOT_FOUND)
     813+           return 0;
     814+       else {
     815+           errno = EAFNOSUPPORT;
     816+           return -1;
     817+       }
     818+    }
     819+
     820+    ressave = res;
     821+    while (res) {
     822+        switch (res->ai_family) {
     823+            case AF_INET:
     824+               s4 = (struct sockaddr_in *) res->ai_addr;
     825+               memcpy(dst, &s4->sin_addr, sizeof(struct in_addr));
     826+               break;
     827+            case AF_INET6:
     828+               s6 = (struct sockaddr_in6 *) res->ai_addr;
     829+               memcpy(dst, &s6->sin6_addr, sizeof(struct in6_addr));
     830+               break;
     831+           default:    /* AF_UNSPEC, AF_NETBIOS */
     832+               break;
     833+       }
     834+        res = res->ai_next;
     835+    }
     836+
     837+    freeaddrinfo(ressave);
     838+    return 1;
     839+}
     840+
     841+#endif
     842diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/utils.h transmission-2.00/libtransmission/utils.h
     843--- transmission-2.00-orig/libtransmission/utils.h      2010-06-15 20:32:58.000000000 -0500
     844+++ transmission-2.00/libtransmission/utils.h   2010-06-19 14:31:09.000000000 -0500
     845@@ -98,6 +98,9 @@
     846 #endif
     847 
     848 /* #define DISABLE_GETTEXT */
     849+#ifdef WIN32
     850+ #define DISABLE_GETTEXT
     851+#endif
     852 #if defined(TR_EMBEDDED) && !defined(DISABLE_GETTEXT)
     853  #define DISABLE_GETTEXT
     854 #endif
     855@@ -546,6 +549,18 @@
     856 /** @brief Private libtransmission function to update tr_time()'s counter */
     857 static inline void tr_timeUpdate( time_t now ) { transmission_now = now; }
     858 
     859+/** @brief Portability wrapper for realpath() that uses the system implementation if available */
     860+char *tr_realpath(const char *path, char *resolved_path);
     861+
     862+#if defined( WIN32) && !defined(QT_DLL)
     863+/* The QT exclusion is because something clashes whith the next include */
     864+#include <ws2tcpip.h>          /* socklen_t */
     865+
     866+/** @brief Missing in Windows and Mingw */
     867+const char *inet_ntop( int af, const void *src, char *dst, socklen_t cnt );
     868+int inet_pton(int af, const char *src, void *dst);
     869+#endif
     870+
     871 /***
     872 ****
     873 ***/
    946874diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/libtransmission/web.c transmission-2.00/libtransmission/web.c
    947875--- transmission-2.00-orig/libtransmission/web.c        2010-06-15 20:32:58.000000000 -0500
    948 +++ transmission-2.00/libtransmission/web.c     2010-06-17 18:52:25.000000000 -0500
     876+++ transmission-2.00/libtransmission/web.c     2010-06-19 10:54:42.000000000 -0500
    949877@@ -10,7 +10,9 @@
    950878  * $Id: web.c 10535 2010-04-28 00:32:43Z charles $
     
    957885 #include <curl/curl.h>
    958886 #include <event.h>
    959 @@ -94,7 +96,11 @@
    960      const size_t byteCount = size * nmemb;
    961      struct tr_web_task * task = vtask;
    962      evbuffer_add( task->response, ptr, byteCount );
    963 +#ifndef WIN32
    964      dbgmsg( "wrote %zu bytes to task %p's buffer", byteCount, task );
    965 +#else
    966 +    dbgmsg( "wrote %u bytes to task %p's buffer", byteCount, task);
    967 +#endif
    968      return byteCount;
    969  }
    970  
    971 @@ -274,7 +280,7 @@
    972          while(( task = tr_list_pop_front( &web->tasks )))
    973          {
    974              curl_multi_add_handle( multi, createEasy( session, task ));
    975 -            /*fprintf( stderr, "adding a task.. taskCount is now %d\n", taskCount );*/
    976 +           fprintf( stderr, "adding a task.. taskCount is now %d\n", taskCount );
    977              ++taskCount;
    978          }
    979          tr_lockUnlock( web->taskLock );
    980 @@ -304,6 +310,9 @@
     887@@ -304,6 +306,9 @@
    981888             t.tv_sec =  usec / 1000000;
    982889             t.tv_usec = usec % 1000000;
     
    988895         }
    989896 
    990 @@ -323,7 +332,7 @@
    991                  curl_easy_getinfo( e, CURLINFO_RESPONSE_CODE, &task->code );
    992                  curl_multi_remove_handle( multi, e );
    993                  curl_easy_cleanup( e );
    994 -/*fprintf( stderr, "removing a completed task.. taskCount is now %d (response code: %d, response len: %d)\n", taskCount, (int)task->code, (int)EVBUFFER_LENGTH(task->response) );*/
    995 +               fprintf( stderr, "removing a completed task.. taskCount is now %d (response code: %d, response len: %d)\n", taskCount, (int)task->code, (int)EVBUFFER_LENGTH(task->response) );
    996                  tr_runInEventThread( task->session, task_finish_func, task );
    997                  --taskCount;
    998              }
    999897diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/qt/qtr.pro transmission-2.00/qt/qtr.pro
    1000898--- transmission-2.00-orig/qt/qtr.pro   2010-06-15 20:32:59.000000000 -0500
     
    1072970diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/third-party/dht/dht.c transmission-2.00/third-party/dht/dht.c
    1073971--- transmission-2.00-orig/third-party/dht/dht.c        2010-06-15 20:33:16.000000000 -0500
    1074 +++ transmission-2.00/third-party/dht/dht.c     2010-06-17 18:52:25.000000000 -0500
    1075 @@ -39,10 +39,18 @@
     972+++ transmission-2.00/third-party/dht/dht.c     2010-06-19 18:32:13.000000000 -0500
     973@@ -39,10 +39,19 @@
    1076974 #include <unistd.h>
    1077975 #include <fcntl.h>
     
    1083981 #include <netinet/in.h>
    1084982+#else
     983+#include <w32api.h>
    1085984+#define WINVER  WindowsXP       /* freeaddrinfo(),getaddrinfo(),getnameinfo() */
    1086985+#include <ws2tcpip.h>
    1087986+#define random rand            /* int rand() since no long random() */
    1088 +const char *inet_ntop(int, const void *, char *, socklen_t);
     987+extern const char *inet_ntop(int, const void *, char *, socklen_t); /* from libtransmission (utils.c) */
    1089988+#define EAFNOSUPPORT            WSAEAFNOSUPPORT
    1090989+#endif
     
    1092991 #include "dht.h"
    1093992 
    1094 @@ -1530,6 +1538,10 @@
     993@@ -1530,6 +1539,10 @@
    1095994 dht_init(int s, int s6, const unsigned char *id, const unsigned char *v)
    1096995 {
     
    11031002     if(dht_socket >= 0 || dht_socket6 >= 0 || buckets || buckets6) {
    11041003         errno = EBUSY;
    1105 @@ -1548,11 +1560,15 @@
     1004@@ -1548,11 +1561,15 @@
    11061005             return -1;
    11071006         buckets->af = AF_INET;
     
    11191018             goto fail;
    11201019     }
    1121 @@ -1563,11 +1579,15 @@
     1020@@ -1563,11 +1580,15 @@
    11221021             return -1;
    11231022         buckets6->af = AF_INET6;
     
    11351034             goto fail;
    11361035     }
    1137 @@ -2877,3 +2897,29 @@
     1036@@ -2877,3 +2898,4 @@
    11381037     debugf("Truncated message.\n");
    11391038     return -1;
    11401039 }
    11411040+
    1142 +#ifdef WIN32
    1143 +const char *
    1144 +inet_ntop (int af, const void *src, char *dst, socklen_t cnt)
    1145 +{
    1146 +    if (af == AF_INET)
    1147 +    {
    1148 +        struct sockaddr_in in;
    1149 +        memset(&in, 0, sizeof(in));
    1150 +        in.sin_family = AF_INET;
    1151 +        memcpy(&in.sin_addr, src, sizeof(struct in_addr));
    1152 +        getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in), dst, cnt, NULL, 0, NI_NUMERICHOST);
    1153 +        return dst;
    1154 +    }
    1155 +    else if (af == AF_INET6)
    1156 +    {
    1157 +        struct sockaddr_in6 in;
    1158 +        memset(&in, 0, sizeof(in));
    1159 +        in.sin6_family = AF_INET6;
    1160 +        memcpy(&in.sin6_addr, src, sizeof(struct in_addr6));
    1161 +        getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in6), dst, cnt, NULL, 0, NI_NUMERICHOST);
    1162 +        return dst;
    1163 +    }
    1164 +    return NULL;
    1165 +}
    1166 +#endif
    11671041diff -NaurX /home/rberber/diff-excludes.txt transmission-2.00-orig/third-party/miniupnp/miniupnpc.c transmission-2.00/third-party/miniupnp/miniupnpc.c
    11681042--- transmission-2.00-orig/third-party/miniupnp/miniupnpc.c     2010-06-15 20:33:16.000000000 -0500