| 197 | } |
| 198 | |
| 199 | void KeeperHTTPStorageHandler::performZooKeeperGetRequest(const std::string & storage_path, HTTPServerResponse & response) const |
| 200 | { |
| 201 | String result; |
| 202 | if (!keeper_client->get()->tryGet(storage_path, result)) |
| 203 | { |
| 204 | setErrorResponseForZKCode(Coordination::Error::ZNONODE, response); |
| 205 | return; |
| 206 | } |
| 207 | |
| 208 | response.setStatus(Poco::Net::HTTPResponse::HTTP_OK); |
| 209 | response.setContentType("application/octet-stream"); |
| 210 | response.setContentLength(result.size()); |
| 211 | |
| 212 | auto buffer = response.send(); |
| 213 | buffer->write(result.c_str(), result.size()); |
| 214 | buffer->next(); |
| 215 | } |
| 216 | |
| 217 | void KeeperHTTPStorageHandler::performZooKeeperSetRequest( |
| 218 | const std::string & storage_path, HTTPServerRequest & request, HTTPServerResponse & response) const |
nothing calls this directly
no test coverage detected