Nixers project: Bittorrent library - Community & Forums Related Discussions
z3bra
Hello fellow nixers!

I just started a new project, and though it would be great to involve more people in it!
this project is a bittorrent library in C, as there doesn't seem to be much out there (even though many people reimplement the protocol over and over). Here is a link to the project:

http://git.nixers.net/libgbt

The goal is to implement the full BTP/1.0 RFC and add on top of that the ability to handle the DHT protocol.

I know it might sound like a big project for some of you, but it is a good occasion to get started with C, or in a collaborative project!

Who's up for it?
BANGARANG, MOTHERFUCKER
r4ndom
I would love to, but I have currently exams until mid-August.

After that I'm trying to catch up and help :)
Tmplt
Cool! Is the plan to extend synk(1) with this?

I'm definitely up for it. It's about time I learn C.
z3bra
That's the plan, but the library will be an all-purpose lib, so we'll write it without thinking about synk(1) :)

I started writing a bit of code, be sure to check it out!
Tmplt
I did, but I believe I need to (at least) skim through the RFC.

Is "gbt" an abbreviation for grizzly bittorrent?
z3bra
(30-07-2017, 07:31 AM)Tmplt Wrote: Is "gbt" an abbreviation for grizzly bittorrent?

Indeed!

My plan was to implement the RFC from top to bottom, so I started with bencoding.
I didn't bother much checking the rest of the RFC.
Tmplt
(30-07-2017, 09:15 AM)z3bra Wrote: My plan was to implement the RFC from top to bottom, so I started with bencoding.

That's a smart way of doing it. I'll see if there is anything I can do when I have access to my computer again.
z3bra
I started writing some tests for the bencoding_parse() function, but they're not reoiable enough, so it might be a good idea to write the tests first.
z3bra
The library can now parse integers, strings and lists in "Bencoding" format (check the RFC).
I added a test case as well, which reveals a segfault whenever an incorrect char is parsed (this should be fixed obviously). I also don't free a single bit of memory yet (I know, I know...), so we need a proper way to free a whole bencoding data struct.

Something hard as well: NAMING. functions are "bencoding_*", variables/types "be*"... We need consistency, but I don't feel like using the full format name for variables. It will become unreadable.
As the next sections are THP and PWP, I was considering "ben" as a prefix for everything. I'm just wondering if that makes sense...
venam
(30-07-2017, 08:45 PM)z3bra Wrote: I also don't free a single bit of memory yet (I know, I know...), so we need a proper way to free a whole bencoding data struct.
Have you thought about including a simple garbage collector such as libgc ( http://www.hboehm.info/gc/ ). It might not be as flexible as freeing the memory manually but it's still handy.




Members  |  Stats  |  Night Mode  |  Help