*/
CDS_INIT_LIST_HEAD(&condition_list_element->node);
condition_list_element->condition = condition;
+ condition = NULL;
cds_list_add(&condition_list_element->node, &client->condition_list);
- client_list = get_client_list_from_condition(state, condition);
+ client_list = get_client_list_from_condition(
+ state, condition_list_element->condition);
if (!client_list) {
/*
* No notification-emiting trigger registered with this
pthread_mutex_lock(&client_list->lock);
cds_list_for_each_entry(trigger_ht_element,
&client_list->triggers_list, client_list_trigger_node) {
- if (evaluate_condition_for_client(trigger_ht_element->trigger, condition,
+ if (evaluate_condition_for_client(trigger_ht_element->trigger, condition_list_element->condition,
client, state)) {
WARN("[notification-thread] Evaluation of a condition on client subscription failed, aborting.");
ret = -1;
if (client_list) {
notification_client_list_put(client_list);
}
+ lttng_condition_destroy(condition);
return ret;
error:
free(condition_list_element);
free(client_list_element);
+ lttng_condition_destroy(condition);
return ret;
}
goto end;
}
+ /* Ownership of condition is always transferred. */
if (msg_type == LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_SUBSCRIBE) {
ret = notification_thread_client_subscribe(
client, condition, state, &status);
goto end;
}
+ if (client->communication.inbound.bytes_to_receive == 0 &&
+ client->communication.inbound.fds_to_receive != 0) {
+ /* Only FDs left to receive. */
+ goto receive_fds;
+ }
+
offset = client->communication.inbound.payload.buffer.size -
client->communication.inbound.bytes_to_receive;
if (client->communication.inbound.expect_creds) {
goto end;
}
+receive_fds:
assert(client->communication.inbound.bytes_to_receive == 0);
/* Receive fds. */
size_t reception_size;
struct lttng_ust_abi_event_notifier_notification ust_notification;
- struct lttng_kernel_event_notifier_notification kernel_notification;
+ struct lttng_kernel_abi_event_notifier_notification kernel_notification;
/* Init lttng_event_notifier_notification */
switch(domain) {