Skip to content

Commit

Permalink
logproto: call transport level poll_prepare() method
Browse files Browse the repository at this point in the history
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
  • Loading branch information
bazsi committed Nov 9, 2024
1 parent 1f038b5 commit 4dfbe70
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions lib/logproto/logproto-auto-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ static LogProtoPrepareAction
log_proto_auto_server_poll_prepare(LogProtoServer *s, GIOCondition *cond, gint *timeout G_GNUC_UNUSED)
{
LogProtoAutoServer *self = (LogProtoAutoServer *) s;
LogTransport *transport = log_transport_stack_get_active(&self->super.transport_stack);

*cond = transport->cond;
if (log_transport_stack_poll_prepare(&self->super.transport_stack, cond))
return LPPA_FORCE_SCHEDULE_FETCH;

if (*cond == 0)
*cond = G_IO_IN;

Expand Down
4 changes: 2 additions & 2 deletions lib/logproto/logproto-buffered-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,9 @@ LogProtoPrepareAction
log_proto_buffered_server_poll_prepare(LogProtoServer *s, GIOCondition *cond, gint *timeout G_GNUC_UNUSED)
{
LogProtoBufferedServer *self = (LogProtoBufferedServer *) s;
LogTransport *transport = log_transport_stack_get_active(&self->super.transport_stack);

*cond = transport->cond;
if (log_transport_stack_poll_prepare(&self->super.transport_stack, cond))
return LPPA_FORCE_SCHEDULE_FETCH;

/* if there's no pending I/O in the transport layer, then we want to do a read */
if (*cond == 0)
Expand Down
4 changes: 2 additions & 2 deletions lib/logproto/logproto-framed-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ static LogProtoPrepareAction
log_proto_framed_server_poll_prepare(LogProtoServer *s, GIOCondition *cond, gint *timeout G_GNUC_UNUSED)
{
LogProtoFramedServer *self = (LogProtoFramedServer *) s;
LogTransport *transport = log_transport_stack_get_active(&self->super.transport_stack);

*cond = transport->cond;
if (log_transport_stack_poll_prepare(&self->super.transport_stack, cond))
return LPPA_FORCE_SCHEDULE_FETCH;

/* there is a half message in our buffer so try to wait */
if (!self->half_message_in_buffer)
Expand Down
7 changes: 4 additions & 3 deletions lib/logproto/logproto-text-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ static gboolean
log_proto_text_client_poll_prepare(LogProtoClient *s, gint *fd, GIOCondition *cond, gint *timeout)
{
LogProtoTextClient *self = (LogProtoTextClient *) s;
LogTransport *transport = log_transport_stack_get_active(&self->super.transport_stack);

*fd = transport->fd;
*cond = transport->cond;
if (log_transport_stack_poll_prepare(&self->super.transport_stack, cond))
return TRUE;

*fd = self->super.transport_stack.fd;

/* if there's no pending I/O in the transport layer, then we want to do a write */
if (*cond == 0)
Expand Down

0 comments on commit 4dfbe70

Please sign in to comment.