Help - Search - Members - Calendar
Full Version: Using readers
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
Messer
I'm currently trying to play with some idea for a plugin, and it needs to retrieve data via http protocol (GET method). Can I use existing http_reader to perform this operation?

If the answer is yes, then how can I do that? How to check if http reader is installed and (generally) how to use readers?

TIA for any help.
Peter
reader * p_reader = file::g_open("http://blah.com/meh.php",reader::MODE_READ);
if (p_reader)
{
p_reader->read(blah,meh);
p_reader->reader_release();
}
Messer
Ah, thanks! That's easier than I thougt biggrin.gif
Messer
Is there any way to modify headers sent by http_reader?

freedb servers i tried seem to assume "Connection: Keep-alive", and retrieving data from them takes ages (~15 seconds). I modified http_reader code to see what happens if "Connection: close" header is sent, and all GETs became blazing fast. It would be nice to find some workaround with unmodified http_reader...
Messer
OK, I circumvented this problem by implementing my own reader based on original foo_http_read, but I just wanted you to know that the same problem applies to remote *.pls reading (foobar unnecessarily stalls for ~15 seconds when you drop any url from, let's say, shoutcast.com).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.