| 49 | } |
| 50 | |
| 51 | void InterserverIOHTTPHandler::processQuery(HTTPServerRequest & request, HTTPServerResponse & response, Output & used_output) |
| 52 | { |
| 53 | HTMLForm params(server.context()->getSettingsRef(), request); |
| 54 | |
| 55 | LOG_TRACE(log, "Request URI: {}", request.getURI()); |
| 56 | |
| 57 | String endpoint_name = params.get("endpoint"); |
| 58 | bool compress = params.get("compress") == "true"; |
| 59 | |
| 60 | auto & body = request.getStream(); |
| 61 | |
| 62 | auto endpoint = server.context()->getInterserverIOHandler().getEndpoint(endpoint_name); |
| 63 | /// Locked for read while query processing |
| 64 | std::shared_lock lock(endpoint->rwlock); |
| 65 | if (endpoint->blocker.isCancelled()) |
| 66 | throw Exception("Transferring part to replica was cancelled", ErrorCodes::ABORTED); |
| 67 | |
| 68 | if (compress) |
| 69 | { |
| 70 | CompressedWriteBuffer compressed_out(*used_output.out); |
| 71 | endpoint->processQuery(params, body, compressed_out, response); |
| 72 | } |
| 73 | else |
| 74 | { |
| 75 | endpoint->processQuery(params, body, *used_output.out, response); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | |
| 80 | void InterserverIOHTTPHandler::handleRequest(HTTPServerRequest & request, HTTPServerResponse & response) |
nothing calls this directly
no test coverage detected