#59 bufferevent: allow to specify max_to_write_ever & max_to_rea

API
closed
nobody
General (24)
5
2011-10-11
2011-10-10
No

In some cases it is needed to specify maximum values of data sizes for each write() / read() calls. For now, there are hard-coded limits MAX_TO_WRITE_EVER & MAX_TO_READ_EVER.

I've added bufferevent_set_max_to_write_ever() & bufferevent_set_max_to_write_ever() functions allowing to change those limits. MAX_TO_WRITE_EVER & MAX_TO_READ_EVER are still absolute limits though.

Discussion

  • Nick Mathewson
    Nick Mathewson
    2011-10-10

    Good idea, let me suggest some changes.

    First, "max_to_read_ever" is no longer a good name if it can be changed; I'd suggest max_single_write and max_single_read or something.

    Second, the functions in bufferevent.h need documentation.

    Third, MAX_TO_READ/WRITE_EVER should no longer need to be upper limits here; I think they should only be defaults.

    Other than that, looks good.

     
  • Nick Mathewson
    Nick Mathewson
    2011-10-10

    (oh, fwiw, I am going on vacation for a week soon, so please forgive any delay in a reply)

     
  • OK, please look at the rewritten patch: 0001-bufferevent-Add-functions-to-set-get-max_single_read.patch

     
  • Nick Mathewson
    Nick Mathewson
    2011-10-11

    • status: open --> closed