~ubuntu-branches/ubuntu/precise/transmission/precise

« back to all changes in this revision

Viewing changes to libtransmission/peer-io.c

  • Committer: Bazaar Package Importer
  • Author(s): Leo Costela
  • Date: 2009-07-25 20:20:23 UTC
  • mfrom: (1.3.1 upstream)
  • mto: (2.1.19 sid)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20090725202023-9xmfycsfotr430nv
* debian/rules: patch before configure
* debian/patches: add patch to not build libevent, regardless of
  linking (really, really closes: #537868)
* debian/changelog: fix dates

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: peer-io.c 8605 2009-06-03 22:52:08Z charles $
 
10
 * $Id: peer-io.c 8831 2009-07-18 01:09:56Z charles $
11
11
 */
12
12
 
13
13
#include <assert.h>
165
165
        tr_globalUnlock( session );
166
166
    }
167
167
 
 
168
    /* keep the iobuf's excess capacity from growing too large */
 
169
    if( EVBUFFER_LENGTH( io->inbuf ) == 0 ) {
 
170
        evbuffer_free( io->inbuf );
 
171
        io->inbuf = evbuffer_new( );
 
172
    }
 
173
 
168
174
    tr_peerIoUnref( io );
169
175
}
170
176
 
261
267
    if( n > 0 )
262
268
        evbuffer_drain( buffer, n );
263
269
 
 
270
    /* keep the iobuf's excess capacity from growing too large */
 
271
    if( EVBUFFER_LENGTH( io->outbuf ) == 0 ) {
 
272
        evbuffer_free( io->outbuf );
 
273
        io->outbuf = evbuffer_new( );
 
274
    }
 
275
 
264
276
    return n;
265
277
}
266
278