@@ -585,7 +585,7 @@ int HttpHandler::defaultStaticHandler() {
585585 if (service->largeFileHandler ) {
586586 status_code = customHttpHandler (service->largeFileHandler );
587587 } else {
588- status_code = defaultLargeFileHandler ();
588+ status_code = defaultLargeFileHandler (filepath );
589589 }
590590 }
591591 return status_code;
@@ -604,7 +604,7 @@ int HttpHandler::defaultStaticHandler() {
604604 if (service->largeFileHandler ) {
605605 status_code = customHttpHandler (service->largeFileHandler );
606606 } else {
607- status_code = defaultLargeFileHandler ();
607+ status_code = defaultLargeFileHandler (filepath );
608608 }
609609 } else {
610610 status_code = HTTP_STATUS_NOT_FOUND;
@@ -629,10 +629,9 @@ int HttpHandler::defaultStaticHandler() {
629629 return status_code;
630630}
631631
632- int HttpHandler::defaultLargeFileHandler () {
632+ int HttpHandler::defaultLargeFileHandler (const std::string &filepath ) {
633633 if (!writer) return HTTP_STATUS_NOT_IMPLEMENTED;
634634 if (!isFileOpened ()) {
635- std::string filepath = service->GetStaticFilepath (req->Path ().c_str ());
636635 if (filepath.empty () || openFile (filepath.c_str ()) != 0 ) {
637636 return HTTP_STATUS_NOT_FOUND;
638637 }
@@ -874,7 +873,11 @@ int HttpHandler::openFile(const char* filepath) {
874873 closeFile ();
875874 file = new LargeFile;
876875 file->timer = INVALID_TIMER_ID;
876+ #ifdef OS_WIN
877+ return file->open (hv::utf8_to_ansi (filepath).c_str (), " rb" );
878+ #else
877879 return file->open (filepath, " rb" );
880+ #endif
878881}
879882
880883bool HttpHandler::isFileOpened () {
0 commit comments