-
- /* Setup lttcomm_lttng_header data and copy
- * it to the newly allocated buffer.
- */
- llh->payload_size = s_data;
- memcpy(*buf, llh, sizeof(struct lttcomm_lttng_header));
-
- return buf_size;
-
-error:
- return ret;
-}
-
-/*
- * process_client_msg
- *
- * This takes the lttcomm_session_msg struct and process the command requested
- * by the client. It then creates response(s) and send it back to the
- * given socket (sock).
- *
- * Return any error encountered or 0 for success.
- */
-static int process_client_msg(int sock, struct lttcomm_session_msg *lsm)
-{
- int ret;
- int buf_size;
- size_t header_size;
- char *send_buf = NULL;
- struct lttcomm_lttng_header llh;
-
- DBG("Processing client message");
-
- /* Copy common data to identify the response
- * on the lttng client side.
- */
- copy_common_data(&llh, lsm);
-
- /* Check command that needs a session */
- if (lsm->cmd_type != LTTNG_CREATE_SESSION &&
- lsm->cmd_type != LTTNG_LIST_SESSIONS &&
- lsm->cmd_type != UST_LIST_APPS)