jeremy-ellis-tech / net-ipfs-http-client

.NET API client for the InterPlanetary File System (IPFS)
MIT License
78 stars 15 forks source link

Fix for issue #21 - IpfsClient.Cat("...") throws OutOfMemoryException #22

Closed timothyparez closed 7 years ago

timothyparez commented 7 years ago

Get the Stream from the HttpClient and return it directly as opposed to downloading everything into a HttpResponseMessage first.

In order to do so I added ExecuteGetStreamAsync methods and tried to
follow the original structure as much as possible.

I included a test that generates a large file, adds it to IPFS and then tries to download it.

jeremy-ellis-tech commented 7 years ago

The test could be improved upon. Currently it requires an Ipfs server running on the default port. A mock reponse could be used instead like this: https://github.com/TrekDev/net-ipfs-api/blob/master/src/Ipfs.Test/ClientTests.cs#L25