Fix: use NULL url for load live session
authorDavid Goulet <dgoulet@efficios.com>
Mon, 24 Mar 2014 19:52:31 +0000 (15:52 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 24 Mar 2014 20:01:23 +0000 (16:01 -0400)
For a live session, the control and data URI are mandatory thus pass
NULL to the create session so we can set them afterwards by a set
consumer URL call.

net:// can't be used for control and data so this fixes the uri to url
string by printing "tcp://" instead of net:// which is more accurate and
the good way to actually print the URL to the user.

Fixes #767

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/config/config.c
src/common/uri.c

index e74e20f6c016e2fbbfe101c19a52fa0f6de93e18..722904772316c0fc0b48f548817a472e051247a1 100644 (file)
@@ -1222,11 +1222,12 @@ int create_session(const char *name,
 
                /* network destination */
                if (live_timer_interval && live_timer_interval != UINT64_MAX) {
-                       const char *url = output.control_uri ?
-                               output.control_uri : output.data_uri;
-
-                       /* URL has to be provided, even if we'll overwrite it after. */
-                       ret = lttng_create_session_live(name, url, live_timer_interval);
+                       /*
+                        * URLs are provided for sure since the test above make sure that
+                        * with a live timer the data and control URIs are provided. So,
+                        * NULL is passed here and will be set right after.
+                        */
+                       ret = lttng_create_session_live(name, NULL, live_timer_interval);
                } else {
                        ret = lttng_create_session(name, NULL);
                }
index 712339a5fded2efce62d2475f00282e63c061534..408b75cd73c7e9808a47c30196372a2ffbe8dde6 100644 (file)
@@ -201,7 +201,7 @@ int uri_to_str_url(struct lttng_uri *uri, char *dst, size_t size)
        } else {
                ipver = (uri->dtype == LTTNG_DST_IPV4) ? 4 : 6;
                addr = (ipver == 4) ?  uri->dst.ipv4 : uri->dst.ipv6;
-               (void) snprintf(proto, sizeof(proto), "net%d", ipver);
+               (void) snprintf(proto, sizeof(proto), "tcp%d", ipver);
                (void) snprintf(port, sizeof(port), ":%d", uri->port);
        }
 
This page took 0.027978 seconds and 5 git commands to generate.