Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Using readers (Read 3686 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Using readers

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.

Using readers

Reply #1
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();
}
Microsoft Windows: We can't script here, this is bat country.

Using readers

Reply #2
Ah, thanks! That's easier than I thougt 

Using readers

Reply #3
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...

 

Using readers

Reply #4
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).