X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libustcomm%2Fustcomm.c;h=2b08b310b826b0de71c3a1b42d8bd6ac289e747b;hb=46ef48cdf8b64608a4f679500bc34293b9f0b649;hp=6047b6012bc5f5abb98c45c2e28a4038b6b438a6;hpb=688760ef257bee85e3841e0d27ecf4e2f921ef00;p=ust.git diff --git a/libustcomm/ustcomm.c b/libustcomm/ustcomm.c index 6047b60..2b08b31 100644 --- a/libustcomm/ustcomm.c +++ b/libustcomm/ustcomm.c @@ -316,6 +316,26 @@ int ustcomm_app_recv_message(struct ustcomm_app *app, char **msg, struct ustcomm return ustcomm_recv_message(&app->server, msg, src, timeout); } +/* This removes src from the list of active connections of app. + */ + +int ustcomm_app_detach_client(struct ustcomm_app *app, struct ustcomm_source *src) +{ + struct ustcomm_server *server = (struct ustcomm_server *)app; + struct ustcomm_connection *conn; + + list_for_each_entry(conn, &server->connections, list) { + if(conn->fd == src->fd) { + list_del(&conn->list); + goto found; + } + } + + return -1; +found: + return src->fd; +} + static int init_named_socket(char *name, char **path_out) { int result;