diff --git a/lib/logproto/logproto-auto-server.c b/lib/logproto/logproto-auto-server.c index 2545b65ad..5ee9ed0ca 100644 --- a/lib/logproto/logproto-auto-server.c +++ b/lib/logproto/logproto-auto-server.c @@ -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; diff --git a/lib/logproto/logproto-buffered-server.c b/lib/logproto/logproto-buffered-server.c index 489946de2..f09547db2 100644 --- a/lib/logproto/logproto-buffered-server.c +++ b/lib/logproto/logproto-buffered-server.c @@ -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) diff --git a/lib/logproto/logproto-framed-server.c b/lib/logproto/logproto-framed-server.c index 49f0b0a17..19b909aef 100644 --- a/lib/logproto/logproto-framed-server.c +++ b/lib/logproto/logproto-framed-server.c @@ -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) diff --git a/lib/logproto/logproto-text-client.c b/lib/logproto/logproto-text-client.c index 1259b5e92..76446effd 100644 --- a/lib/logproto/logproto-text-client.c +++ b/lib/logproto/logproto-text-client.c @@ -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)