Skip to content

Commit

Permalink
Fixed tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
eandersson committed Sep 4, 2024
1 parent 6467304 commit 86353dc
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions main/http_server/http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,11 @@ void log_to_queue(const char * format, va_list args)
// Print to standard output
printf("%s", log_buffer);

if (xQueueSendToBack(log_queue, (void*)&log_buffer, (TickType_t) 0) != pdPASS) {
if (log_buffer != NULL) {
free((void*)log_buffer);
}
}
if (xQueueSendToBack(log_queue, (void*)&log_buffer, (TickType_t) 0) != pdPASS) {
if (log_buffer != NULL) {
free((void*)log_buffer);
}
}
}

void send_log_to_websocket(char *message)
Expand Down Expand Up @@ -628,22 +628,22 @@ void websocket_log_handler()
{
while (true)
{
char *message;
if (xQueueReceive(log_queue, &message, (TickType_t) portMAX_DELAY) != pdPASS) {
if (message != NULL) {
free((void*)message);
}
vTaskDelay(10 / portTICK_PERIOD_MS);
continue;
}

if (fd == -1) {
free((void*)message);
vTaskDelay(100 / portTICK_PERIOD_MS);
continue;
}

send_log_to_websocket(message);
char *message;
if (xQueueReceive(log_queue, &message, (TickType_t) portMAX_DELAY) != pdPASS) {
if (message != NULL) {
free((void*)message);
}
vTaskDelay(10 / portTICK_PERIOD_MS);
continue;
}

if (fd == -1) {
ree((void*)message);
vTaskDelay(100 / portTICK_PERIOD_MS);
continue;
}

send_log_to_websocket(message);
}
}

Expand Down

0 comments on commit 86353dc

Please sign in to comment.