From 892888da03028cbf67bf005747902b9e3e5b9773 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 19 Jan 2025 21:03:06 +0000 Subject: Play WAV --- midiplay.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'midiplay.cpp') 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(("error"s + ex.what() + "").c_str(), request.out); + FCGX_PutS(("errorError: "s + ex.what() + "").c_str(), request.out); } } } catch (const std::exception& ex) { -- cgit v1.2.3