Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase local file buffer size in mg_http_upload() #2636

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mongoose.c
Original file line number Diff line number Diff line change
Expand Up @@ -3135,7 +3135,7 @@ bool mg_http_match_uri(const struct mg_http_message *hm, const char *glob) {

long mg_http_upload(struct mg_connection *c, struct mg_http_message *hm,
struct mg_fs *fs, const char *dir, size_t max_size) {
char buf[20] = "0", file[40], path[MG_PATH_MAX];
char buf[20] = "0", file[MG_PATH_MAX], path[MG_PATH_MAX];
long res = 0, offset;
mg_http_get_var(&hm->query, "offset", buf, sizeof(buf));
mg_http_get_var(&hm->query, "file", file, sizeof(file));
Expand Down
2 changes: 1 addition & 1 deletion src/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ bool mg_http_match_uri(const struct mg_http_message *hm, const char *glob) {

long mg_http_upload(struct mg_connection *c, struct mg_http_message *hm,
struct mg_fs *fs, const char *dir, size_t max_size) {
char buf[20] = "0", file[40], path[MG_PATH_MAX];
char buf[20] = "0", file[MG_PATH_MAX], path[MG_PATH_MAX];
long res = 0, offset;
mg_http_get_var(&hm->query, "offset", buf, sizeof(buf));
mg_http_get_var(&hm->query, "file", file, sizeof(file));
Expand Down
6 changes: 5 additions & 1 deletion test/unit_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -3359,7 +3359,6 @@ int main(void) {
test_iobuf();
test_base64();
test_http_get_var();
test_http_client();
test_tls();
test_ws();
test_ws_fragmentation();
Expand All @@ -3369,8 +3368,13 @@ int main(void) {
test_http_no_content_length();
test_http_pipeline();
test_http_range();
#ifndef LOCALHOST_ONLY
test_sntp();
test_mqtt();
test_http_client();
#else
(void) test_sntp, (void) test_mqtt, (void) test_http_client;
#endif
test_poll();
test_md5();
test_sha1();
Expand Down
Loading