Commit Graph

3916 Commits

Author SHA1 Message Date
Jordan Lee 118ea87fef (trunk libT) more heap pruning: avoid an unnecessary evbuffer_new() + evbuffer_free() in tr_peerIoWriteBytes() 2011-04-27 17:52:28 +00:00
Jordan Lee 2043356876 (trunk libT) constify the tr_scrape_request argument to scrape_request_delegate(). 2011-04-27 17:30:53 +00:00
Jordan Lee dfcc14c3d5 (trunk libT) more heap pruning: build the "cookie_filename" field once when creating the web thread, instead of each time a new tr_web_task is added. 2011-04-27 17:02:18 +00:00
Jordan Lee 4ecf0d36d1 (trunk libT) use tr_malloc() instead of malloc() in tr_loadFile() and in the fallback code for tr_valloc() 2011-04-27 16:12:17 +00:00
Jordan Lee 018b673acd (trunk libT) #4209 "Shortcut UDP tracker test" -- prioritize the UDP handler functions based on frequency (uTP, DHT, UTP tracker) as outlined by jch in comment:5. Also, don't call the uTP or DHT handlers when uTP or DHT is disabled in the system preferences.
To avoid the function call overhead described by jch, instead of calling tr_sessionIsUTPEnabled() and tr_sessionIsDHTEnabled(), we test for WITH_UTP to be defined and test the tr_session.isUTPEnabled and tr_session.isDHTEnabled flags directly.
2011-04-27 05:29:05 +00:00
Jordan Lee ea3fe42ca3 (trunk libT) #4209 "Shortcut UDP tracker test" -- the goal of #4209 is to minimize the cost of the UDP event callback function, so apply the heap pruning eye to that by removing an unnecessary malloc/free call there.
Previously we allocated a 4096 character buffer each time; now we allocate it on the stack. It seems all the distros and OS flavors that Transmission runs on have multi-MB default stack sizes, so a hardwired 4K array should be safe.
2011-04-27 05:03:10 +00:00
Jordan Lee 0d31a32d41 (trunk libT) #4204 "Availability is the same as the amount downloaded when there are no seeders" -- possible fix
It looks like we had the wrong test on the replication count array size.
2011-04-24 22:56:42 +00:00
Juliusz Chroboczek decbfef106 Optimise UDP dispatch (fixes #4209).
Make quick inline tests for the DHT and UDP tracker protocols, which
avoids calling tau_handle_message for each µTP packet.
2011-04-24 19:12:28 +00:00
Jordan Lee a8377b1b7a (trunk libt) #4164 "__FD_SETSIZE impact on open-file-limit and peer-limit-global" -- commit patch by romanr to take FD_SETSIZE into account before calling setrlimit() 2011-04-19 15:23:04 +00:00
Jordan Lee ab698d2fa4 (trunk libT) more heap pruning: don't allocate peer-msgs' incoming block buffer until it's needed. If we're seeding, we won't need it. 2011-04-17 06:13:22 +00:00
Jordan Lee 294c2d7113 (trunk libT) heap and event pruning: don't create evtimers for periodic pex messages if the torrent doesn't allow pex (such as, if it's on a private tracker).
Previously, we unconditionally created the evtimer, and then checked each time to see if pex was allowed.
2011-04-17 05:55:46 +00:00
Jordan Lee 244bd7bc1c (trunk libT) more heap pruning: use composition rather than aggregation for the tr_crypto object owned by tr_peerIo. 2011-04-17 05:22:50 +00:00
Jordan Lee bbc35bd546 (trunk libT) use FD_SETSIZE instead of __FD_SETSIZE 2011-04-16 22:41:14 +00:00
Jordan Lee f9d5e7a72c (trunk libT) #4165 "__FD_SETSIZE impact on open-file-limit and peer-limit-global" -- add safety guard in the file cache to prevent too many open files. 2011-04-16 22:33:29 +00:00
Jordan Lee 9c3d12dae2 (trunk libT) changes to the bandwidth allocator's phaseOne step as suggested by Vincent in #2338 comment:108 2011-04-16 21:46:32 +00:00
Jordan Lee 01461d0b4a (trunk gtk) more heap pruning:
querying gconf2 each time the curl callack function is called is expensive, so query it once -- then again later, if the proxy settings change -- and remember the values in a local struct.
2011-04-13 06:18:30 +00:00
Jordan Lee 96c180fd73 (trunk libT) fix 2.30b1 memory corruption bug when editing trackers.
The problem was that the new number of trackers was not being kept and the old count was retained. So if the count changed, tr_torrentTrackers() could return dangling pointers to the caller.
2011-04-11 19:44:16 +00:00
Mitchell Livingston 2b79fd7186 #4175 fix typo 2011-04-10 16:26:55 +00:00
Jordan Lee e825bd66c7 (trunk libT) #4175 "very bizarre and unwieldly logfile in 2.30b2" -- fixed. 2011-04-10 14:15:52 +00:00
Jordan Lee e2b7728637 6789ABCDE 2011-04-10 05:27:14 +00:00
Jordan Lee d6dbf87652 (trunk libT) remove unneeded assert()ion 2011-04-10 05:22:18 +00:00
Jordan Lee 05b75e6e9f (trunk libT) use a better data struct for the tr_datatype list in peer-io 2011-04-10 05:21:51 +00:00
Jordan Lee 9b96ced90a (trunk libT) #4175 "very bizarre and unwieldy logfile in 2.30b2" -- another test commit for gunzip :) 2011-04-10 03:57:37 +00:00
Jordan Lee 42fbf1f646 (trunk libT) #4175 "bizarre and unwieldly logfile in 2.30b2" -- possible fix for gunzip to test 2011-04-10 00:05:18 +00:00
Jordan Lee bad3cb53a3 (trunk libT) #4173 "crashing with r12315 in Debian" -- apply patch from comment:8 for testing in 2.30b2 2011-04-09 14:36:33 +00:00
Jordan Lee 6a53f72481 (trunk libT) in peer-mgr's closeBadPeers() function, don't bother doing any of the setup/teardown calculations if the peer array is empty. 2011-04-07 20:15:49 +00:00
Jordan Lee 35eb016209 (trunk libT) use get_next_scrape_time() inside the scrape error handler.
get_next_scrape_time() was introduced in r12297. The rationale is that by rounding all scrape times to their nearest 10th second, they will tend to occur in batches and improve multiscrape.
2011-04-07 20:00:26 +00:00
Jordan Lee 4a5415e84c (trunk libT) #3931 "'Announce is Queued' but torrent doesn't announce itself to trackers" -- add more debugging information for the next announce interval when an announce error is encountered, as requested by Sardok in comment:70 of #3931 2011-04-07 19:54:30 +00:00
Jordan Lee 03666d2365 (trunk libT) #4173 "Crashing with r12315 in Debian" -- possible fix? 2011-04-07 06:56:31 +00:00
Jordan Lee 7cef8dc8a8 (trunk libT) trivial commit fixing typo in the comments from r12297 2011-04-07 06:54:03 +00:00
Jordan Lee 712ee263de (trunk libT) more heap pruning: avoid four unnecessary malloc() + free() calls per tr_peer.
This commit also changes tr_recentHistory from being a general-purpose tool to being a little more hardcoded for the only purpose it's used, in tr_peerMgr. If its files (history.[ch]) don't find any other "customers" in libtransmission, eventually it should be demoted to being a private helper class inside of peer-mgr.c and have the history.[ch] files removed from the build.
2011-04-06 23:27:11 +00:00
Jordan Lee bcec22eeb6 (trunk libT) remove an assertion from bitfield that doesn't always need to be true 2011-04-06 04:55:57 +00:00
Jordan Lee f37da42a8c (trunk libT) fix ABR error when parsing a URL with no path and no trailing slash after the host. Error reported by livings124 2011-04-05 22:21:18 +00:00
Jordan Lee 4694f95594 (trunk libT) more heap pruning: avoid an unnecessary malloc() + free() when reading PadD during an outbound encrypted handshake 2011-04-05 21:14:44 +00:00
Jordan Lee 758da07fe9 (trunk libT) more heap pruning: avoid an unnecessary malloc() + strcmp() + free() when parsing the initial handshake string from a peer 2011-04-05 18:16:21 +00:00
Jordan Lee b8d1bb3f6e (trunk libT) when processing errors in peer-io.c's event_read_cb() and tr_peerIoTryRead() functions, don't call tr_net_strerror() unless logging is turned on s.t. the string will be used. 2011-04-05 16:46:13 +00:00
Jordan Lee 3ba9796f4b (trunk libT) when processing an error in tr_peerIoTryWrite(), don't call tr_net_strerror() unless logging is turned on s.t. the string will be used. 2011-04-05 16:34:49 +00:00
Jordan Lee 46dd6f17ab (trunk libT) oops, r12313 committed the wrong version of list.c 2011-04-05 00:59:49 +00:00
Jordan Lee e0f6ade71e (trunk libT) keep a pool of reusable tr_list nodes 2011-04-05 00:56:56 +00:00
Jordan Lee 1e0f92ba78 (trunk libT) Use tr_strndup() instead of tr_strdup() in tr_urlParse() to avoid a couple of strlen() calls 2011-04-05 00:55:09 +00:00
Jordan Lee ac3ec2db39 (trunk libT) use alloca() for allocating the block array in updateBlockRequests() 2011-04-05 00:53:57 +00:00
Jordan Lee 85f853f214 (trunk libT) #4165 "crash on startup introduced in r12262" -- experimental commit 2011-04-05 00:29:42 +00:00
Jordan Lee c14b6bdf03 (trunk libT) remove redundant assert()s 2011-04-05 00:26:31 +00:00
Jordan Lee 492d208dc8 (trunk libT) remove unnecessary memmove()s from rechokeDownloads() 2011-04-05 00:24:25 +00:00
Jordan Lee 17894f258c remove unneeded include 2011-04-04 21:42:04 +00:00
Jordan Lee 94e11008b9 (trunk libT) more heap pruning: avoid an unnecessary malloc() + free() when encrypting outbound messages 2011-04-04 16:53:15 +00:00
Jordan Lee 40b2ad63d9 (trunk libT) avoid an unnecessary malloc() + free() call when we finish downloading a block.
Pre-libevent2, this free() was useful in helping keep the peer's incoming piece data buffer from growing too large because that could be a significant amount of wasted space given enough peers. However now that we're using the libevent2 code, that piece data buffer gets handed off to the block cache, so most of the time we're freeing an evbuffer that doesn't have any inernal chains allocated anyway.
2011-04-04 05:15:54 +00:00
Jordan Lee 525d854016 (trunk libT) when reading piece data in from a socket, avoid two unnecessary calls to memcpy() 2011-04-04 04:45:41 +00:00
Mitchell Livingston 3e451b2bf9 small cleanup when determining if two announce URLs differ only by scheme 2011-04-03 03:25:13 +00:00
Jordan Lee 5bee93361b (trunk libT) fix UMR bug reported by wereHamster 2011-04-02 23:33:51 +00:00
Juliusz Chroboczek 232075f547 Reinstate including tcp.h in net.c.
Removed in r12225, this broke netSetCongestionControl.
2011-04-02 16:43:17 +00:00
Jordan Lee 4a47e3c869 (trunk libT) don't bother calling rechokeUploads() and rechokeDownloads() on torrents which have no peers. 2011-04-02 08:35:47 +00:00
Jordan Lee 11c4194da8 (trunk libT) better multiscrape 2011-04-02 07:44:19 +00:00
Jordan Lee 0245703634 (trunk libT) tr_torrentGetFileMTime() used to require two stat() calls.. now it only requires one. 2011-04-02 07:36:34 +00:00
Jordan Lee e5a6641bda (trunk libT) tr_torrentFindFile2(): avoid an unnecessary malloc() + free() if the file we're looking for is complete and doesn't have a ".part" suffix 2011-04-02 03:31:41 +00:00
Jordan Lee 2328456a4a (trunk libT) simplify tr_torrent's hasAnyLocalData() to be more readable, and also to avoid yet another unnecessary malloc() and free() 2011-04-01 04:33:35 +00:00
Jordan Lee c54f469c39 (trunk libT) more malloc pruning. *yawn*
tr_metainfoGetBasename(): avoid an unnecessary malloc() + free()
getannounce(): avoid an unnecessary malloc() + free() per each tracker
2011-04-01 04:13:51 +00:00
Jordan Lee a2ee9f8d50 (trunk libT) avoid an unnecessary malloc/free in tr_urlIsValidTracker() and tr_urlIsValid() 2011-04-01 03:23:55 +00:00
Jordan Lee 0fffd84f65 (trunk libT) copyediting in resume.c 2011-04-01 03:13:44 +00:00
Jordan Lee 2e05d830e5 (trunk libT) streamline parsing the metainfo's file list 2011-04-01 03:09:24 +00:00
Jordan Lee cdabd1b5eb (trunk libT) since the JSON parser gives us the string's length, we can call tr_strndup() instead of tr_strdup() 2011-04-01 03:07:43 +00:00
Jordan Lee 873396de2d (trunk libT) announcer.c: fold the tiers and trackers into fewer mallocs/frees 2011-03-31 20:26:43 +00:00
Jordan Lee 65f0f3effd (trunk libT) copyediting: peer-io's "EncryptionMode" type had a name too similar to tr_encryption_mode... rename it to reduce potential confusion 2011-03-31 16:41:52 +00:00
Jordan Lee e6c0bdef6a (trunk libT) save 48 bytes per tr_torrent object. whoo! 2011-03-31 16:08:31 +00:00
Jordan Lee 1b02eb8641 (trunk libT) use aggregation for the tr_bandwidth objects owned by tr_session and tr_torrent 2011-03-31 14:53:22 +00:00
Jordan Lee 0c2dce9da7 (trunk libT) remove dead logic branch detected by clang static analyzer 2011-03-31 04:33:49 +00:00
Jordan Lee 0d593d3254 (trunk libT) fix "dangerous pointer arithmetic" warning detected by clang static analyzer 2011-03-31 04:24:57 +00:00
Jordan Lee d8e28ec284 (trunk libT) fix minor dead store detected by clang static analyzer 2011-03-31 04:03:07 +00:00
Jordan Lee bb561b5494 (trunk libT) fix ABR detected by clang static analyzer in tr_torrentStat.
When copying a value to s->errorString, it used memcpy(a,b,sizeof(a)) where sizeof(a) was larger than sizeof(b). Fixed by replacing the memcpy() call with tr_strlcpy().
2011-03-31 04:01:55 +00:00
Jordan Lee 5dd9b4a993 (trunk libT) fix potential UMR detected by clang static analyzer: maxPeers could be uninitialized in some pathological logic branches 2011-03-31 03:59:44 +00:00
Jordan Lee c8bec40e3f (trunk libT) fix potential null pointer dereference in announcer.c 2011-03-31 03:37:50 +00:00
Jordan Lee c7a43efc2b (trunk libT) fix file descriptor leak in tr-dht.c 2011-03-31 03:37:24 +00:00
Jordan Lee 210068410d (trunk libT) merge tr_bitfieldTestFast() and tr_bitfieldTest() 2011-03-30 04:23:20 +00:00
Jordan Lee 3660c44934 (trunk libT) handle situations where we don't know the bitfield's upper bound in advance. This comes up sometimes with magnet links. 2011-03-30 04:14:57 +00:00
Jordan Lee 3043893968 (trunk libT) fix endgame detection bug introduced in r12248 2011-03-29 22:02:27 +00:00
Jordan Lee 3e2aee0c02 (trunk libT) fix a crasher introduced yesterday in r12248 2011-03-29 21:10:20 +00:00
Jordan Lee 72c55fcdd8 (trunk libT) safeguard against a minor memory leak if io->sokcet couldn't be opened. 2011-03-29 21:09:37 +00:00
Jordan Lee 66d60160b3 (trunk libT) fix bitfield.c assertion failure reported by Rolcol 2011-03-29 16:39:30 +00:00
Jordan Lee 4230cd7786 (trunk libT) don't cache unininteresting peer addresses between sessions
For example, if we're both seeds, or if the peer is not connectible, don't bother caching it for the next session. If it's still alive, we'll find it up through DHT or tracker announces next time around. As with r12253, this commit's intention is to reduce the number of unproductive peer_atoms that we waste time trying to connect to.
2011-03-29 15:23:54 +00:00
Jordan Lee 9f122a021a (trunk libT) better scrape management on private trackers.
If a private tracker scrape says that there are no downloaders in the swarm, mark all the peers in the private swarm as seeds. This can greatly reduce unnecessary overhead on large seedboxes. We don't do this same trick on public torrents, since a public tracker won't know of all the peers.
2011-03-29 15:18:25 +00:00
Jordan Lee 5fcec12cfd (trunk libT) fix bitfield assertion failure due to invalid assumption in tr_bitfieldIsValid() 2011-03-29 01:47:17 +00:00
Jordan Lee 947134bbb3 (trunk libT) more completion and bitfield cleanup: (1) fix regression in tr_cpSizeWhenDone() reported by Waldorf, (2) make simple one-liner functions inlined 2011-03-29 01:17:18 +00:00
Jordan Lee 7445be9a53 (trunk libT) whoops, remove 4 debugging fprintf()'s from the previous commit 2011-03-28 16:33:40 +00:00
Jordan Lee 83c0e4f011 (trunk libT) break the mac build and introduce new crashes.
This is partially to address #4145 "Downloads stuck at 100%" by refactoring the bitset, bitfield, and tr_completion; however, the ripple effect is larger than usual so things may get worse in the short term before getting better.

livings124: to fix the mac build, remove bitset.[ch] from xcode
2011-03-28 16:31:05 +00:00
Jordan Lee 1101ba8d57 (trunk libT) strip trailing whitespace 2011-03-28 13:37:46 +00:00
Jordan Lee 6c845ba5f4 (trunk libT) fix memory leak in tr_utf8clean()'s utility function to_utf8() 2011-03-28 03:45:31 +00:00
Jordan Lee b54ebeafd7 (trunk libT) remove the tr_session argument from the announce/scrape response callbacks 2011-03-26 12:06:04 +00:00
Jordan Lee 9aafb0cb00 (trunk libT) minor code cleanup in announcer-udp: whitespace & function names 2011-03-26 10:22:25 +00:00
Jordan Lee eb06d81fb9 (trunk) fix a handful of small memory leaks that valgrind found. 2011-03-25 17:42:47 +00:00
Jordan Lee bd88521332 (trunk) yet more "#include" tweaks 2011-03-25 15:03:42 +00:00
Jordan Lee 1650a4730c (trunk libT) copyediting: yes, removing more unnecessary #includes 2011-03-25 06:20:12 +00:00
Jordan Lee 1b825079be (trunk libT) API cleanup of the tr_address functions to make them more consistent.
This is loosely related to #2910, but only in the sense of laying the groundwork for #2910's fix...
2011-03-25 05:34:26 +00:00
Jordan Lee 1304aa0079 (trunk libT) still fiddling around with #includes -- this time removing unncecessary libT includes from libT .c files 2011-03-25 01:41:57 +00:00
Jordan Lee 324f0f470c (trunk libT) copyediting: '#include "crypto.h"' cleanup 2011-03-25 01:21:31 +00:00
Jordan Lee 87ef45cf3d (trunk libT) copyediting: remove a bunch of seemingly-unneeded network headers in net.[ch].
I'm less certain that these are unneeded because networking APIs seem to have more variation between platforms, but it's better to remove the cruft and then add back whatever headers $PLATFORM users complain about, than to not remove the cruft at all...
2011-03-24 22:57:39 +00:00
Jordan Lee f7005889d1 (trunk libT) copyediting: clean up the "#include <event2/*>" directives in libtransmission's header files 2011-03-24 22:45:04 +00:00
Jordan Lee 375694eda9 (trunk) copyediting: remove some unneeded #includes, and annotate some needed ones 2011-03-24 21:49:42 +00:00
Jordan Lee bc213eb0e9 (trunk libT) If transmission.h is being processed by a C++ compiler, it shouldn't #include stdbool.h 2011-03-23 18:25:41 +00:00
Jordan Lee 949241a490 (trunk libT) tr_set_func is only used in one place, so make it a private function there instead of leaving it public in utils.h 2011-03-22 23:49:29 +00:00
Jordan Lee 48212fa0b9 (trunk libT) tr_strtruncd() is only used in one place, so make it a private function there instead of leaving it public in utils.h 2011-03-22 23:46:31 +00:00
Jordan Lee 14277760d7 (trunk libT) tr_set_compare() is only used in one place, so make it a private function there instead of leaving it public in utils.h 2011-03-22 23:42:25 +00:00
Jordan Lee 503035fa7e (trunk) remove unused gcc symbol: TR_GNUC_PURE 2011-03-22 23:37:20 +00:00
Jordan Lee e5143dbf9c (trunk libT) #4136 "r12181 causes excessive disk activity and logfile bloat" -- fixed. 2011-03-22 16:50:09 +00:00
Jordan Lee b4d36aeb54 (trunk) #4138 "use stdbool.h instead of tr_bool" -- done. 2011-03-22 15:19:54 +00:00
Jordan Lee e04a64ca02 test & see if xcode/osx has stdbool.h 2011-03-22 14:45:04 +00:00
Jordan Lee 0d45f8994a (trunk libt) more transmission.h copyediting 2011-03-21 17:08:10 +00:00
Jordan Lee 41238c6c5d (trunk libT) discard out-of-range reject messages from peers. 2011-03-21 16:42:32 +00:00
Jordan Lee bf4eb642dc (trunk libT) remove dead code: tr_sessionSetLazyBitfieldEnabled(), tr_sessionIsLazyBitfieldEnabled() 2011-03-21 16:33:16 +00:00
Jordan Lee 957732c5d0 (trunk libT) copyediting in transmission.h: fix some line wraps 2011-03-21 16:26:45 +00:00
Jordan Lee b9a508f9fe (trunk libT) remove unused configDir argument from tr_sessionGetDefaultSettings() 2011-03-21 16:22:39 +00:00
Jordan Lee a9f1c9a5a6 (trunk libT) tweak comments to fix inconsistent capitalization 2011-03-20 15:56:32 +00:00
Jordan Lee b16458e038 (trunk libT) #117 "UDP tracker support" -- fix add-UDP-tracker-URL-via-RPC bug reported by johnea @ https://trac.transmissionbt.com/ticket/117#comment:79 2011-03-20 15:42:54 +00:00
Jordan Lee 40defc8fb2 (trunk libT) #117 "UDP tracker protocol support" -- fix trivial r12141 log message typo: s/Unsupported ur/Unsupported url/ 2011-03-20 15:33:45 +00:00
Jordan Lee 3b9142f75e (trunk libT) #117 "UDP tracker protocol support" -- (1) fix connection attempt retries after a failed connection attempt. (2) extract method from tau_tracker_upkeep() for clarity: tau_tracker_send_reqs() and tau_tracker_timeout_reqs()
refactor the timeout/request code a bit.
2011-03-20 15:28:41 +00:00
Jordan Lee f996c4fbb9 (trunk libT) #4114 "crash on open r12168 in tau_sendto()" -- fixed. 2011-03-18 17:11:42 +00:00
Jordan Lee 6ae220dee0 (trunk libT) tr_udpParse(): default to port 80 for URLs with a udp scheme and no explicit port. 2011-03-17 21:22:58 +00:00
Jordan Lee f4b4ddd231 (trunk libT) better shutdown management of libutp and UDP trackers in tr_sessionClose().
This is a little overlapping since the utp code can be closed more-or-less immediately, but the udp manager needs to stay open in order to process the udp tracker connection requests before sending out event=stopped. Moreover DNS resolver can be shut down after the UDP tracker is shutdown.
2011-03-17 18:51:31 +00:00
Jordan Lee 78a4865aa1 (trunk libT) as a followup to r12182, move LPD's periodic upkeep timer into the tr-lpd.c module where it can be started & stopped with the pre-existing tr_lpdInit() and tr_lpdUninit() functions. 2011-03-17 13:16:23 +00:00
Jordan Lee 501f2e106f (trunk libT) move tr_lpdAnnounceMore() out of the announcer module
We can stop local peer discovery immediately during shutdown, but need to leave the announcer running for the event=stopped messages. So it doesn't make sense to keep them on the same periodic timer.
2011-03-17 12:45:29 +00:00
Jordan Lee 6835374661 (trunk libT) move tr_dhtUpkeep() out of the announcer module
During shutdown, we can stop DHT almost immediately, but need to leave the announcer running for the DHT tracker event=stopped messages. So it doesn't make sense to keep them on the same periodic timer.
2011-03-17 12:34:43 +00:00
Jordan Lee 686103ae49 (trunk libT) #117 "UDP tracker protocol suppoort" -- in case the tracker gives an error message in response to a connection response, store the error message in the scrape/announce response structs' errmsg fields. 2011-03-17 04:16:19 +00:00
Jordan Lee 13514e16a7 (trunk libT) #4127 "Torrent complete script doesn't pass on the environment" -- fixed with patch from geirha.
The fix was to putenv() the new environment variables, then call execvp() instead of execve().
2011-03-16 18:11:48 +00:00
Jordan Lee 374ed10f3b (trunk) it's bad form to #include so many system headers in libtransmission/utils.h... 2011-03-16 18:04:23 +00:00
Jordan Lee 30f8f499ed (trunk libT) move the single-use utility function "evbuffer_ref_cleanup_tr_free()" from a public header into a private function to limit its visibility/scope 2011-03-16 17:42:32 +00:00
Jordan Lee 29af00ef56 (trunk libT) make readOrWriteBytes() more readable 2011-03-16 04:44:38 +00:00
Jordan Lee 4844555f26 (trunk libT) remove the "a file disappeared!" check from readOrWriteFile().
In both the reading and writing case, this is handled with human-readable errors further up the call chain.
2011-03-16 03:19:56 +00:00
Jordan Lee 7f1a419dd1 (trunk libT) remove unused code from inout.c 2011-03-16 03:17:26 +00:00
Jordan Lee 330e922cc7 (trunk libT) minor tweak to the cache sorting code 2011-03-16 00:49:43 +00:00
Jordan Lee 757dac11ef (trunk libT) cpu load improvements based on profiling by gunzip 2011-03-15 18:11:31 +00:00
Jordan Lee 591b95286f Show whether a tracker is http or udp. Without that context, it could be confusing to see the same tracker twice in a tier 2011-03-15 17:03:09 +00:00
Jordan Lee fee784f1d8 (trunk) #4081 "Add 'cookieString' argument 'torrent-add' method in RPC" -- done. 2011-03-15 04:22:47 +00:00
Jordan Lee 15e2e7d491 (trunk libT) annnouncer.c: as discussed with Waldorf, massage the tracker lists a bit:
1. remove duplicate URLs caused by implicit vs. explicit port numbers
2. if two announce URLs are duplicates /except/ for their scheme, put them in the same tier.
3. try announce URLs with a "udp" scheme before trying ones with an "http" scheme.
2011-03-15 03:21:25 +00:00
Jordan Lee 297c24a8a0 (trunk libT) more announce.c work: better handling of incrementing the retry interval on scrape failures 2011-03-14 16:52:47 +00:00
Jordan Lee cc55286261 (trunk libT) #117 "UDP tracker protocol support (BEP #15)": (1) use the UDP tracker error response's error string (2) better handling of requests that timeout (3) better filtering of non-tracker UDP messages 2011-03-14 14:15:58 +00:00
Jordan Lee 6b682f8042 (trunk libT) make tr_ptrArrayNth() an inline function 2011-03-14 14:09:41 +00:00
Jordan Lee 46b85c7994 (trunk libT) more tweakin' 2011-03-14 02:40:39 +00:00
Jordan Lee 11e0883ee4 (trunk libT) fix array-bounds-read in the UDP tracker code when an announce or scrape request times out 2011-03-14 02:39:11 +00:00
Jordan Lee 4fc6c1ada2 (trunk libT) add attribution for the fallback tr_htonll() and tr_ntohll() code 2011-03-13 20:39:08 +00:00
Jordan Lee 58c084fbda (trunk libT) better implementation of tr_htonll() and tr_ntohll() 2011-03-13 20:23:23 +00:00
Jordan Lee cdff3aa090 (trunk libT) minor tweak: use evutil_closesocket() instead of the older EVUTIL_CLOSESOCKET() macro. 2011-03-13 19:47:21 +00:00
Jordan Lee e3fab720d1 (trunk) make sure all files with $Id$ has svn:properties set 2011-03-13 14:38:49 +00:00
Jordan Lee dc8e97eb43 (trunk libT) tweak #includes in announcer-http.c 2011-03-13 14:33:28 +00:00
Jordan Lee 4f6d031a9f (trunk libT) fix tau_send crash reported by Waldorf overnight in #4114 2011-03-13 14:18:35 +00:00
Jordan Lee 075a0a8b86 (trunk libT) use libevent's portability wrapper for strcasecmp() 2011-03-13 08:21:55 +00:00
Jordan Lee 4a4842fea5 (trunk libT) use libevent2's portability wrappers for inet_ntop() and inet_pton().
We currently implement our own versions of these on mingw because that platform doesn't have them... but why reinvent the wheel; libevent has already done the same thing. Let's use libevent2's implementation.
has already done it for us.
2011-03-13 08:15:40 +00:00
Jordan Lee 2cca699f06 (trunk libT) #117 "UDP tracker support (BEP #15)" -- added request timeout
UDP announce and scrapes now have a 120 second TTL.
2011-03-13 06:38:54 +00:00
Jordan Lee 7a24257d00 (trunk libT) tweaks by werehamster 2011-03-13 05:45:34 +00:00
Jordan Lee 5ad95ee3d5 (trunk libT) fix minor memory leak reported by rpc-server.c 2011-03-13 00:35:11 +00:00
Jordan Lee 3cfef5eded (trunk libT) #117 "UDP tracker protocol support" -- working implementation; needs testing and valgrinding and review. 2011-03-13 00:18:11 +00:00
Jordan Lee 76fdae97cb (trunk libT) #4106 "Assert in buildHandshakeMessage, r12131" -- probable fix 2011-03-11 19:28:44 +00:00