Skip to content

Commit 4907dd0

Browse files
fix: renaming eof_ to done_
1 parent bd7ac07 commit 4907dd0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/handler/upload_handler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ UploadHandler::UploadHandler(const std::string& path, const RouteConfig& rc, con
1919
out_off_(0),
2020
bytes_written_(0),
2121
fd_(-1),
22-
eof_(false)
22+
done_(false)
2323

2424
{
2525
if (req.content_length == 0) {
@@ -68,7 +68,7 @@ size_t UploadHandler::write_input(const char* buf, size_t n)
6868
if (out_buf_.empty()) {
6969
set_error(HttpResponse::kStatusDiskFull);
7070
}
71-
eof_ = true; // to ensure needs_input returns false
71+
done_ = true; // to ensure needs_input returns false
7272
return 0;
7373
}
7474
bytes_written_ += bytes;
@@ -82,7 +82,7 @@ size_t UploadHandler::write_input(const char* buf, size_t n)
8282
if (out_buf_.empty()) {
8383
res_ = HttpResponse::make_response_headers_only(HttpResponse::kStatusCreated, "", 0, req_);
8484
out_buf_ = res_.to_string();
85-
eof_ = true;
85+
done_ = true;
8686
}
8787
return (0);
8888
}
@@ -91,5 +91,5 @@ void UploadHandler::set_error(const HttpResponse::Status code)
9191
{
9292
res_ = HttpResponse::make_error(code, rc_.shared.error_pages, req_);
9393
out_buf_ = res_.to_string();
94-
eof_ = true;
94+
done_ = true;
9595
}

src/handler/upload_handler.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class UploadHandler : public Handler {
2020
virtual bool is_regular_file() const { return true; }
2121
virtual bool has_output() const { return out_off_ < out_buf_.size(); }
2222
virtual bool needs_input() const { return bytes_written_ < req_.content_length; }
23-
virtual bool is_done() const { return eof_ && out_off_ >= out_buf_.size(); }
23+
virtual bool is_done() const { return done_ && out_off_ >= out_buf_.size(); }
2424

2525
virtual int cgi_read_fd() const { return -1; }
2626
virtual int cgi_write_fd() const { return -1; }
@@ -44,7 +44,7 @@ class UploadHandler : public Handler {
4444
// other handler specifc variables
4545
size_t bytes_written_;
4646
int fd_;
47-
bool eof_;
47+
bool done_;
4848
};
4949

5050
#endif

0 commit comments

Comments
 (0)