@@ -244,7 +244,7 @@ namespace HttpServer
244244 const std::chrono::milliseconds &timeout,
245245 const std::string &fileName,
246246 const std::unordered_map<std::string, std::string> &inHeaders,
247- const std::map <std::string, std::string> &outHeaders,
247+ const std::unordered_map <std::string, std::string> &outHeaders,
248248 const std::string &connectionHeader,
249249 const bool headersOnly
250250 ) const
@@ -340,10 +340,6 @@ namespace HttpServer
340340 if (false == headersOnly && file_size)
341341 {
342342 std::vector<std::string::value_type> buf (file_size < 512 * 1024 ? file_size : 512 * 1024 );
343- // buf.assign(headers.cbegin(), headers.cend() );
344-
345- // file.read(reinterpret_cast<char *>(buf.data() + headers.length() ), buf.size() - headers.length() );
346- // size_t send_size = clientSocket.nonblock_send(buf, file.gcount(), timeout);
347343
348344 size_t send_size;
349345
@@ -449,7 +445,7 @@ namespace HttpServer
449445 std::unordered_multimap<std::string, std::string> incoming_data;
450446 std::unordered_multimap<std::string, FileIncoming> incoming_files;
451447
452- std::map <std::string, std::string> outgoing_headers;
448+ std::unordered_map <std::string, std::string> outgoing_headers;
453449
454450 std::string method;
455451 std::string version;
@@ -771,7 +767,7 @@ namespace HttpServer
771767
772768 if (EXIT_SUCCESS == app_exit_code)
773769 {
774- Utils::rawPairsToStlMap (outgoing_headers, response.headers , response.headers_count );
770+ Utils::rawPairsToStl (outgoing_headers, response.headers , response.headers_count );
775771 }
776772
777773 try
@@ -783,7 +779,7 @@ namespace HttpServer
783779 Utils::destroyRawPairs (raw_pair_params, incoming_params.size () );
784780 Utils::destroyRawPairs (raw_pair_headers, incoming_headers.size () );
785781 Utils::destroyRawPairs (raw_pair_data, incoming_data.size () );
786- Utils::destroyRawFilesInfo (raw_fileinfo_files, incoming_files.size () );
782+ Utils::destroyRawFilesInfo (raw_fileinfo_files, incoming_files.size () );
787783 }
788784 else
789785 {
@@ -867,7 +863,7 @@ namespace HttpServer
867863
868864 if (false == connection_upgrade)
869865 {
870- // TODO: wait for send all data to client
866+ // Wait for send all data to client
871867 clientSocket.nonblock_send_sync ();
872868
873869 clientSocket.shutdown ();
0 commit comments