]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
upnp: add debug fcn to dump output packets
authorJaroslav Kysela <perex@perex.cz>
Fri, 13 Feb 2015 15:03:49 +0000 (16:03 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 11 Mar 2015 20:41:12 +0000 (21:41 +0100)
src/upnp.c

index 95747459ef859838e90e4fa67c7ada0dddfd01d4..23485e5a70180b66d923e7cd0a23b4a21b378d22 100644 (file)
@@ -101,6 +101,20 @@ upnp_send( htsbuf_queue_t *q, struct sockaddr_storage *storage, int delay_ms )
   pthread_mutex_unlock(&upnp_lock);
 }
 
+/*
+ *
+ */
+static void
+upnp_dump_data( upnp_data_t *data )
+{
+#if 0
+  char tbuf[256];
+  inet_ntop(data->storage.ss_family, IP_IN_ADDR(data->storage), tbuf, sizeof(tbuf));
+  printf("upnp out to %s:%d\n", tbuf, ntohs(IP_PORT(data->storage)));
+  htsbuf_hexdump(&data->queue, "upnp out");
+#endif
+}
+
 /*
  *  Discovery thread
  */
@@ -183,6 +197,7 @@ upnp_thread( void *aux )
       pthread_mutex_unlock(&upnp_lock);
       if (data == NULL)
         break;
+      upnp_dump_data(data);
       udp_write_queue(unicast, &data->queue, &data->storage);
       htsbuf_queue_flush(&data->queue);
       free(data);
@@ -200,6 +215,7 @@ upnp_thread( void *aux )
     if (data == NULL)
       break;
     usleep((long)data->delay_ms * 1000);
+    upnp_dump_data(data);
     udp_write_queue(unicast, &data->queue, &data->storage);
     htsbuf_queue_flush(&data->queue);
     free(data);