projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't allow slashes and dots in overriden trace chunk names
[lttng-tools.git]
/
src
/
bin
/
lttng-relayd
/
main.c
diff --git
a/src/bin/lttng-relayd/main.c
b/src/bin/lttng-relayd/main.c
index db021f43fc5b28a9ac0de322752880a3c9a171c9..85c4fe9b9aca282ca2d35af5bfa18c910c261b55 100644
(file)
--- a/
src/bin/lttng-relayd/main.c
+++ b/
src/bin/lttng-relayd/main.c
@@
-1095,18
+1095,15
@@
static int relay_create_session(const struct lttcomm_relayd_hdr *recv_hdr,
int ret = 0;
ssize_t send_ret;
struct relay_session *session = NULL;
int ret = 0;
ssize_t send_ret;
struct relay_session *session = NULL;
- struct lttcomm_relayd_status_session reply;
- char session_name[LTTNG_NAME_MAX];
- char hostname[LTTNG_HOST_NAME_MAX];
+ struct lttcomm_relayd_status_session reply
= {}
;
+ char session_name[LTTNG_NAME_MAX]
= {}
;
+ char hostname[LTTNG_HOST_NAME_MAX]
= {}
;
uint32_t live_timer = 0;
bool snapshot = false;
/* Left nil for peers < 2.11. */
lttng_uuid sessiond_uuid = {};
uint32_t live_timer = 0;
bool snapshot = false;
/* Left nil for peers < 2.11. */
lttng_uuid sessiond_uuid = {};
-
- memset(session_name, 0, LTTNG_NAME_MAX);
- memset(hostname, 0, LTTNG_HOST_NAME_MAX);
-
- memset(&reply, 0, sizeof(reply));
+ LTTNG_OPTIONAL(uint64_t) id_sessiond = {};
+ LTTNG_OPTIONAL(uint64_t) current_chunk_id = {};
if (conn->minor < 4) {
/* From 2.1 to 2.3 */
if (conn->minor < 4) {
/* From 2.1 to 2.3 */
@@
-1116,16
+1113,22
@@
static int relay_create_session(const struct lttcomm_relayd_hdr *recv_hdr,
ret = cmd_create_session_2_4(payload, session_name,
hostname, &live_timer, &snapshot);
} else {
ret = cmd_create_session_2_4(payload, session_name,
hostname, &live_timer, &snapshot);
} else {
+ bool has_current_chunk;
+
/* From 2.11 to ... */
ret = cmd_create_session_2_11(payload, session_name,
hostname, &live_timer, &snapshot,
/* From 2.11 to ... */
ret = cmd_create_session_2_11(payload, session_name,
hostname, &live_timer, &snapshot,
- sessiond_uuid);
+ &id_sessiond.value, sessiond_uuid,
+ &has_current_chunk,
+ ¤t_chunk_id.value);
if (lttng_uuid_is_nil(sessiond_uuid)) {
/* The nil UUID is reserved for pre-2.11 clients. */
ERR("Illegal nil UUID announced by peer in create session command");
ret = -1;
goto send_reply;
}
if (lttng_uuid_is_nil(sessiond_uuid)) {
/* The nil UUID is reserved for pre-2.11 clients. */
ERR("Illegal nil UUID announced by peer in create session command");
ret = -1;
goto send_reply;
}
+ id_sessiond.is_set = true;
+ current_chunk_id.is_set = has_current_chunk;
}
if (ret < 0) {
}
if (ret < 0) {
@@
-1133,7
+1136,10
@@
static int relay_create_session(const struct lttcomm_relayd_hdr *recv_hdr,
}
session = session_create(session_name, hostname, live_timer,
}
session = session_create(session_name, hostname, live_timer,
- snapshot, sessiond_uuid, conn->major, conn->minor);
+ snapshot, sessiond_uuid,
+ id_sessiond.is_set ? &id_sessiond.value : NULL,
+ current_chunk_id.is_set ? ¤t_chunk_id.value : NULL,
+ conn->major, conn->minor);
if (!session) {
ret = -1;
goto send_reply;
if (!session) {
ret = -1;
goto send_reply;
@@
-1144,15
+1150,6
@@
static int relay_create_session(const struct lttcomm_relayd_hdr *recv_hdr,
reply.session_id = htobe64(session->id);
reply.session_id = htobe64(session->id);
- session->current_trace_chunk =
- sessiond_trace_chunk_registry_get_anonymous_chunk(
- sessiond_trace_chunk_registry, sessiond_uuid,
- session->id,
- opt_output_path);
- if (!session->current_trace_chunk) {
- ret = -1;
- }
-
send_reply:
if (ret < 0) {
reply.ret_code = htobe32(LTTNG_ERR_FATAL);
send_reply:
if (ret < 0) {
reply.ret_code = htobe32(LTTNG_ERR_FATAL);
This page took
0.025226 seconds
and
4
git commands to generate.