diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-19 21:03:06 +0000 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-19 21:03:06 +0000 |
commit | 892888da03028cbf67bf005747902b9e3e5b9773 (patch) | |
tree | a5fd97f9c07c4d08a343e47d0ba2e68f4b5d296e /midiplay.cpp | |
parent | 7f54b359f0261ae5b70f303a2080b13dd70cd0c2 (diff) |
Play WAV
Diffstat (limited to 'midiplay.cpp')
-rw-r--r-- | midiplay.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/midiplay.cpp b/midiplay.cpp index 36b732e..534508f 100644 --- a/midiplay.cpp +++ b/midiplay.cpp @@ -103,10 +103,10 @@ int main(int argc, char* argv[]) { while (FCGX_Accept_r(&request) == 0) { std::string method = FCGX_GetParam("REQUEST_METHOD", request.envp); + FCGX_PutS("Content-Type: text/xml\r\n\r\n", request.out); + try { if (method == "POST") { - FCGX_PutS("Content-Type: text/xml\r\n\r\n", request.out); - PostData data{request}; std::string command {getCommand(request)}; if (command == "start") { @@ -128,8 +128,7 @@ int main(int argc, char* argv[]) { throw std::runtime_error(fmt::format("Bad request method: POST expected, got {}", method).c_str()); } } catch (const std::exception& ex) { - FCGX_PutS("Content-Type: text/xml\r\n\r\n", request.out); - FCGX_PutS(("<data><status>error</status><message>"s + ex.what() + "</message></data>").c_str(), request.out); + FCGX_PutS(("<data><status>error</status><message>Error: "s + ex.what() + "</message></data>").c_str(), request.out); } } } catch (const std::exception& ex) { |