Fix 4Gb limit streamed HTTP on Raspberry Pi 32bit (#1253)
Commitsf2198ccfacand4fcfe49bccare fixed 2Gb limit, but introduced 4Gb limit on Rasperry Pi 32 bit. This is because the max value of type `size_t` is `4294967295` on this system. Furthermore, the Standard Library use `std::uintmax_t` as a type of value returned by `std::filesystem::file_size`.
This commit is contained in:
@@ -43,11 +43,11 @@ private:
|
||||
};
|
||||
|
||||
/* Per socket event handlers */
|
||||
MoveOnlyFunction<bool(size_t)> onWritable;
|
||||
MoveOnlyFunction<bool(uintmax_t)> onWritable;
|
||||
MoveOnlyFunction<void()> onAborted;
|
||||
MoveOnlyFunction<void(std::string_view, bool)> inStream; // onData
|
||||
/* Outgoing offset */
|
||||
size_t offset = 0;
|
||||
uintmax_t offset = 0;
|
||||
|
||||
/* Current state (content-length sent, status sent, write called, etc */
|
||||
int state = 0;
|
||||
|
||||
Reference in New Issue
Block a user