~ubuntu-branches/ubuntu/jaunty/transmission/jaunty-security

« back to all changes in this revision

Viewing changes to libtransmission/blocklist.c

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2008-12-28 18:50:08 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20081228185008-2u8ac12dbckrwn7c
Tags: 1.42-0ubuntu1
* New upstream version (LP: #311959):
  - All platforms:
    - Better peer management in large swarms
    - Support BitTorrent Enhancement Proposal (BEP) #21 "Extension for 
      Partial Seeds"
    - Partial support for BEP #6 "Fast Extension" (reject, have all/none)
    - Honor the peer's BEP #10 reqq key, when available
    - Fix 1.40 "Got HTTP Status Code: 0" error message
    - Fix 1.40 "lazy bitfield" error
    - Fix 1.40 "jumpy upload speed" bug
    - Fix handshake peer_id error
    - Corrrectly handle Windows-style newlines in Bluetack blocklists
    - More accurate bandwidth measurement
    - File selection & priority was reset when editing a torrent's 
      tracker list
    - Fix autoconf/automake build warnings
  - GTK+:
    - In the Details dialog's peer tabs, rows were sometimes duplicated
    - Minor bugfixes, usability changes, and locale improvements
    - Three new translations: Afrikaans, Asturian, Bosnian
    - Sixteen updated translations
  - Daemon:
    - Fix 1.40 bug in handling IP whitelist
    - Minor bugfixes and output cleanup
    - Windows portability
  - CLI:
    - Fix minor free-memory-read bug

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * This exemption does not extend to derived works not owned by
8
8
 * the Transmission project.
9
9
 *
10
 
 * $Id: blocklist.c 6897 2008-10-14 03:39:16Z charles $
 
10
 * $Id: blocklist.c 7254 2008-12-03 05:34:28Z charles $
11
11
 */
12
12
 
13
13
#include <stdio.h>
198
198
}
199
199
 
200
200
int
201
 
_tr_blocklistHasAddress( tr_blocklist *         b,
 
201
_tr_blocklistHasAddress( tr_blocklist         * b,
202
202
                         const struct in_addr * addr )
203
203
{
204
204
    uint32_t                   needle;
257
257
 
258
258
    while( !fggets( &line, in ) )
259
259
    {
260
 
        char *             rangeBegin;
261
 
        char *             rangeEnd;
262
 
        struct in_addr     in_addr;
 
260
        char *  rangeBegin;
 
261
        char *  rangeEnd;
 
262
        char *  crpos;
 
263
        struct in_addr in_addr;
263
264
        struct tr_ip_range range;
264
265
 
265
266
        rangeBegin = strrchr( line, ':' );
270
271
        if( !rangeEnd ){ free( line ); continue; }
271
272
        *rangeEnd++ = '\0';
272
273
 
 
274
        if(( crpos = strchr( rangeEnd, '\r' )))
 
275
            *crpos = '\0';
 
276
 
273
277
        if( tr_netResolve( rangeBegin, &in_addr ) )
274
278
            tr_err( "blocklist skipped invalid address [%s]\n", rangeBegin );
275
279
        range.begin = ntohl( in_addr.s_addr );