[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] evhttp: Abort after receiving a certain number of bytes



Hi,

Is there some way to tell evhttp (in libevent2) to abort a request once it has received more than <x> bytes of data?

I'm writing a small utility with a simple job of fetching a '<title>' from a HTML page and want to make sure my utility does not end up on a site that decides to send it several megabytes of data.

Sending a 'HEAD' request and fetching the 'Content-Length' header only seems to work for static pages and not for dynamic pages as they output data on the fly and have no idea how big the content will be.

So, I think ideally I'd have some way to tell evhttp to abort once it either received the <title>..</title> or once it has received a maximum number of bytes and then return all data it has received. Either would be great.

Is this possible somehow?

Cheers,
Bas
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.