Oipo commented on a change in pull request #262:
URL: https://github.com/apache/celix/pull/262#discussion_r446855467
##########
File path: bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_handler.c
##########
@@ -865,12 +865,12 @@ int pubsub_tcpHandler_read(pubsub_tcpHandler_t *handle,
int fd) {
}
if (entry->header.header.metadataSize > entry->metaBufferSize)
{
if (entry->metaBuffer) {
- free(entry->metaBuffer);
- entry->metaBuffer = malloc((size_t)
entry->header.header.metadataSize);
- entry->bufferSize = handle->bufferSize;
- L_WARN("[TCP Socket] socket: %d, url: %s, realloc
read meta buffer: (%d, %d) \n", entry->fd,
- entry->url, entry->metaBufferSize,
entry->header.header.metadataSize);
+ free(entry->metaBuffer);
}
+ entry->metaBuffer = malloc((size_t)
entry->header.header.metadataSize);
Review comment:
~~The idea of the buffer is to not have to be re-allocated every time.
Perhaps a realloc if the size if too small is what you meant?~~
Nevermind, it is monday morning...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]