]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
register HTS client subscriptions with a real name
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 21 Nov 2007 18:46:34 +0000 (18:46 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 21 Nov 2007 18:46:34 +0000 (18:46 +0000)
htsclient.c

index 0abc77e47446a7a81caa0a5d1ea7902e05fa019e..eae554014eb3556ad2b31aecb16b568291cb4104 100644 (file)
@@ -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;