diff --git a/agent/job.c b/agent/job.c index 0e6d3f3..12d2e0e 100644 --- a/agent/job.c +++ b/agent/job.c @@ -150,7 +150,7 @@ void* get_uptime(void *args) SSL_write(job->ssl, &job->buf, sizeof(struct msg_t)); } else { memcpy(&job->buf.chunk.data, &sys.uptime, sizeof(long)); - //sprintf((char*)&job->buf.chunk.data, "%ld", sys.uptime); + sprintf((char*)&job->buf.chunk.data, "%ld", sys.uptime); SSL_write(job->ssl, &job->buf, sizeof(struct msg_t)); } job->slot = FREE; diff --git a/src/agent_pool.c b/src/agent_pool.c index d1dfa78..d13425d 100644 --- a/src/agent_pool.c +++ b/src/agent_pool.c @@ -63,7 +63,7 @@ static void show_certs(SSL *ssl) static void *servlet(void *args) /* Serve the connection -- threadable */ { - struct msg_t buf; + struct msg_t buf = {0}; int bytes, ret; //unsigned short job[MAXJOBS] = { 0 }; struct agent_args *agent = (struct agent_args *)args; @@ -77,7 +77,7 @@ static void *servlet(void *args) /* Serve the connection -- threadable */ } else { show_certs(agent->ssl); do { - buf.meta.type = GET_MEMORY; + buf.meta.type = GET_OS; sleep(1); SSL_write(agent->ssl, &buf, sizeof(buf)); bytes = SSL_read(agent->ssl, &buf, sizeof(buf)); @@ -96,12 +96,10 @@ static void *servlet(void *args) /* Serve the connection -- threadable */ } if (SSL_get_shutdown(agent->ssl) == SSL_RECEIVED_SHUTDOWN) - log(VERBOSE, - "SSL_RECEIVED_SHUTDOWN from agent [%s]", + log(VERBOSE, "SSL_RECEIVED_SHUTDOWN from agent [%s]", agent->ip); else { - log(VERBOSE, - "Client didn't send data! SSL error below:"); + log(VERBOSE, "Client didn't send data!"); /* I think logging is NOT needed here */ //log_ssl(); sprintf((char *)buf.chunk.data, "%s", diff --git a/src/client_pool.c b/src/client_pool.c index aa65c94..1844d8f 100644 --- a/src/client_pool.c +++ b/src/client_pool.c @@ -79,7 +79,7 @@ static void *servlet(void *args) /* Serve the connection -- threadable */ if (SSL_get_shutdown(client->ssl) == SSL_RECEIVED_SHUTDOWN) log(VERBOSE, "SSL_RECEIVED_SHUTDOWN from client [%s]", client->ip); else { - log(VERBOSE, "Client didn't send data! SSL error below:"); + log(VERBOSE, "Client didn't send data!"); //log_ssl(); /* We actually don't have anything to log from SSL */ sprintf((char *)buf.chunk.data, "%s", "Where's the data, m8?"); SSL_write(client->ssl, &buf, sizeof(struct msg_t));