Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Jul 5, 2024
1 parent f4f10ad commit 451f2e0
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 489 deletions.
2 changes: 1 addition & 1 deletion example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async_simple::coro::Lazy<resp_data> chunked_upload1(coro_http_client &client) {
std::string filename = "test.txt";
create_file(filename, 1010);

coro_io::coro_file0 file{};
coro_io::coro_file file{};
file.open(filename, std::ios::in);

std::string buf;
Expand Down
10 changes: 5 additions & 5 deletions include/cinatra/coro_http_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ struct req_context {
req_content_type content_type = req_content_type::none;
std::string req_header; /*header string*/
String content; /*body*/
coro_io::coro_file0 *resp_body_stream = nullptr;
coro_io::coro_file *resp_body_stream = nullptr;
};

struct multipart_t {
Expand Down Expand Up @@ -777,7 +777,7 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
std::string filename,
std::string range = "") {
resp_data data{};
coro_io::coro_file0 file;
coro_io::coro_file file;
file.open(filename, std::ios::trunc | std::ios::out);
if (!file.is_open()) {
data.net_err = std::make_error_code(std::errc::no_such_file_or_directory);
Expand Down Expand Up @@ -852,7 +852,7 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
std::string source, std::error_code &ec) {
std::string file_data;
detail::resize(file_data, max_single_part_size_);
coro_io::coro_file0 file{};
coro_io::coro_file file{};
file.open(source, std::ios::in);
if (!file.is_open()) {
ec = std::make_error_code(std::errc::bad_file_descriptor);
Expand All @@ -879,7 +879,7 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
}
std::string file_data;
detail::resize(file_data, std::min(max_single_part_size_, length));
coro_io::coro_file0 file{};
coro_io::coro_file file{};
file.open(source, std::ios::in);
if (!file.is_open()) {
ec = std::make_error_code(std::errc::bad_file_descriptor);
Expand Down Expand Up @@ -2142,7 +2142,7 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
}

if (is_file) {
coro_io::coro_file0 file{};
coro_io::coro_file file{};
file.open(part.filename, std::ios::in);
assert(file.is_open());
std::string file_data;
Expand Down
2 changes: 1 addition & 1 deletion include/cinatra/coro_http_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class coro_http_server {
std::string content;
detail::resize(content, chunked_size_);

coro_io::coro_file0 in_file{};
coro_io::coro_file in_file{};
in_file.open(file_name, std::ios::in);
if (!in_file.is_open()) {
resp.set_status_and_content(status_type::not_found,
Expand Down
Loading

0 comments on commit 451f2e0

Please sign in to comment.