#include "lib.h"
+/* Error is set and reply=NULL on internal errors. */
+typedef void
+admin_cmd_callback_t(const char *reply, const char *error, void *context);
+
extern struct connect_limit *connect_limit;
extern struct penalty *penalty;
extern bool anvil_restarted;
+void admin_cmd_send(const char *service, pid_t pid, const char *cmd,
+ admin_cmd_callback_t *callback, void *context);
+#define admin_cmd_send(service, pid, cmd, callback, context) \
+ admin_cmd_send(service, pid, cmd, \
+ (admin_cmd_callback_t *)callback, \
+ TRUE ? context : CALLBACK_TYPECHECK(callback, \
+ void (*)(const char *, const char *, \
+ typeof(context))))
+
+
#endif
static struct io *log_fdpass_io;
static struct admin_client_pool *admin_pool;
+#undef admin_cmd_send
+void admin_cmd_send(const char *service, pid_t pid, const char *cmd,
+ admin_cmd_callback_t *callback, void *context)
+{
+ struct anvil_connection *conn = anvil_connection_find(service, pid);
+ if (conn != NULL) {
+ anvil_connection_send_cmd(conn, cmd, callback, context);
+ return;
+ }
+ admin_client_pool_send_cmd(admin_pool, service, pid, cmd,
+ callback, context);
+}
+
static void client_connected(struct master_service_connection *conn)
{
bool master = conn->listen_fd == MASTER_LISTEN_FD_FIRST;