From 2bb1b33344f29874cfd3021796aee25ea305a7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Wed, 21 Nov 2007 18:46:34 +0000 Subject: [PATCH] register HTS client subscriptions with a real name --- htsclient.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htsclient.c b/htsclient.c index 0abc77e4..eae55401 100644 --- a/htsclient.c +++ b/htsclient.c @@ -448,6 +448,8 @@ cr_channel_subscribe(client_t *c, char **argv, int argc) th_channel_t *ch; th_subscription_t *s; unsigned int chindex, weight; + char tmp[100]; + struct sockaddr_in *si; if(argc < 1) return 1; @@ -466,8 +468,12 @@ cr_channel_subscribe(client_t *c, char **argv, int argc) if((ch = channel_by_index(chindex)) == NULL) return 1; - s = subscription_create(ch, weight, "client", - client_subscription_callback, c); + si = (struct sockaddr_in *)&c->c_tcp_session.tcp_peer_addr; + + snprintf(tmp, sizeof(tmp), "HTS Client @ %s", + inet_ntoa(si->sin_addr)); + + s = subscription_create(ch, weight, tmp, client_subscription_callback, c); if(s == NULL) return 1;