drogonframework / drogonframework/drogon
Serving swagger on windows causes exception and crash
- Dominant language
- C++
- Stars
- 14.3k
- Forks
- 1.4k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 15
Description
**Describe the bug**
When i am trying to serve my swagger file using static file serving at localhost:8000/swagger with the following files in the swagger folder on root:
```
index.html
swagger-ui-bundle.js
swagger-ui-standalone-preset.js
swagger-ui.css
swagger.yaml
```
I have tried the same thing on macOs but there was no issue. In windows when i run it in debugging i am getting the following stack trace
```
ntdll.dll!ntdll!RtlGetFullPathName_UstrEx (Unknown Source:0)
ntdll.dll!ntdll!RtlGetFullPathName_UstrEx (Unknown Source:0)
ntdll.dll!ntdll!RtlAllocateHeap (Unknown Source:0)
ntdll.dll!ntdll!RtlAllocateHeap (Unknown Source:0)
ntdll.dll!ntdll!RtlRegisterSecureMemoryCacheCallback (Unknown Source:0)
ntdll.dll!ntdll!RtlAllocateHeap (Unknown Source:0)
ntdll.dll!ntdll!RtlAllocateHeap (Unknown Source:0)
msvcrt.dll!msvcrt!malloc (Unknown Source:0)
libstdc++-6.dll![Unknown/Just-In-Time compiled code] (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
```
Anyone having this issue?
Edit:
If i set:
`drogon::app().enableSendfile(false);`
It works but i don't know if this is the correct approach to fix it. In documentation it says `use_sendfile` option is for linux but somehow it worked here and i don't know if this would cause a problem in the long run. Any help is appreciated :D
Contributor guide
Assessment
This issue has not been assessed yet.