diff --git a/src/server/download.cxx b/src/server/download.cxx index d0afb07..3232ff4 100644 --- a/src/server/download.cxx +++ b/src/server/download.cxx @@ -1,9 +1,8 @@ #include #include #include -#include -#include #include +#include #include "../util/miniz.hxx" #include "server_internal.hxx" diff --git a/src/server/upload.cxx b/src/server/upload.cxx index 0931e23..c0102bc 100644 --- a/src/server/upload.cxx +++ b/src/server/upload.cxx @@ -1,22 +1,13 @@ -#include +#include #include #include #include #include #include "server_internal.hxx" -static constexpr std::size_t chunk_size = 1024*1024, max_image_size = 1024*1024*50, preview_size=480; +static constexpr std::size_t max_image_size = 1024*1024*50, preview_size=480; static const std::set image_extension = {".png", ".jpg", ".jpeg", ".tga", ".bmp", ".psd", ".gif", ".jfif", ".pjpeg", ".pjp"}; -struct UploadInfo { - Server *server; - std::shared_lock node_lock; - std::size_t to_read; - std::filesystem::path path; - std::ofstream file; - std::shared_ptr node; -}; - void make_preview(std::filesystem::path &path, const std::shared_ptr &node) { int x, y, channels; auto img = std::unique_ptr