Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Dec 11, 2024
1 parent 112a5e5 commit cb01bec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions be/src/http/http_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,15 @@ void HttpChannel::send_files(HttpRequest* request, const std::string& root_dir,
int64_t file_size = st.st_size;
VLOG_DEBUG << "http channel send file " << file_path << ", size: " << file_size;



evbuffer_add_printf(evb.get(), "File-Name: %s\r\n", file.c_str());
#ifdef __APPLE__
evbuffer_add_printf(evb.get(), "Content-Length: %lld\r\n", file_size);
#else
evbuffer_add_printf(evb.get(), "Content-Length: %ld\r\n", file_size);
#endif

evbuffer_add_printf(evb.get(), "\r\n");
if (file_size > 0) {
evbuffer_add_file(evb.get(), fd, 0, file_size);
Expand Down

0 comments on commit cb01bec

Please sign in to comment.