[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] Re: [PATCH] evhttp getting connection's output buffer length
2011/3/8 Jakub Paweł Głazik <zytek-lists@xxxxxxx>:
> W dniu 28 lutego 2011 13:54 użytkownik Jakub Paweł Głazik
> <zytek-lists@xxxxxxx> napisał:
>> Hello,
>>
>> I'm using libevent in a streaming application. Because in a streaming
>> scenario content length is infinite I have to check how much data is
>> queued per client and disconnect ones that aren't able to fetch data
>> due to throughput issues (MPEG streaming). As far as I checked evhttp
>> doesn't provide a way to get connection's output buffer length.
>
> [...]
>
>
> Any thoughts on this ?
I'm of two minds here. I understand why you'd want it, but I worry
that if we do this, we'll eventually wind up needing to expose more
and more of the underlying bufferevent. Then again, exposing the
bufferevent itself sounds like an abstraction layer violation, so
maybe it is best to just let the user see the amount of data that's
waiting to get flushed...
... but come to think of it, we're going to need to expose the use of
bufferevents anyway in order to do any sane implementation of https
(ie, we need to let the programmer specify a bufferevent factory that
gets used for htttp connections, and once we do that). But back on
the other hand, we probably don't want to expose the bufferevent
object that's getting used by an actual connected evhttp connection.
Tricky stuff.
Anyways, if we do go with this, I think for the name we want something
like evhttp_get_outbound_data_length() or something: mentioning an
internal data structure in the API name is a recipe for API names that
we will regret in the future. Also, the documentation needs to spell
out what exactly the user can depend on upon about this value.
yrs,
--
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.