New project: Bittorrent library - Community & Forums Related Discussions
(09-10-2017, 02:36 PM)z3bra Wrote: We reached a milestone here! libgbt can up/download torrents, with multiple peers. It can accept new connections as well (when seeding only for now).
Basic functionality being there, let's fuck it up and rewrite some bits! Here is what I'm not happy with, or what I want to add/improve:

z3bra,

Do you have a test suite set up? It would make things (like fucking up the API to make it easier to use) a little bit safer.

I can help with writing those tests if you like; when it comes to small C projects I would usually go for just some executable that links to the library and calls assert() a bunch.
It had tests at first, for internal functions (bencoding related mostly). Now that only the API is accessible I don't see the point for tests. What would the test do? Download a file, and checksum it? you'd depend on access to the network here. Another idea would be to use a local tracker, spawned for the tests. Not really helpful either...

I wanted to have tests at first, but the simplest way to test is to do it manually at this point.

But I must admit I suck at writing tests, so if you have an idea, please speak up! :)
Thanks again for opening your thoughts on this project to the community.

(06-08-2017, 06:40 PM)z3bra Wrote: This would also use a shitons on inodes, but that's not the biggest issue.

Code:
$ doas find / -type f -exec du -k {} + | sort -n | awk '
    {
        current++;
        expected += $1 / 8 + 1;  # with 8 kB per block
    }

    END {
        print("current: " current);
        print("expected: " expected);
        print("ratio: " expected / current);
    }
'
current: 332455
expected: 8928090
ratio: 26.855

About 27 times more inodes in my case.

Code:
$ df -kih
Filesystem     Size    Used   Avail Capacity iused   ifree  %iused  Mounted on
/dev/sd0k      298G   60.2G    223G    21%  160449 19580221    1%   /home

8928090 / 19580221 = 46%
currently used space = 21%

With a size of 8kB per block, with my current setup, I would run out of inodes before I run out of space. You are right. :-)




Members  |  Stats  |  Night Mode  |  Help