Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/alanmcgovern/monotorrent

The official repository for MonoTorrent, a bittorrent library for .NET
https://github.com/alanmcgovern/monotorrent

Remove the specialised endgame mode picker

efd7d5c8a1b94977f8457a7b0ff2413196446997 authored over 3 years ago by Alan McGovern <[email protected]>
Remove some of the custom IPiecePickers from the test harness

We can probably rely on an interceptor (PiecePickerFilterChecker)
and a StandardPicker to fulfil...

4cabe7ef2a9a721f09163b06327c794375888fbb authored over 3 years ago by Alan McGovern <[email protected]>
Aaand we've hit the payoff. Streaming picker is simpler

StreamingPicker can now be implemented as a PiecePickerFilter
rather than a full PiecePicker. It...

c099dfe6e84a7ab8d8b3cde43855625c7c50ef12 authored over 3 years ago by Alan McGovern <[email protected]>
Small cleanup

0f97b0ae523316ec79484bab8076cbbb7c61f752 authored over 3 years ago by Alan McGovern <[email protected]>
Move to struct

3d97773168137757fa2e1b8f0084220251119b44 authored over 3 years ago by Alan McGovern <[email protected]>
Flush

2fd0155cfb62c8351c37b9263e753cde111ead01 authored over 3 years ago by Alan McGovern <[email protected]>
More small tweaks and improvements. Green tests

887f5186b9e7e9e3589a33525b66253b2b06e07c authored over 3 years ago by Alan McGovern <[email protected]>
Small improvements

55c3a7ad9261710060101d91d0dcb44e21db4bdd authored almost 4 years ago by Alan McGovern <[email protected]>
Simplify

345d31c4230fb090973338f7309015642a4f902c authored almost 4 years ago by Alan McGovern <[email protected]>
Make PieceRequest a readonly struct

32afe1b4b63b9bcb4cd9f836b300263e5c63f67a authored almost 4 years ago by Alan McGovern <[email protected]>
flush

780b35f5c13b429124bd0b53b9a4e02dab53d5da authored almost 4 years ago by Alan McGovern <[email protected]>
Moar

7b4abaee18215bdd24588a1396edd3145e4c54d7 authored almost 4 years ago by Alan McGovern <[email protected]>
fix another test

ef310e43901da46aa5d70a833912e01d2ff3a00a authored almost 4 years ago by Alan McGovern <[email protected]>
next batch of cleanups

97fe724c3ce9c581d408a119406a9f54876a0258 authored almost 4 years ago by Alan McGovern <[email protected]>
tweaks

884638af2bcbbb5f5452b9c69136e69f4aaff240 authored almost 4 years ago by Alan McGovern <[email protected]>
Flush - it compiles

2210c656f504a500ba1dc29d5bb93bfbe0b5c4a4 authored almost 4 years ago by Alan McGovern <[email protected]>
next set of wip

34cad69ca6b98740fbf0f7d744b081a2111b4086 authored almost 4 years ago by Alan McGovern <[email protected]>
add a time based 'tick' which will be invoked by the engine

33ee11687cf15a7ef9601b8458a43ddda33d4588 authored almost 4 years ago by Alan McGovern <[email protected]>
WIP

867bdd8df308a29a1dc0245c86c0732f9cf564e8 authored almost 4 years ago by Alan McGovern <[email protected]>
Refactor the IPiecePicker interface for easier implementation/usage

The idea is to:
1) Make it easier for the engine to indicate when a peer should be
used to downl...

2b6e5f871c209d3b21c7a70dfcc1723a4315a8b5 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Ensure the EncryptionTypes.Remove is immutable

The return value is guaranteed to be immutable (again).
The previous commit returned the input p...

b11af276ac8e1177d1cbd3a1040cc04c58dabb3c authored almost 4 years ago by Alan McGovern <[email protected]>
Fixed ArrayIndexOutOfBound exception when peer allowedEncryption list is empty

c55939853b11b1fd191e3a1e48732571f6567e79 authored almost 4 years ago by AN3O <[email protected]>
Added CreateSubFolder property to TorrentSetting (if set to false root folder will be not created for multi-file torrent)

ec0f0390b2cd5a253ebf0f61ca40d5084b4728e0 authored almost 4 years ago by AN3O <[email protected]>
[core] Betteri StreamingPicker cancelling after seeking

When we seek to a new location in the piece picker we want
to cancel any pending requests and im...

aeb10057776dde90b4c836f8034989f26755ae72 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Simplify some of the Block API

There's (currently) only one way to request or cancel
a piece, and that's calling CreateRequest ...

1f16f599165de342f374e1ecc9123a1544a05717 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Expose the peer's Uri when piece picking

It's helpful if you ever want to compare against the
list of ConnectedPeers.

674e80069494a119bd6970f9c58bd4d6fca78c54 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Add another logging overload for future use

69e9b1deb028cd7a6db1ac6ab63e51bcb6b4cefd authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Close connections for peers who don't send data

If a peer sends data slower than 1 block every 15
seconds we should close the connection.

64eedb30f33b71b727ac304ba7b078e64575d6cd authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Download at least the last two pieces when prebuffering

If we download just the last piece it may not actually be enough
data. The last piece could be a...

f9ef3caca27dd81c02a54a7704c52dadc79c3ecd authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Make LocalStream sleep a little less

This will make things a little faster maybe.

3bffad4174105422801c7701beb98ebd18b9b271 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Don't reconnect to peers which rejected every connection

e42927c1c25419d5a9d0cbdb4cfa325b3082f181 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Some further tweaks to the streaming piece picker

Improve 'ContinueAnyRequest' to support prioritising the
high priority pieces over low priority ...

f8defa9e43a55903df60c8aa391e07202375b630 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Exclude earlier pieces from the low priority set

The streaming picker is intended to be forward-only, so we
should exclude pieces which come befo...

7a36df4e0993bb11ff4daa4d1ba75a1378e2c7be authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Handle peers who do not have metadata yet

If a peer does not send the 'MetadataSize' key it
means they do not have metadata to send us. We...

785ae70f39367894ea6b3443eddf5d00018844e2 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Eliminate a harmless NullReferenceException

It's not impossible for the connection to be disposed
before we reach the Socket.Connect call.

...

51828084315b766118ca77cf705ce370e0242cc9 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Allow prioritisation of encryption methods

The encryption spec does not allow the initiator of the
connection to set a preference. As such,...

a94db0fd627a4272576e0315b7c98bcb9ebc5206 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Only healthy peers can continue existing blocks

If a block is abandoned, only peers which have not been involved
in hash fails should be allowed...

d07e180c60c2a5d85519d0c9f0da772bf312e045 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Mark pieces as abandoned, not blocks

It's simpler all round to mark pieces as abandoned instead of
monitoring this on a block-by-bloc...

e0f332390f26239957846e8d6b761f61cf1f0293 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Disconnect peers who time out fulfilling piece requests

If we request a piece and it is sent at less than 1kB/sec we
should simply disconnect the peer. ...

6acce74e48c32ee22a16cb1d448e8084eca9547b authored almost 4 years ago by Alan McGovern <[email protected]>
[core] High priority pieces can be downloaded from multiple peers

This is less efficient as data can arrive out-of-order which
means we'll write data to disk, the...

c44d480c01845623e6c415c8dad212866c50def4 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] If the peer chokes us, they implicitly abandon partial pieces

We know the peer will not supply any more data if they
choke us, so we can treat those pieces as...

5bf8152ac95c66ea0959101dec99ef1b2001b3a9 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Fix to compile warnings

They were annoying me :p

fc7d9226a0d0b12e6d923fd3f1c352eabc88aaaf authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Make it easier when profiling release builds

Don't write all log statements to the console in release
mode as it makes it a bit harder to per...

478c3412a2e4dcb1253f846c5002672fcc144755 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Remove some code which isn't supported

927fb1b0db9129fd21bcb0a2b5d9f7e8cc4eb585 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Use DiskManager to safely read the torrent data

The DiskManager implementation may, or may not, use a
memory cache. As per comment in the code -...

974fb7a984b93ff391e9ed08b8671a0650aa24c5 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Flush the DiskManager before reading data

It would be incredibly complex to support a scenario where some
parts of a single read are in th...

c1b736744346177717f73a91d718fd1f4073ee62 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Reset the position to 0 after pre-buffering

We shouldn't rely on the media player receiving the data
to seek to the start of the stream befo...

788d7b2bb7e532e984714f4d0ad9919670e5c9b6 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Return zero if we read past EOF

Some APIs deliberately read until 0 is returned, such
as Stream.CopyToAsync.

8b3ecc2db526d4833d0af849666bccac6bc723d6 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Allow any peer to continue an abandoned piece

If the peer who was downloading a piece has been disconnected,
treat the piece as abandoned and ...

0b39e6ed3e9f74346d7d98e62fc49f5f62d5e7c0 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Small optimisation to avoid excessive cancelling

If we seek to the same piece we're already in then we don't
need to cancel pending piece requests.

a097188c8af6bdcf2f3d14a86aa23e6a4223f1b1 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Improve flushing for the tests

The tests don't necessarily run a main loop which ticks
the DiskManager to process queued writes...

23c43478359f17cffdcb5ea7bb2bec1138169340 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Flush pending data to disk when downloading completes

When we've downloaded all the data we intend to, flush the
data to disk before changing to 'Seed...

e54958161d3ad2bdaf9b47babe8b97a0074f5ca5 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Update MemoryWriter to be async safe

We cannot iterate over 'CachedBlocks' and use
an await unless we write our code so that it
is aw...

5a1c30d12d02b975208edd17e1c9d919d299cc0f authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Fix some racey tests

Don't bother creating a real Udp based DhtListener for the tests
as we never acutally use it.

T...

2988b36bc44cda53af992dead6acc08a6b480885 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Lock fewer times when iterating the main loop

Use two queues to allow tasks to be processed with
fewer locks.

By swapping the queue object we...

af92c101f1ddee33eb342b8e54e46882702496e0 authored almost 4 years ago by Alan McGovern <[email protected]>
[tests] Async-ify these tests

b5f2e24a6b9c81dfc3a093f4495ac42febed1659 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Use 'UpdateSettingsAsync' consistently

9480b8614c780e88e5e6868bf4a5db47e1e4af21 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Be a little more threadsafe with ITorrentFileStream

Change around ownership of the Semaphore used to control
access to the streams (again).

There w...

2df35f606cd056b50c0faf23667e0973c65838cf authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Ensure UsageOrder is updated

When we use a Stream we now update it
in the usage order :)

ac5de2a9d4b659d71a25e68902d68377c746ebf4 authored almost 4 years ago by alan.mcgovern <[email protected]>
[core] Flush a piece to disk once it's 'read'

If we have a piece in the disk cache and we 'read' it,
we can be reasonably certain the engine w...

ab1d002520fb813ffc9a951169f66e8f45f82742 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Default to using a 5MB disk cache

Defaulting to using a MemoryCache should improve performance
when Blocks arrive slightly out of ...

9adeb26d221713ba073d4168848aa5d6e7a4500c authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Trigger EndGameMode when 'ContinueAnyExisting' gets no pieces

The new semantics make it better to enter endgame mode when
ContinueAnyExisting returns null rat...

7805976c701f9862684fc028414e21bc8b321d95 authored almost 4 years ago by alan.mcgovern <[email protected]>
[core] Improve 'ContinueAnyExistingRequest'

Now we only try to continue an existing request if the
peer has been unable to select one normal...

5dc3df21de13bb611d9dd5b03a4147e448fdc646 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Swap to a more efficient SemaphoreSlim impl

This allocates far less than the built-in implementation
so it's a net win for monotorrent. The ...

f9b70b5bd96ce939ce1cfc8c5106d7233af062db authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Use named parameters for EngineSettingsBuilder.ToSettings

This makes it less likely there'll be a bug later on.

12eddf34c978022a3436c630cc201fbce1d89fc5 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Add two missing settings in ClientSettings

Urgh. Oops.

Thanks to jpmikkers

0f161b43e13148da5e52799020bdddae87804723 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Consolidate the 'Rented' and 'Locker' properties

The filestreams we use to read/write data from disk are now
protected with just a SemaphoreSlim....

bbc72b8a26097ab3a209ed9fb5fedb2d4d8bfb55 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Pad the version number

This is to ensure that alpha versions are strictly monotonic
when sorted as strings, as per spec.

e6025d9d4c9654b22abce2c5cc6c295f2c6c3c68 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] LocalPeerDiscovery is now an EngineSetting

Also a bunch of misc cleanups to make the whole thing work.
I was too lazy to proper separate ou...

fe44dff018292ed5269cded4e4384c3679bf1cdb authored almost 4 years ago by Alan McGovern <[email protected]>
Add a null peer listener now that we support -1 to disable

bb552cfbf5dff1ff862766913447d6475a3d7321 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Propagate the immutable Settings around

9e49422ae36ebf254fc3c475c95c7446b043d5f2 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Add Builders for Torrent and Engine settings

If the Settings objects were immutable and users had to
pass in a new Settings object whenever t...

825432f5e255113f0081945000198dc336ad89f6 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Fix a threading issue in FlushAsync

We should ensure we're executing on the IO thread
when we're interacting with the filestreams.

...

ec3c8ebeba31ef71930f7c5a102df41171110b52 authored almost 4 years ago by Alan McGovern <[email protected]>
Prepare for unstable/alpha releases of 2.0

We can start issuing unstable nuget packages for
people who want to live on the edge!

Will have...

6bbd8ad9ef61e24c318d923b6e54a815a966269a authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Generate a proper file path as the fallback

The API expects this to be the path to a specific file,
so when we autogenerate a value ensure w...

09c1860bb6cae48eb63a4ebbd177bc6f315e7cd1 authored almost 4 years ago by Alan McGovern <[email protected]>
using the modern pattern match syntax (#347)

Co-authored-by: guangzhi.wu <[email protected]>

f875ae639c3e9c8872839895409788c00982f30a authored almost 4 years ago by OneFingerCodingWarrior <[email protected]>
[core] Ensure 'torrentSave' is made a full path too

9da0f30f86406aa889ee15a267c956530feca359 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Compute the correct infohash for misordered dictionaries

If a BEncodedDictionary has been encoded with the keys in the
wrong order, we will now compute t...

e1174030b5fcbd262ddf387d62416bb08339dee5 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Start/stop local peer listener with the Engine

We should tie the lifespan of the local peer listener
to the engine it's registered with.

If no...

e7c64febdc415923f6ad93c587a66c0b08498d9a authored almost 4 years ago by Alan McGovern <[email protected]>
[dht] End GetPeersTask when we find enough peers

Add an early exit to this task. If we find at least 128 peers
we should stop sending further que...

52bdb581afaff9a2750b244235ccbac1271340c8 authored almost 4 years ago by Alan McGovern <[email protected]>
[dht] Allow peers to be added implicitly

It's better to add peers to the table by virtue of them responding
to a message we've sent. Do n...

b2ffedd24527932c77ee0302906fc5592524a726 authored almost 4 years ago by Alan McGovern <[email protected]>
[dht] Allow the Initialization task to complete early

We now allow the 'Initialization' task to indicate it has
completed before it has fully inserted...

95f8796dbf868ae3ea2a5e29b4fe004a8525bf6f authored almost 4 years ago by Alan McGovern <[email protected]>
[dht] Simplify the initialization code

Have one codepath for initialization which ensures the
state is updated consistently.

d76c42f4518fe35dd8ca5963803ec4d0893f35e9 authored almost 4 years ago by Alan McGovern <[email protected]>
[dht] Only emit the state change event if the state changed

4f30808b3feadd5c5219fbd712ab2ecc2cf56b6a authored almost 4 years ago by Alan McGovern <[email protected]>
[dht] Remove an unnecessary DhtEngine.Add call

When we send a FindNode message to a torrent, we do
not want to add *every* node to the DhtTable...

864ba9476e363bced5a45d97bc4acc182f965370 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Fix webseed support

This clearly needs better tests, or even any tests at all :p

Improving the integration tests to...

50345740b44ee80135cc5ac6efd81747bf4cb171 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Remove an unnecessary await

Every await can add overhead, so let's avoid
awaiting something if we don't need to!

7abfe25a81106ac5f91c657ebfaf725a2c3a6d33 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Use Monitor.Wait/Pulse for main thread sync

It's a little simpler than the original code which
used a manualresetevent.

520ec0b8b1d49472f6c9ef319a0cd1b33db5168f authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Remove some unneeded sanity checks

The tests cover this completely so we can simplify
things by removing the code which attempts to...

4ac5c70aa685cbce186f465400b3e16bb64c3994 authored almost 4 years ago by Alan McGovern <[email protected]>
fix problem with unreliable and slow local peer discovery on systems with multiple network interfaces

861d0b2315210ec2676bac48df9d2044cc6e4a47 authored almost 4 years ago by Konst Kolesnichenko <[email protected]>
[sample] Update the .net core sample to 3.1

76766537d14d87c8c5c4ecef20bcf9b05720b792 authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Remove RawReader.PeekByte

Nothing uses this nowadays

c1b6ceb401141ce76e91b44c246a6a005621378e authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Fix a couple of additional metadatamode races

Firstly, don't reset the stream every time we connect
to a peer who supports metadata mode. That...

e710d5562ecde3ed4eb415f7ec6cebd786132e2a authored almost 4 years ago by Alan McGovern <[email protected]>
[core] Disambiguate logging statements

Previously we'd emit the log line
'connected to self' if we actually had too many
active connect...

1653c5634da9a7cb22447ca19b470e89253d8f5b authored almost 4 years ago by Alan McGovern <[email protected]>
Fix moving unfinished, stopped torrent.

1dd7bfbbba4f4af84a62c5639e283c64c280c013 authored almost 4 years ago by shc <[email protected]>
[tests] Remove one test target

I only really need net472 and net2.1. That'll test all
relevant codepaths. Might as well include...

e33ed734d5f323b7c64fde266e8317beed6596ef authored almost 4 years ago by Alan McGovern <[email protected]>
Accept hybrid v1v2 uri

3301c8e727e035616b551896f671332f2afd66d7 authored almost 4 years ago by jpmikkers <[email protected]>
exception message spelling

fc53fa81ded19256a6d8308f59ae6a0598e58067 authored almost 4 years ago by jpmikkers <[email protected]>
[core] Specify max versions for nuget deps

Ensure the packagereferences are restricted
to use a version of the nuget dependencies
which are...

4f44df732797dc796eeeb9abbbd11c7edeca55ef authored almost 4 years ago by Alan McGovern <[email protected]>
Fix this test

We require the full path to the file where the metadata
will be written to. Let's not make guess...

6683e91ad4cad61e547626a1dda38bf0d522d019 authored almost 4 years ago by Alan McGovern <[email protected]>