+static
+int client_handle_transmission_status(
+ struct notification_client *client,
+ enum client_transmission_status transmission_status,
+ struct notification_thread_state *state)
+{
+ int ret = 0;
+
+ switch (transmission_status) {
+ case CLIENT_TRANSMISSION_STATUS_COMPLETE:
+ ret = lttng_poll_mod(&state->events, client->socket,
+ CLIENT_POLL_MASK_IN);
+ if (ret) {
+ goto end;
+ }
+
+ client->communication.outbound.queued_command_reply = false;
+ client->communication.outbound.dropped_notification = false;
+ break;
+ case CLIENT_TRANSMISSION_STATUS_QUEUED:
+ /*
+ * We want to be notified whenever there is buffer space
+ * available to send the rest of the payload.
+ */
+ ret = lttng_poll_mod(&state->events, client->socket,
+ CLIENT_POLL_MASK_IN_OUT);
+ if (ret) {
+ goto end;
+ }
+ break;
+ case CLIENT_TRANSMISSION_STATUS_FAIL:
+ ret = notification_thread_client_disconnect(client, state);
+ if (ret) {
+ goto end;
+ }
+ break;
+ case CLIENT_TRANSMISSION_STATUS_ERROR:
+ ret = -1;
+ goto end;
+ default:
+ abort();
+ }
+end:
+ return ret;
+}
+