| 115 | } |
| 116 | |
| 117 | std::string receiveTextUntil(httpd_req_t* request, const std::string& terminator) { |
| 118 | size_t read_index = 0; |
| 119 | std::stringstream result; |
| 120 | while (!result.str().ends_with(terminator)) { |
| 121 | char buffer; |
| 122 | size_t bytes_read = httpd_req_recv(request, &buffer, 1); |
| 123 | if (bytes_read <= 0) { |
| 124 | return ""; |
| 125 | } else { |
| 126 | read_index += bytes_read; |
| 127 | } |
| 128 | |
| 129 | result << buffer; |
| 130 | } |
| 131 | |
| 132 | return result.str(); |
| 133 | } |
| 134 | |
| 135 | std::map<std::string, std::string> parseContentDisposition(const std::vector<std::string>& input) { |
| 136 | std::map<std::string, std::string> result; |
no outgoing calls
no test coverage detected