| 184 | } |
| 185 | |
| 186 | ServerFunctionBase *ServerConnection::findFunction(color_ostream &out, const std::string &plugin, const std::string &name) |
| 187 | { |
| 188 | RPCService *svc; |
| 189 | |
| 190 | if (plugin.empty()) |
| 191 | svc = core_service; |
| 192 | else |
| 193 | { |
| 194 | svc = plugin_services[plugin]; |
| 195 | |
| 196 | if (!svc) |
| 197 | { |
| 198 | Plugin *plug = Core::getInstance().plug_mgr->getPluginByName(plugin); |
| 199 | if (!plug) |
| 200 | { |
| 201 | out.printerr("No such plugin: {}\n", plugin); |
| 202 | return NULL; |
| 203 | } |
| 204 | |
| 205 | svc = plug->rpc_connect(out); |
| 206 | if (!svc) |
| 207 | { |
| 208 | out.printerr("Plugin {} doesn't export any RPC methods.\n", plugin); |
| 209 | return NULL; |
| 210 | } |
| 211 | |
| 212 | svc->finalize(this, &functions); |
| 213 | plugin_services[plugin] = svc; |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | return svc->getFunction(name); |
| 218 | } |
| 219 | |
| 220 | void ServerConnection::connection_ostream::flush_proxy() |
| 221 | { |
no test coverage detected