/*
- * Copyright (C) 2012 - David Goulet <dgoulet@efficios.com>
+ * Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License, version 2 only, as
- * published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
*
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define _LGPL_SOURCE
* We choose to use the system name resolution API first
* to honor its network configuration. If this fails, we
* resolve to the appropriate loopback address. This is
- * done to accomodate systems which may want to start
+ * done to accommodates systems which may want to start
* tracing before their network configured.
*/
const char *loopback_addr = af == AF_INET ?
free(addr_f);
*uris = tmp_uris;
+ assert(size == 1 || size == 2);
return size;
free_error:
goto parse_error;
}
+ /* 1 and 2 are the only expected values on success. */
+ assert(size_ctrl == 1 || size_ctrl == 2);
+
/* At this point, we know there is at least one URI in the array */
set_default_uri_attr(&ctrl_uris[0], LTTNG_STREAM_CONTROL);
} else if (size_data == 2) {
ERR("Data URL can not be set with the net[4|6]:// protocol");
goto error;
+ } else {
+ /* 1 and 2 are the only expected values on success. */
+ assert(size_data == 1);
}
set_default_uri_attr(&data_uris[0], LTTNG_STREAM_DATA);