mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-02 13:53:13 +02:00
6a4ae9d9ec
sent over the IRC network. This makes it possible to fetch information from remote servers that is not known locally, and also it makes it possible to do more things, or do it easier. This does require the remote servers to enable RPC as well, though, eg: include "rpc.modules.default.conf"; (They don't need any listener or rpc-user blocks) Code-wise it looks nice, like from rpc_server_module_list it is a simple: /* Forward to remote */ rpc_send_request_to_remote(client, targetserver, request); This is work in progress. In particular, there is no handling yet of timeouts (eg if the request to the remote server, or the response from it takes ages). Nor does it handle the case where the server quits half-way through the request/response... that is: it does free the request and such, but does not notify the RPC client about it. That will need to be added, of course, likely soon. Over the IRC network this uses the new RRPC command: :<server> RRPC <REQ|RES> <source> <destination> <requestid> [S|C|F] :<request data> A request looks like this (assuming it is short): :001 RRPC REQ 001ABCDEF 002 abc SF :..this is the json request... And then the response (assuming it is long) is like: :001 RRPC REQ 001ABCDEF 002 abc S :..this is the json response... :001 RRPC REQ 001ABCDEF 002 abc C :..more... :001 RRPC REQ 001ABCDEF 002 abc C :..more... :001 RRPC REQ 001ABCDEF 002 abc F :..and that was it. There is currently no request/response limit, it is limited by memory. Right now the only call using this is server.module_list when called with a param of "server":"some.remote.server"