You are not logged in.

#1 2010-11-02 20:26:09

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

[solved] fatal error from libarchive while reading curl stream

I'm a bit stuck on this one. Consider the following code that I've put together:

http://gist.github.com/660213

It can be compiled as:

gcc -lcurl -larchive curl-archive.c -o curl-archive

Basic premise is that curl is used to download a taurball, and libarchive is used to decompress the stream as its downloaded. Works great for just about every package I can think of, except...

$ ./curl-archive libxft-lcd
archive error: failed to open memory for reading
curl error: Failed writing received data to disk/application

libarchive throws that error when trying to "open" the memory that curl reads off the http request. I haven't found any other packages that this happens with, but there may be more. To make things weirder, if you change the #define URL to use https, it works without fail.

valgrind doesn't show anything strange going on. gdb doesn't reveal any weirdness. Anyone have any idea what's going wrong?

Last edited by falconindy (2010-11-03 00:25:55)

Offline

#2 2010-11-02 21:29:46

toofishes
Developer
From: Chicago, IL
Registered: 2006-06-06
Posts: 602
Website

Re: [solved] fatal error from libarchive while reading curl stream

You're making terrible assumptions. smile

It only happens with bigger packages (try kernel-eeepc-901 for something else that is broken). This is likely because you are trying to read only the first block you get back which is 1224 bytes for me on libxft-lcd; the whole tarball is actually 6275 bytes. This might present a small problem.

Offline

#3 2010-11-03 00:26:22

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [solved] fatal error from libarchive while reading curl stream

terrible assumptions are what keep me thinking that i have a reasonable grasp on reality. thanks for the binary bitchslap.

Offline

Board footer

Powered by FluxBB