Commit Graph

4105 Commits

Author SHA1 Message Date
Jordan Lee 1cd9d0f9b7 copyediting: indentation & whitespace 2012-12-15 04:28:19 +00:00
Jordan Lee 89b3c5fc0a when a peer sends us a block and we count it in tr_cpBlockAdd(), don't invalidate cp.sizeWhenDone unless sizeWhenDone wasn't already including that new block. 2012-12-15 03:47:11 +00:00
Jordan Lee df5b6365bd (trunk, libT) faster JSON parsing for tr_variant. This mostly helps the Qt client, which makes heavy use of the JSON-based RPC calls. 2012-12-15 00:01:59 +00:00
Jordan Lee aea6d7cd6f (trunk, libT) #5168 'make libtransmission's public funcs nonblocking when possible' -- remove tr_torrentRef() and tr_torrentUnref() as discussed in https://trac.transmissionbt.com/ticket/5168#comment:8 2012-12-14 20:04:37 +00:00
Jordan Lee c5ff0c0308 copyediting: indentation, whitespace 2012-12-14 16:04:44 +00:00
Jordan Lee a11d5a66ff svn add variant.c 2012-12-14 04:36:33 +00:00
Jordan Lee e96ed247fe refactor libtransmission's tr_benc class as tr_variant. 2012-12-14 04:34:42 +00:00
Jordan Lee e1c338b6c3 (trunk, libT) #5169 fix FTBFS in torrentStart() 2012-12-13 05:22:30 +00:00
Jordan Lee 104d4aa772 don't inline functions that can't be inlined. 2012-12-13 02:00:45 +00:00
Jordan Lee d74c7e93c8 copyediting: indentation cleanup 2012-12-13 01:47:40 +00:00
Jordan Lee e2f1d6744e fix another pair of #5168 oopses (oopsii?) 2012-12-12 21:19:25 +00:00
Jordan Lee 399c3233b7 remove a couple of unnecessary torrentIsLocked() assertions for #5168 2012-12-12 20:57:13 +00:00
Jordan Lee 079c78981c (trunk) #5168 'make libtransmission's public funcs nonblocking when possible' -- first attempt. 2012-12-12 20:22:57 +00:00
Jordan Lee 84f2cf8fa2 in bencode.c's makeroom(), make the containers' sizes scale in powers of 2 to avoid excess reallocs. 2012-12-11 05:23:48 +00:00
Jordan Lee bbc009bb0f in libtransmission's unit tests, add a convenience check macro for comparing pointer equality 2012-12-10 01:24:50 +00:00
Jordan Lee 46b3b79e63 in metainfo.c, don't include sys/stat.h anymore, it's unneeded after r13633 2012-12-09 22:05:31 +00:00
Jordan Lee 5766f6fb4d in bencode.c's makeroom(), clarify the entry assertions 2012-12-09 21:45:30 +00:00
Jordan Lee dd643537ae in bencode.c's tr_bencMergeDicts(), call tr_bencDictReserve() so the target dict only has to alloc once to hold all of the source dict's entries. 2012-12-09 21:36:51 +00:00
Jordan Lee 9ddd7e0166 preallocate a couple of dictionaries to the right size before using them. 2012-12-09 21:28:20 +00:00
Jordan Lee 0846d3f2ab in bitfield.c, speed up countArray() by about 15% 2012-12-09 19:08:06 +00:00
Jordan Lee 3d5b43b5b4 in bitfield.c's countRange() function, make walk_end an invariant 2012-12-09 18:24:57 +00:00
Jordan Lee 8a2061f2cf move bitfield tests to their own file 2012-12-09 05:32:52 +00:00
Jordan Lee 4f6dcc6d31 in tr_metainfoRemoveSaved(), don't look for .torrent files under our old naming scheme... we haven't used it since 2008 2012-12-09 01:32:25 +00:00
Jordan Lee 410fa7e054 remove unused function tr_metainfoMigrate() 2012-12-09 01:27:01 +00:00
Jordan Lee a2d2a10226 (trunk, libT) #5165: fix r13625 oops 2012-12-07 01:53:31 +00:00
Jordan Lee cff58b1904 (trunk, libT) #5163 'typo in tr_peerIoSupportsUTP()' -- fixed. 2012-12-06 15:04:52 +00:00
Jordan Lee 519feefcb4 (trunk, libT) #5157 -- fix r13628 oops 2012-12-06 00:50:40 +00:00
Jordan Lee 61c1f7efec (trunk, libT) #5157 'check valid address before UTP_Create()' -- added. 2012-12-05 23:48:00 +00:00
Jordan Lee ccb4a16ab8 (trunk, libT) #5146 'seeding complete callback called twice' -- fixed with patch from x190. 2012-12-05 22:56:45 +00:00
Jordan Lee 3d38723ad9 Follow more common whitespace style conventions in the C code (libtransmission, daemon, utils, cli, gtk). 2012-12-05 17:29:46 +00:00
Jordan Lee 7af02f7cdf (trunk, libT) #5150 'improper escaping of dirnames with new json' -- add one-liner fix. this also fixes the regression test added in the previous commit. 2012-11-27 23:24:37 +00:00
Jordan Lee dffc6343ae (trunk, libT) #5150 'improper escaping of dirnames with new json' -- added new regression test, currently failing, to trigger this bug 2012-11-27 23:21:13 +00:00
Mitchell Livingston b1309bc927 #5144 add BitZilla to clients list 2012-11-24 01:14:51 +00:00
Mitchell Livingston 6bebaee639 #5134 Magnet links not adding all trackers with tr.0= 2012-11-14 02:22:55 +00:00
Jordan Lee d010e33c32 (trunk, libT) #4886 'IPv6-only DHT.dat not being written' -- fixed. bug found & patched by jch. 2012-11-11 14:42:14 +00:00
Mitchell Livingston 3836821a95 fix a parameter type mismatch in jsonsl 2012-11-11 07:11:13 +00:00
Jordan Lee 9effd65f3e (trunk libT) #5131: replace JSON_parser with jsonsl to resolve licensing issue. 2012-11-11 04:26:56 +00:00
Jordan Lee d2ef01bc1a add more unit tests for the json-benc glue code 2012-11-11 04:20:15 +00:00
Mitchell Livingston 8cb08e2766 fix typo in r13604 2012-10-31 21:27:07 +00:00
Mitchell Livingston d73ca434c0 #5113 Add pbTorrent to client list 2012-10-31 21:25:23 +00:00
Mitchell Livingston 413f3dc532 #5111 Add Zona to client list 2012-10-31 21:22:23 +00:00
Mitchell Livingston ff83b4ee56 #5104 Unknown client -MG21r0- 2012-10-25 03:22:41 +00:00
Jordan Lee a981f4b6a6 (trunk, libT) #5097 'Rare buffer overflow (piece index too big)' -- fixed. 2012-10-20 15:57:56 +00:00
Jordan Lee e5304a8aaa make tr_mkdir() private. 2012-10-16 03:13:05 +00:00
Jordan Lee bb49ab9a01 in torrent-magnet.c and utils.h, use tr_torrentName() instead of tor->info.name 2012-10-16 02:48:26 +00:00
Jordan Lee 8fb80f5132 (trunk, libT) #4638 "Transmission sends an initial 'stopped' event when adding a torrent via RPC" -- fixed. 2012-10-15 03:11:16 +00:00
Jordan Lee 1dafe0beef more unit test cleanup 2012-10-14 23:38:52 +00:00
Jordan Lee 17beba3502 retrofit some of the tests to use the more expressive test API 2012-10-14 18:56:37 +00:00
Jordan Lee 031e313aa2 (trunk, libT) #5081 'Transmission discards webseed URLs that have trailing whitespace' -- fixed. Unit test passes and valgrind says 'All heap blocks were freed -- no leaks are possible' 2012-10-14 18:10:17 +00:00
Jordan Lee 0630583637 (trunk, libT) #5081 'Transmission discards webseed URLs that have trailing whitespace' -- add unit test (currently failing) for this bug. 2012-10-14 18:02:47 +00:00
Jordan Lee e89fcc9bf6 previous commit uncovered an unused shadow variable in test-peer-id.c 2012-10-14 18:00:29 +00:00
Jordan Lee a683ad49a8 steal some ideas about unit test error logging from Google Test 2012-10-14 17:59:24 +00:00
Jordan Lee e1e254d8c2 fix NULL-pointer-dereference regression introduced in r13546 for #5069. 2012-10-13 17:32:23 +00:00
Jordan Lee 718da0688f (trunk libT) fix webseed-in-magnet-link regression introduced in r13547 (2.71+). This issue was tracked down by by x190 in ticket #5081 2012-10-13 15:36:49 +00:00
Jordan Lee ebd4b5e386 (trunk, libT) #5063 'remaining time unknown with magnets that have webseeds' -- fixed. 2012-10-05 22:04:08 +00:00
Jordan Lee 1aa4286fbc (trunk, libT) #5069 'webseed magnet support is broken' reported & patch by cfpp2p 2012-10-05 16:44:36 +00:00
Jordan Lee cc51b1586c (trunk libT) #5075 'magnet.c:163 should use MAX_WEBSEEDS, not MAX_TRACKERS' ... fixed. Thanks to cfpp2p for catching this. 2012-10-05 16:10:12 +00:00
Jordan Lee b437b28228 (trunk, libT) #5049: fix bug that caused some incoming encrypted peer connections to fail 2012-09-25 02:07:03 +00:00
Jordan Lee 624c8ff1cc (trunk, libt) #4932 'crash on magnet links' -- fixed. 2012-09-19 05:11:19 +00:00
Mitchell Livingston 8e5a62ed40 add a missing @ to a comment 2012-09-18 03:46:01 +00:00
Mitchell Livingston 40e75b20ed return a value (and rename) testTurtleTime instead of passing in a flag to set 2012-09-18 03:44:59 +00:00
Mitchell Livingston ddabdcb1c7 remove a comment referring to a non-existant param 2012-09-18 01:13:31 +00:00
Mitchell Livingston e46309a0fa #4201 Automatic limit can't be stopped 2012-09-18 00:58:10 +00:00
Jordan Lee 357b160cde remove trailing spaces 2012-09-07 04:25:04 +00:00
Mitchell Livingston 723d681b63 Whoops! Revert new changes committed in r13469 2012-09-06 03:23:50 +00:00
Mitchell Livingston 9e7e64fe04 Revert r13468 for now. 2012-09-06 03:21:03 +00:00
Mitchell Livingston 3961a7e4f4 #4321 uTP implementation is very slow. 2012-09-05 11:39:57 +00:00
Jordan Lee 74c56f27b0 (trunk, libtransmission) #4934 "Create a test harness and use it for current tests" -- patch by gvdl 2012-08-18 16:07:05 +00:00
Jordan Lee 4963b65c1f (trunk utils) #4979 "add manget link generator to transmission-show" -- done. 2012-07-23 15:28:27 +00:00
Jordan Lee 9b98c0fc2e (trunk libT) #4969 "jsonrpc response to torrent-get emits malformed json" -- fixed. 2012-07-14 19:34:38 +00:00
Jordan Lee 5c34257ee0 (trunk libT) #4943 "tr_sessionClearStats() does not set the stats' dirty flag to true s.t. stats.json gets saved" 2012-07-01 04:00:27 +00:00
Jordan Lee f55ab8dddb (trunk libT) move torrent.c's private function fileExists() to the utility function tr_fileExists() so that it can also be used by stats.c 2012-07-01 03:05:36 +00:00
Jordan Lee 3398a48e57 (trunk libT) #4402 "Transmission Bandwidth allocation getting overflows" -- use gvdl's patch '4402-uint-bpsoverflow.patch' 2012-07-01 02:17:35 +00:00
Jordan Lee 99b615b3b8 (trunk libT) #4931 "Wrong peer percentages for magnetized transfers" -- fixed.
tr_peerUpdateProgress() is guessing at the progress size, but when we don't have the data size yet that guess isn't very good. Add boundary
 clamps on the peer.progress field.
2012-07-01 02:00:02 +00:00
Jordan Lee df80c1ce03 Fix the size for the peers and peersFrom dictionaries.
By setting the initial allocation size correctly, we can avoid unnecessary resizing when adding all the dictionary's fields.
2012-07-01 01:42:58 +00:00
Jordan Lee d717248e75 (trunk libT) fix the Linux build wrt compiling with the new snapshot of libutp checked into r13317
Previously we made sure to include stdbool.h (via transmission.h) before utp.h, since the latter used 'bool' without defining it. The new snapshot defines it unconditionally in non-C++ code, so now we need to include it first.
2012-05-30 17:47:29 +00:00
Jordan Lee f226d8a03f (trunk libT) #4914 if a tracker has no scrape URL but the announce response contains any scrape fields, that's as close to a scrape as we're going to get, so use those fields. 2012-05-22 20:21:00 +00:00
Jordan Lee 1e07439cd0 (trunk libT) #4908 "Handle UDP scrapes when they don't follow the /announce idiom" -- fixed. 2012-05-20 14:47:18 +00:00
Jordan Lee e9e76fa970 (trunk libT) #4888: when scraping magnet links, don't send a left=0 argument to the tracker. 2012-05-20 14:14:59 +00:00
Jordan Lee 512cc1af73 silence an unused-variable compiler warning introduced in the previous commit 2012-05-17 22:22:30 +00:00
Jordan Lee 6948852013 (trunk libT) #4894 -- don't use evbuffer_add_printf() and evbuffer_pullup() together. 2012-05-17 17:40:31 +00:00
Jordan Lee 00919e932d silence a compiler warning of implicitly casting the 3rd arg of initnatpmp() from a void* to an int 2012-04-07 00:12:57 +00:00
Mitchell Livingston bbf274109a #4825 update libnatpmp to libnatpmp-20110808 2012-03-21 02:51:26 +00:00
Jordan Lee a025510834 (trunk libT) #4810 "add environment variable option to have libcurl verify SSL certs" -- patch by infinity0 2012-03-04 13:21:42 +00:00
Jordan Lee ecfab318ed (trunk libT) fix potential NULL pointer dereference in rpc-server.c's crude mime multipart parser 2012-02-15 01:44:21 +00:00
Jordan Lee 43f7dc4c17 (trunk libT) fix minor memory leak of the 'dir' string when deleting local data. (Thanks, valgrind!) 2012-02-04 03:09:31 +00:00
Jordan Lee 6d4858d8dd (trunk) #4732 "allow switching between internal and system libnatpmp" -- fixed with patch scarabeus and applied by me, so any patch breakage is probably mine... ;) 2012-02-04 01:28:15 +00:00
Jordan Lee c56b12690c (trunk libT) #4687 "magnet links behave oddly" -- fixed. Thanks to cfpp2p for some very nice sleuthing on this one. 2012-02-04 00:34:39 +00:00
Jordan Lee b2d65db45f (trunk) remove trailing spaces from code lines ;) 2012-02-03 16:44:07 +00:00
Mitchell Livingston 3eb8b12fa8 #4704 req->left = tr_cpLeftUntilComplete( &tor->completion ) should end with a semicolon 2012-01-11 22:31:02 +00:00
Jordan Lee 57d273cd61 (trunk libT) #4700 "compilation fails on FreeBSD because it can't find alloca.h" -- fixed. 2012-01-10 19:18:18 +00:00
Jordan Lee cac5c360f2 (trunk libT) #4690 "getPeerCandidates() uses more CPU than necessary" -- fixed.
Once we've scored all n candidates, we sort them by score so that we can pick out the k best candidates. If n is large, sorting them can be expensive. If we use the Selection Algorithm, we select in O(n) without having to sort.
2011-12-31 21:28:53 +00:00
Jordan Lee a8468a7b09 (trunk libT) #4684 "tr_cpSizeWhenDone() is slow for huge torrents that we're only partially downloading" -- fixed.
There are actually two different implementations of the byte-counting in that function: a slower implementation was added prior to 2.40 in r12918 to double-check the standard implementation. This checking was added to help smoke out a bug that was fixed in r12920, but I forgot to remove that slower implementation.
2011-12-22 19:35:13 +00:00
Jordan Lee 9576dd16e2 (trunk libT) #4666 "webseed downloading never gets downloaded" -- fixed.
The webseed in question is downloading from an ubuntuone.com url. We ask for piece-sized ranges in a couple of different concurrent connections, and curl hints to the server that it's okay to gzip the response, or deflate it, or leave it raw. It looks like there's a bug in the server or in libcurl (or, somehow, Transmission) that's not compressing or decompressing these responses correctly -- we never get the right number of bytes in the response from libcurl. If we ask for the contents uncompressed, the download progresses towards completion.

As an aside, when testing this I noticed that deluge is a lot faster than Transmission on this torrent. In order for Transmission to reach parity here, webseed.c needs to know when it's appropriate to have more than 4 concurrent tasks and/or be able to request ranges > the torrent's piece size.
2011-12-14 05:58:23 +00:00
Jordan Lee f9cc51f0d3 (trunk libT) fix a minor memory leak in the bencode regression tests.
Found by llvm's static analyzer. This is a minor issue since the leak is in an automated test rather than in shipping code, but it's still better to fix it.
2011-12-14 05:44:15 +00:00
Jordan Lee 0d13057111 (trunk libT) fix warnings in fileset_get_empty_slot() found by llvm's static-build analyzer.
static-build found a potential NULL pointer dereference. The circumstances where this could get triggered don't seem very likely, but doesn't hurt to fix the warning.
2011-12-14 05:42:15 +00:00
Jordan Lee 206b1a9a5f (trunk web) fix warnings in tr_urlIsValidTracker() and tr_urlIsValid() found by llvm's scan-build.
scan-build found similar warnings in these two functions relating to allowing NULL pointers to be passed as arguments to functions that don't allow NULL. So now those NULL checks are made explicit before the function calls.
2011-12-14 05:40:21 +00:00
Jordan Lee 1cfeb4debb (trunk libT) #4644 "Transmission can't download big files from webseed." -- fix overflow error with a patch based on one from and_cesbo. (Modified by Jordan to add random bugs.) 2011-12-10 18:42:52 +00:00
Mitchell Livingston 0a9b47da50 whoops typo 2011-11-22 03:30:37 +00:00
Mitchell Livingston caa1c8fb8f #4643 Support µTorrent's long-version-number peer id 2011-11-22 03:02:18 +00:00