Diego Giagio wrote:

>>   I have not looked at it deeply, but I would do something
>>   like.. where there was a cherokee_connection_send() call, do:
>>

  [.. code ..]

>>
>>   What do you think?  In this way, we can keep the socket class
>>   independent of the bandwidth throttling thing.
>>
>
> That's a nice approach. The only downside I can think of is repeating
> that piece of code every place a *_send or *_recv function is called.
>
> Let me try explain a bit better what I was talking about. The wrapper
> functions i proposed wouldn't be created on the socket class, but on the
> connection class (connection.c) and they would be static. I mean, eg.
> instead of writing:
>
> ret = cherokee_write (cnt->socket, buf->buf, buf->len, &written);
>
> We would write:
>
> ret = conn_write_buf (cnt, buf, written);
>
> The function conn_write_buf, would:
>
> - Check the throttler
> - Call cherokee_write
> - Update the traffic counter (cherokee_connection_tx_add)
> - Update the throttler

  [.. code ..]

> What do you think about it ?

  Good stuff!

  I completely agree.. :-)

--
Greetings, alo.
_______________________________________________
Cherokee mailing list
[email protected]
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee

Reply via email to