Skip to content

Commit

Permalink
use hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed Oct 24, 2024
1 parent 7babd6f commit 270975d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.9)
project(reactor-uc LANGUAGES C)

# Command line options for the build
set(BUILD_EXAMPLES ON CACHE BOOL "Build examples")
set(BUILD_EXAMPLES OFF CACHE BOOL "Build examples")
set(BUILD_TESTS OFF CACHE BOOL "Build all tests")
set(BUILD_LF_TESTS OFF CACHE BOOL "Build lf tests")
set(BUILD_UNIT_TESTS OFF CACHE BOOL "Build unit tests")
Expand Down
4 changes: 2 additions & 2 deletions src/platform/posix/tcp_ip_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ lf_ret_t TcpIpChannel_send(NetworkChannel *untyped_self, TaggedMessage *message)
}

// serializing protobuf into buffer
int message_size = encode_protobuf(message, self->write_buffer, TCP_IP_CHANNEL_BUFFERSIZE);
int message_size = self->encode_hook(message, self->write_buffer, TCP_IP_CHANNEL_BUFFERSIZE);

if (message_size < 0) {
LF_ERR(NET, "Could not encode protobuf");
Expand Down Expand Up @@ -159,7 +159,7 @@ TaggedMessage *TcpIpChannel_receive(NetworkChannel *untyped_self) {
}

self->read_index += bytes_read;
bytes_left = decode_protobuf(&self->output, self->read_buffer, self->read_index);
bytes_left = self->decode_hook(&self->output, self->read_buffer, self->read_index);
if (bytes_left < 0) {
read_more = true;
} else {
Expand Down

0 comments on commit 270975d

Please sign in to comment.