From cb01bec8145c6024f7e09216347fd6acf301bb1c Mon Sep 17 00:00:00 2001 From: 924060929 Date: Wed, 11 Dec 2024 10:58:45 +0800 Subject: [PATCH] fix --- be/src/http/http_channel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/be/src/http/http_channel.cpp b/be/src/http/http_channel.cpp index bfd173236ea2caa..f34b60743438797 100644 --- a/be/src/http/http_channel.cpp +++ b/be/src/http/http_channel.cpp @@ -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);