htsmsg_add_str(m, "state", state);
- if (s->ths_hostname && s->ths_username && s->ths_client) {
+ if(s->ths_hostname != NULL)
htsmsg_add_str(m, "hostname", s->ths_hostname);
+
+ if(s->ths_username != NULL)
htsmsg_add_str(m, "username", s->ths_username);
+
+ if(s->ths_client != NULL)
htsmsg_add_str(m, "title", s->ths_client);
- } else {
+ else if(s->ths_title != NULL)
htsmsg_add_str(m, "title", s->ths_title);
- }
if(s->ths_channel != NULL)
htsmsg_add_str(m, "channel", s->ths_channel->ch_name);
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#include <arpa/inet.h>
#include <sys/stat.h>
#include <sys/sendfile.h>
pthread_mutex_lock(&global_lock);
s = subscription_create_from_channel(ch, priority, "HTTP", st, flags,
- NULL, NULL, NULL);
+ inet_ntoa(hc->hc_peer->sin_addr),
+ hc->hc_username,
+ http_arg_get(&hc->hc_args, "User-Agent"));
pthread_mutex_unlock(&global_lock);
if(s) {