server: add debug logging of client argc/argv

This commit is contained in:
Daniel Eklöf 2019-11-02 00:00:31 +01:00
parent 25311fc4eb
commit 19c099236b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -113,6 +113,8 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
if (recv(fd, &client->argc, sizeof(client->argc), 0) != sizeof(client->argc))
goto shutdown;
LOG_DBG("argc = %d", client->argc);
client->argv = calloc(client->argc + 1, sizeof(client->argv[0]));
for (int i = 0; i < client->argc; i++) {
uint16_t len;
@ -123,6 +125,8 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
client->argv[i][len] = '\0';
if (recv(fd, client->argv[i], len, 0) != len)
goto shutdown;
LOG_DBG("argv[%d] = %s (%hu)", i, client->argv[i], len);
}
assert(client->term == NULL);