Commit Graph

232 Commits

Author SHA1 Message Date
Juliusz Chroboczek 44e6e4a8f2 Tweak dummy callbacks.
Don't abort, just log a message and continue.
2011-02-18 00:24:40 +00:00
Juliusz Chroboczek 4d5f8dbb92 Don't call UTP_Close multiple times.
Greg says it's evil.
2011-02-18 00:24:36 +00:00
Juliusz Chroboczek eb715e8018 Shutdown UTP socket on short write. 2011-02-18 00:24:30 +00:00
Juliusz Chroboczek c9bbab05ee Schedule a uTP write in peerIoWriteBuf. 2011-02-18 00:24:28 +00:00
Juliusz Chroboczek 1090e5a262 Complete the uTP callbacks. 2011-02-18 00:24:22 +00:00
Juliusz Chroboczek 6313eb4703 Add dummy UTP callbacks.
Libutp will sometimes call our callbacks after we called UTP_Close,
notably to notify us of the UTP_STATE_DESTROYING state change, but
also, for some reason, to ask us about our read buffer.  The simplest
way to avoid issues with that is to switch to a second set of callbacks.
2011-02-18 00:24:18 +00:00
Juliusz Chroboczek 5563729d61 Add assertions to libevent callbacks.
They should never be called with a UTP socket.
2011-02-18 00:24:15 +00:00
Juliusz Chroboczek 18f1ddb7aa First pass at uTP callbacks. 2011-02-18 00:24:13 +00:00
Juliusz Chroboczek 5ad27d82cf Fix io_dtor for uTP sockets. 2011-02-18 00:24:09 +00:00
Juliusz Chroboczek 8599d7c037 Modify peer-io to work with UTP sockets.
This is not supposed to work yet -- it just adds new fields to the data
structures to get the UTP code to compile.
2011-02-18 00:23:51 +00:00
Jordan Lee 984ac1b92e (trunk libT) fix compiler warning: "peer-io.h:282: warning: inlining failed in call to ‘evbuffer_add_uint8’: optimizing for size and code size would grow" 2011-02-09 02:35:16 +00:00
Jordan Lee 0bd1ec8de8 (trunk libT) #3991 "connection encryption stopped working" -- silence minor compiler warning. patch by ijuxda. 2011-02-09 02:26:35 +00:00
Jordan Lee 394fed632f (libT) #3991 "Connection encryption stopped working" -- fixed.
This is a pretty straightfoward bug: the call to evbuffer_peek() should not have been wrapped in assert().
2011-02-08 00:31:50 +00:00
Jordan Lee fc1c5fe553 (trunk libT) silence some unused variable warnings from gcc when building with -DNDEBUG 2011-02-02 05:18:33 +00:00
Jordan Lee 8f69a33c79 (trunk libT) #3836 "libevent 2 support" -- fix minor memory leak.
tr_peerIoReconnect() was calling event_del() rather than event_free() on its io.event_read and io.event_write fields, causing those fields to be leaked. This behavior is new with libevent 2 support and doesn't affect transmission 2.1x or older.
2011-02-01 17:12:20 +00:00
Jordan Lee 4fbd6d8b19 (trunk libT) #3950 "use libevent's cached gettimeofday() value when appropriate" -- fixed. 2011-01-29 18:59:23 +00:00
Jordan Lee bcb83b4577 (trunk libT) #3921 "no overhead for reads" -- fixed. thanks to jch for reporting this. 2011-01-20 00:31:46 +00:00
Jordan Lee 879a2afcbd Update the copyright year in the source code comments.
The Berne Convention says that the copyright year is moot, so instead of adding another year to each file as in previous years, I've removed the year altogether from the source code comments in libtransmission, gtk, qt, utils, daemon, and cli.

Juliusz's copyright notice in tr-dht and Johannes' copyright notice in tr-lpd have been left alone; it didn't seem appropriate to modify them.
2011-01-19 13:48:47 +00:00
Jordan Lee 007b96a62f (trunk libT) #3894 "tr_peerIo.hasFinishedConnecting should be removed" -- committed. 2011-01-13 01:58:57 +00:00
Charles Kerr e5bb3205a1 (trunk) Join the 21st century and use only 1 space at the end sentences. This commit is nearly as important as the semi-annual ones that remove trailing spaces from the ends of lines of code... :) 2010-12-27 19:18:17 +00:00
Charles Kerr ae84dc70dd (trunk libT) #3836 "libevent2 support" -- finish moving to the libevent2 API mode. don't include the backwards-compatable API headers. 2010-12-24 08:58:41 +00:00
Charles Kerr dc5a61be49 (trunk libT) #3836 "libevent2 support" -- silence a pair of 'unused variable' compiler warnings 2010-12-20 12:49:12 +00:00
Charles Kerr 345b14adbc (trunk) #3836 "libevent2 support" -- bump libevent2 requirement to 2.0.10. This will break the Mac build for a minute intil BMW applies his Mac patch 2010-12-20 02:07:51 +00:00
Charles Kerr 9335e02e6d (trunk libT) add some new bugs to the code so that it will crash when vraa tries to use it 2010-11-11 15:31:11 +00:00
Charles Kerr 01ab067e9c (trunk libT) #3662 "libtransmission cpu optimization: fewer calls to tr_time_msec()" -- fixed. 2010-10-24 01:08:08 +00:00
Charles Kerr 8d15c48a3f (trunk libT) #3617 "1000+ warnings of 'inlining failed' in libtransmission when compiled with gcc 4.4.4" -- fixed. 2010-10-11 15:41:27 +00:00
Charles Kerr cdcc4705aa (trunk) #3045 "make libtransmission's API byte-oriented instead of KiB-oriented." -- implemented. This is a largish commit and will break the mac build for a little while. 2010-07-03 00:25:22 +00:00
Charles Kerr 954a309d8f (trunk) #3311 "MingW build of Transmission" -- apply more of rb07's diffs, though edited to lessen the inevitable #ifdefs 2010-06-30 21:24:36 +00:00
Charles Kerr 254a1f15cb (trunk libT) down the rabbit hole: various minor type correctness changes unearthed by -Wconversion 2010-06-30 16:40:19 +00:00
Charles Kerr b0b9e17032 (trunk libT) define MAX_BLOCK_SIZE once instead of in a handful of places 2010-05-26 15:23:21 +00:00
Charles Kerr 8433e0dd3b (trunk libT) make tr_peerIoEnable*() inline functions 2010-05-20 15:30:18 +00:00
Charles Kerr efe648e2d7 (trunk libT) fix a new assertion error from the nightlies reported by Ryoujin 2010-04-27 13:43:03 +00:00
Charles Kerr 52bad7b8a0 (trunk libT) #3164 "crash in tr_peerIoReconnect()" -- after attempting to reconnect, re-enable the libevent monitoring if the socket can't be created. 2010-04-23 23:48:52 +00:00
Charles Kerr 4f5670f9c0 (trunk libT) #2842 "Transmission crashes randomly on ARM-based Synology NAS" -- experimental commit based on giovannibajo's suggestion in comment:39 about the list struct's alignment 2010-04-23 23:45:44 +00:00
Charles Kerr 559af38e7b (trunk libT) #3162 "allow optional end-user configuration of TCP_CONGESTION" -- minor tweak removing a little bit of code duplication in r10508 2010-04-22 02:04:43 +00:00
Charles Kerr 00f452d942 (trunk libT) #3162 "allow optional end-user configuration of TCP_CONGESTION" -- add jch's implementation of this to trunk for 2.00 2010-04-22 01:49:16 +00:00
Charles Kerr 22320d2356 (trunk libT) fix potential NULL pointer dereference in libtransmission 2010-03-02 04:51:40 +00:00
Charles Kerr fad8f285a8 (trunk libT) use jch's suggestion of having a per-session page-aligned memory buffer for general reuse. (http://trac.transmissionbt.com/ticket/2551#comment:5) 2010-02-23 07:20:57 +00:00
Charles Kerr 8e16b74dad (trunk libT) #2775 "Saving some memory/storage" -- committed for 1.80 2010-01-20 18:48:52 +00:00
Charles Kerr 5b4ec24deb (trunk libT) tweak the peer-io bugfix 2010-01-18 19:26:46 +00:00
Charles Kerr fd9021b655 (trunk libT) #2416 "crash in event_queue_insert()" -- this crash is definitely happening when we call event_del() twice on the same event without an event dispatch pass between the two calls. Start nailing down every possible case where that could happen in libtransmission 2010-01-17 19:21:04 +00:00
Charles Kerr 5c26afdb52 happy new year! 2010-01-04 21:00:47 +00:00
Charles Kerr 6f68e30f37 (trunk libT) consistency tweak: rename tr_global{Lock,Unlock,IsLocked} as tr_session{Lock,Unlock,IsLocked} 2010-01-04 09:05:02 +00:00
Charles Kerr 196666da72 (trunk libT) fix minor bug in r9651 "Reduce SO_RCVBUF for outgoing peer connections on seeding torrents" -- remember the "isSeed" attribute so that we can use it on reconnects 2009-12-28 23:24:00 +00:00
Charles Kerr f4c744266f (trunk libT) #2667 "ignore martian addresses" -- modified this ticket. previously we ignored them from LTEP; now we ignore them regardless of the source. this commit implements this filtering change. 2009-12-15 17:39:19 +00:00
Charles Kerr 1c772bd1fe (trunk libT) finally get rid of the last remnants of tr_timer 2009-12-10 05:52:46 +00:00
Charles Kerr 78ead8c3dd (trunk) update the copyright notices 2009-12-05 02:19:24 +00:00
Charles Kerr 6eec59008c (trunk libT) experimental: Reduce SO_SNDBUF and SO_RCVBUF for tracker announce/scrape messages. Reduce SO_RCVBUF for outgoing peer connections on seeding torrents. 2009-12-02 05:30:46 +00:00
Charles Kerr e1c6b792aa (trunk libT) #2610 "avoid unnecessary calls to time(NULL)" 2009-11-26 18:47:08 +00:00
Charles Kerr c85ee09fef (trunk) trunk's just been too stable lately. #2119: reload settings.json on SIGHUP 2009-10-23 03:41:36 +00:00
Charles Kerr 0fd817b757 (trunk libT) more assertions to help find the cause of #2480 2009-10-10 17:37:34 +00:00
Charles Kerr cb79214854 (trunk) remove trailing spaces 2009-08-10 20:04:08 +00:00
Charles Kerr 55cd3a8367 (trunk libT) back out r8765. xref: http://trac.transmissionbt.com/ticket/2253#comment:13 2009-07-18 01:09:56 +00:00
Charles Kerr 5f9c5b553c maybe 1024 is too stringent here 2009-07-07 01:18:53 +00:00
Charles Kerr d6ed808f9c (trunk, libT) #2253: I love you, valgrind pt 3 2009-07-01 00:46:30 +00:00
Charles Kerr db5b508ca6 (trunk libT) I love you, massif 2009-06-25 04:02:07 +00:00
Charles Kerr 8fa568d20b (trunk libT) lessen evbuffer memory bloat when we have a lot of simultaneous peers 2009-06-03 22:52:08 +00:00
Charles Kerr 9513fcbe66 (trunk libT) add a bunch of comments denoting where the libevent 2.0 changes will go 2009-06-02 18:21:23 +00:00
Charles Kerr 3d7cc36424 (trunk) #7: DHT support. This is a work in progress... no gui/rpc support yet 2009-05-19 18:38:26 +00:00
Charles Kerr fb587a5b30 (trunk libT) make sure that outbound protocol messages don't get blocked by bandwidth limits 2009-04-21 16:18:51 +00:00
Charles Kerr a2b53f5cbd (trunk libT) more speed tweaks from valgrind 2009-04-12 14:52:17 +00:00
Charles Kerr 3f9a1d090b (trunk) #1787: add support for seeding ratio limiting in libtransmission 2009-02-13 18:23:56 +00:00
Charles Kerr adc6791de3 (trunk libT) add more assertions to ensure that the libevent calls are all being made from the same thread 2009-01-28 19:35:39 +00:00
Charles Kerr 8c9d5359b5 (trunk libT) add more assertions to make Biiaru crash more^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^Hhelp track down the cause of Biiaru's crashes 2009-01-26 02:51:50 +00:00
Charles Kerr 6d6a76d48a (trunk libT) more of the same 2009-01-24 17:37:28 +00:00
Charles Kerr 5812b9f05b (trunk libT) more debugging messages 2009-01-24 17:20:07 +00:00
Charles Kerr dd00672517 (trunk libT) more experimental code for Biiaru 2009-01-24 16:21:34 +00:00
Charles Kerr 40f3c725d7 (trunk libT) experimental commit that will *possibly* fix the "assert( tr_isPeerIo( io ) )" crash reported by Biiaru and others 2009-01-24 14:49:35 +00:00
Charles Kerr 7f82b7172c (trunk libT) don't limit peer bandwidth during the handshake phase. this solves a bug that made it difficult to connect to peers when the upload bandwidth is saturated. 2009-01-24 03:17:59 +00:00
Charles Kerr b6c73370e3 (trunk libT) #1734: encrypted peers' outgoing RC4 stream can be corrupted by sending protocol messages out-of-order 2009-01-22 14:32:29 +00:00
Charles Kerr 1375c707ed (trunk libT) fix uninitialized variable in bandwidth code 2009-01-20 02:43:21 +00:00
Charles Kerr 4d228289ce (trunk libT) prefer `int' over `ssize_t' 2009-01-19 14:05:43 +00:00
Charles Kerr 69f59b423a (trunk libT) possible fix for the `few peers' errors reported on OS X. denis_, merlyn3d, give this a spin... 2009-01-19 13:55:41 +00:00
Charles Kerr d95a45b701 (trunk libT) fix IPv6 reported & solved by erdgeist. add debugging message to help track down any future problems. 2009-01-16 23:17:31 +00:00
Charles Kerr fe816d8135 (trunk) update the GPL code's copyright dates 2009-01-10 23:09:07 +00:00
Charles Kerr c6a454d2e2 (trunk libT) win32 portability fixes, reported by Alexey 2009-01-10 02:22:13 +00:00
Charles Kerr 98420365e9 (trunk libT) remove a small number of redundant or unnecessary asserts 2009-01-08 04:43:00 +00:00
Charles Kerr 30a989f1df (trunk libT) fix the new-code errors reported by ZogG and Rolcol and Spaham 2009-01-05 18:20:47 +00:00
Charles Kerr 5ccd5a7700 (trunk libT) fix the much-hated "Assertion failed: (tr_isPeerIo( io ))". Also, repeated calls to tr_date() were taking up about 78% of the time in tr_stat(), so instead of calling multiple times, call it once in tr_stat() and pass that value around to the functions that need it. 2009-01-05 04:27:54 +00:00
Charles Kerr 2b38f6f81a (trunk libT) don't use void* when doing pointer math. 2009-01-04 04:37:26 +00:00
Charles Kerr 7fcad8a45b (trunk libT) fix r7594 typo 2009-01-03 05:07:45 +00:00
Charles Kerr 5afd327b15 (trunk libT) use ssize_t where appropriate in tr_peerIoFlush() 2009-01-03 04:57:40 +00:00
Charles Kerr 1e77d1313e (trunk libT) oh ffs 2009-01-03 03:58:35 +00:00
Charles Kerr b41cf9f231 (trunk libT) avoid some unnecessary memory fragmentation... for composited objects that have a tr_bandwidth, contain the it directly rather than a pointer to one allocated elsewhere on the heap. 2009-01-02 19:56:06 +00:00
Charles Kerr 73f500e5be (trunk libT) inline parts of peer-io and bandwidth, too 2009-01-02 17:46:22 +00:00
Charles Kerr d6b4db4a78 (trunk libT) add "inline" hint to several one-liner functions 2009-01-02 06:28:22 +00:00
Charles Kerr 0cd572a0da (trunk libT) make tr_isAddress() and tr_isDirection() inline 2009-01-02 04:47:37 +00:00
Charles Kerr f2d9179b64 (trunk libT) #1632: bandwidth.c: 428: tr_bandwidthUsed: Assertion `tr_isBandwidth( b )' failed 2008-12-30 03:45:12 +00:00
Charles Kerr 1c71e622e1 (trunk libT) minor cleanup: use symbolic name instead of magic numbers; use tr_bool instead of int 2008-12-30 02:43:51 +00:00
Charles Kerr 798bac0fcb (trunk libT) omit unnecessary malloc/free calls in peer-io 2008-12-29 19:01:47 +00:00
Charles Kerr 6f8e5352ab (trunk libT) fix connectivity error reported by Stargazer. Also, add more debug statements to track down errors like this in the future 2008-12-24 02:50:08 +00:00
Charles Kerr dfcc9173e5 (trunk libT) #include "session.h" cleanup from wereHamster 2008-12-23 17:27:15 +00:00
Charles Kerr 82d349d221 (trunk libT) fix minor r7474 issue 2008-12-23 17:23:07 +00:00
Charles Kerr c4e11a12e3 (trunk libT) socket performance tweak by wereHamster 2008-12-23 17:11:31 +00:00
Charles Kerr 5d1c109fc4 (trunk libT) speed improvments from wereHamster 2008-12-22 19:16:06 +00:00
Charles Kerr 1310fea91e (trunk libT) peer-io.c: remove dead code and get rid of a couple of GOTOs 2008-12-22 04:55:07 +00:00
Charles Kerr acdd8c860c (trunk libT) minor cleanups found while diffing for backport to 1.4x in r7455 2008-12-22 00:52:44 +00:00
Charles Kerr 8556ce653f (trunk libT) comments, tr_bool correctness, better runtime tests. 2008-12-21 18:15:00 +00:00
Charles Kerr cb5d259f21 (trunk libT) fix an r7441 function pointer error reported by fulgas in #transmission 2008-12-21 00:05:54 +00:00
Charles Kerr 72ded3b272 try to rework the bandwidth code yet again s.t. it satisfies all three: (1) fairly distributes bandwidth across all peers, (2) scales well in high-bandwidth situations, (3) is good at hitting and staying at bandwidth limits/goals 2008-12-20 22:19:34 +00:00