Skip to content

Commit

Permalink
Fixed artifact build
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJack123 committed Jun 21, 2024
1 parent e501ca6 commit de39e1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Restore vcpkg cache
uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: a26fc81350ab139c72dfeae07822ce3db3ca7ebb
vcpkgGitCommitId: 7977f0a771e64e9811d32aa30d9a247e09c39b2e
- name: Prepare environment
run: |
mkdir x64\Release
Expand Down
7 changes: 6 additions & 1 deletion src/sanjuuni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ class HTTPListener: public HTTPRequestHandler {
std::string file = "local a='" + request.getHost() + playLua;
response.setStatusAndReason(HTTPResponse::HTTP_OK);
response.setContentType("text/x-lua");
response.setContentLength(file.size());
response.send().write(file.c_str(), file.size());
} else if (path == "/info") {
std::string file = "{\n \"length\": " + std::to_string(frameStorage.size()) + ",\n \"fps\": " + std::to_string(*fps) + "\n}";
response.setStatusAndReason(HTTPResponse::HTTP_OK);
response.setContentType("application/json");
response.setContentLength(file.size());
response.send().write(file.c_str(), file.size());
} else if (path.substr(0, 7) == "/video/") {
int frame;
Expand All @@ -212,6 +214,7 @@ class HTTPListener: public HTTPRequestHandler {
}
response.setStatusAndReason(HTTPResponse::HTTP_OK);
response.setContentType("text/x-lua");
response.setContentLength(frameStorage[frame].size());
response.send().write(frameStorage[frame].c_str(), frameStorage[frame].size());
} else if (path.substr(0, 7) == "/audio/") {
int frame;
Expand All @@ -233,7 +236,9 @@ class HTTPListener: public HTTPRequestHandler {
}
response.setStatusAndReason(HTTPResponse::HTTP_OK);
response.setContentType("application/octet-stream");
response.send().write((char*)(audioStorage + frame * size), frame == audioStorageSize / size ? audioStorageSize % size : size);
size_t sz = frame == audioStorageSize / size ? audioStorageSize % size : size;
response.setContentLength(sz);
response.send().write((char*)(audioStorage + frame * size), sz);
} else {
response.setStatusAndReason(HTTPResponse::HTTP_NOT_FOUND);
response.setContentType("text/plain");
Expand Down

0 comments on commit de39e1c

Please sign in to comment.