diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-19 20:48:09 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-19 20:53:18 +0300 |
commit | 6be5bc707876ece1cd09d7c304ba559512ef5257 (patch) | |
tree | 2287f09e4cc21f3d4e07bc6faf62543921822b2c /web/module | |
parent | 01adb23a543bc4c83ef9570117692261e88f61cd (diff) |
Implement request body caching
Diffstat (limited to 'web/module')
-rw-r--r-- | web/module | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -11,6 +11,7 @@ #include <iosfwd> #include <chrono> #include <cstdint> // uint16_t +#include <cstddef> // size_t #include <utility> // move() #include <stdexcept> // runtime_error @@ -111,13 +112,21 @@ namespace web virtual const name_values& cookies () = 0; - // Get the stream to read the request content from. If the buffer argument - // is false, then reading content after any unbuffered content has been - // written or after a retry is undefined behavior. The implementation may - // detect this and throw sequence_error but is not required to do so. + // Get the stream to read the request content from. If the limit argument + // is zero, then the content limit is left unchanged (unlimited initially). + // Otherwise the requested limit is set, and the invalid_request exception + // with the code 413 (payload too large) will be thrown when the specified + // limit is reached while reading from the stream. If the buffer argument + // is zero, then the buffer size is left unchanged (zero initially). If it + // is impossible to increase the buffer size (because, for example, some + // content is already read unbuffered), then the sequence_error is thrown. + // + // Note that unread input content is discarded when any unbuffered content + // is written, and any attempt to read it will result in the + // sequence_error exception being thrown. // virtual std::istream& - content (bool buffer = false) = 0; + content (size_t limit = 0, size_t buffer = 0) = 0; }; class response |