Skip to content

Commit

Permalink
feat(remotery): update to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed Dec 24, 2019
1 parent 87169f7 commit 2f0e4e5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions modules/lwjgl/remotery/src/main/c/Remotery.c
Original file line number Diff line number Diff line change
Expand Up @@ -3274,10 +3274,10 @@ static void WebSocket_PrepareBuffer(Buffer* buffer)
char empty_frame_header[WEBSOCKET_MAX_FRAME_HEADER_SIZE];

assert(buffer != NULL);

// Reset to start
buffer->bytes_used = 0;

// Allocate enough space for a maximum-sized frame header
Buffer_Write(buffer, empty_frame_header, sizeof(empty_frame_header));
}
Expand All @@ -3299,7 +3299,7 @@ static void WebSocket_WriteFrameHeader(WebSocket* web_socket, rmtU8* dest, rmtU3
rmtU8 frame_type = (rmtU8)web_socket->mode;

dest[0] = final_fragment | frame_type;

// Construct the frame header, correctly applying the narrowest size
if (length <= 125)
{
Expand Down Expand Up @@ -4577,7 +4577,7 @@ static rmtError Remotery_SendLogTextMessage(Remotery* rmt, Message* message)

assert(rmt != NULL);
assert(message != NULL);

bin_buf = rmt->server->bin_buf;
WebSocket_PrepareBuffer(bin_buf);
Buffer_Write(bin_buf, message->payload, message->payload_size);
Expand Down Expand Up @@ -4734,6 +4734,9 @@ static rmtError Remotery_ConsumeMessageQueue(Remotery* rmt)
error = Remotery_SendSampleTreeMessage(rmt, message);
rmt_EndCPUSample();
break;

default:
break;
}

// Consume the message before reacting to any errors
Expand Down Expand Up @@ -4771,6 +4774,9 @@ static void Remotery_FlushMessageQueue(Remotery* rmt)
FreeSampleTree(sample_tree->root_sample, sample_tree->allocator);
break;
}

default:
break;
}

rmtMessageQueue_ConsumeNextMessage(rmt->mq_to_rmt_thread, message);
Expand Down

0 comments on commit 2f0e4e5

Please sign in to comment.