[evolution-data-server] CamelTcpStreamRaw: Don't timeout on reads.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] CamelTcpStreamRaw: Don't timeout on reads.
- Date: Fri, 12 Jul 2013 22:18:45 +0000 (UTC)
commit 480399fab362853124fcf4cb53d124b5b5bc3aa2
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Jul 12 17:09:35 2013 -0400
CamelTcpStreamRaw: Don't timeout on reads.
This is needed for IMAP IDLE to work, which sits in a read call for
long periods of time. If this times out then we disconnect from the
server and miss out on mailbox updates.
The timeout was orignally added to work around suspend/resume issues,
but that should be handled by way of GCancellables, not by prematurely
terminating a read call. Prior to reading we connect to GCancellable
and call PR_Interrupt() on cancellation to terminate the read call.
Need to make sure the GCancellable is actually firing when it should,
and that we're not racing it.
Leaving the timeout on write calls in place for now, since that seems
more reasonable.
camel/camel-tcp-stream-raw.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index 97cc318..fb72116 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -329,7 +329,7 @@ read_from_prfd (PRFileDesc *fd,
PR_GetCurrentThread (), (GDestroyNotify) NULL);
do {
- bytes_read = PR_Recv (fd, buffer, n, 0, IO_TIMEOUT);
+ bytes_read = PR_Read (fd, buffer, n);
} while (bytes_read == -1 && PR_GetError () == PR_IO_PENDING_ERROR);
if (cancel_id > 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]