These are chat archives for anacrolix/torrent

Oct 2017
Oct 25 2017 06:08
anyone had problems compiling torrent with CGO enabled? I'm getting error from linker, like /go/src/ undefined reference to `operator new(unsigned long)'
Matt Joiner
Oct 25 2017 13:41
that should not happen. it looks like a c++ linker issue. what's the OS/arch?
at a guess i'd say something is messing with your compiler's flags, either from a Go library you're using, or an unusual compiler being used.
Bora M. Alper
Oct 25 2017 15:01

Hey, I'm trying to use torrent/bencode to decode BEP 9 messages and I have a problem:

To put briefly, the data messages, which carries the torrent metadata, are prefixed with a bencoded dictionary such as d8:msg_typei1e5:piecei0e10:total_sizei14223ee. After this prefix comes the info dictionary d5:filesld6:lengthi331597988e4:pathl36:Fizruk.s04.e01.HDTVRip.25Kuzmi (...).

I'm creating a bytes.Bufferand using bencode.NewDecoder to decode only the first bencoded dictionary but the decoder doesn't stop after the first one and decodes the second dictionary as well (I think). Although, the bytes.Buffer.Bytes() indicates that 4096 bytes are consumed every single time so it might be an issue with some kind of buffering mechanism inside bytes.Buffer or in torrent/bencode.

Any help would be greatly appreciated, much thanks!

Oct 25 2017 15:15
@anacrolix , that is with cross-compiler docker images, cross-triple and so on. I will try with xgo..
Oct 25 2017 18:23
looks better with xgo, bad it's only 1.8.3