Skip to content

Commit b9539b8

Browse files
committed
Fixed build errors
1 parent 4c93b97 commit b9539b8

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

example/simplesvr.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ string dump_multipart_files(const MultipartFiles &files) {
4646
snprintf(buf, sizeof(buf), "content type: %s\n", file.content_type.c_str());
4747
s += buf;
4848

49-
snprintf(buf, sizeof(buf), "text offset: %lu\n", file.offset);
50-
s += buf;
51-
52-
snprintf(buf, sizeof(buf), "text length: %lu\n", file.length);
49+
snprintf(buf, sizeof(buf), "text length: %lu\n", file.content.size());
5350
s += buf;
5451

5552
s += "----------------\n";

example/upload.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ int main(void) {
3737

3838
svr.Post("/post", [](const Request & req, Response &res) {
3939
auto file = req.get_file_value("file");
40-
cout << "file: " << file.offset << ":" << file.length << ":" << file.filename << endl;
40+
cout << "file length: " << file.content.length() << ":" << file.filename << endl;
4141

4242
ofstream ofs(file.filename, ios::binary);
43-
ofs << req.body.substr(file.offset, file.length);
43+
ofs << file.content;
4444

4545
res.set_content("done", "text/plain");
4646
});

0 commit comments

Comments
 (0)