Diego Giagio wrote:

> The throttler interface may be the following:
>
> throttler.h/throttler.c
>  cherokee_throttler_new()
>  cherokee_throttler_free()
>  cherokee_throttler_check()
>  cherokee_throttler_update(bytes_recvd)

  Yeah, looks good :-)

> To enable the throttler we could create wrapper functions around
> cherokee_write, cherokee_read, cherokee_socket_* on
> connection.c. Eg.  Every time cherokee_write is called, the
> throttler is checked and if it's not okay we could return EAGAIN
> (ret_eagain). Otherwise we do the write and update the throttler.

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

==========
  do_send = true;

  if (throttler != NULL) {
     cherokee_throttler_check (throttler, ..., &do_send);
  }

  if (do_send)
     cherokee_connection_send();
==========

  What do you think?  In this way, we can keep the socket class
  independent of the bandwidth throttling thing.

> I'm sure i'm missing a lot of things, but that should be enough for
> the list to start talking about. ;)

  Sure! There will come up lot of these things. :-))

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

Reply via email to