[evolution-data-server/gnome-3-4] Bug #551788 - Hangs when network changes
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-4] Bug #551788 - Hangs when network changes
- Date: Tue, 17 Jul 2012 12:35:53 +0000 (UTC)
commit a511ec39a3c3df5e359385b77b01b9e8d4e6b420
Author: Milan Crha <mcrha redhat com>
Date: Tue Jul 17 14:35:32 2012 +0200
Bug #551788 - Hangs when network changes
camel/camel-tcp-stream-raw.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index 356f425..888bf13 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -53,8 +53,8 @@
#define d(x)
-#define IO_TIMEOUT (PR_TicksPerSecond() * 4 * 60)
-#define CONNECT_TIMEOUT (PR_TicksPerSecond () * 4 * 60)
+#define IO_TIMEOUT (PR_TicksPerSecond() * 1 * 60)
+#define CONNECT_TIMEOUT (PR_TicksPerSecond () * 1 * 60)
typedef struct _CamelTcpStreamRawPrivate {
PRFileDesc *sockfd;
@@ -329,7 +329,7 @@ read_from_prfd (PRFileDesc *fd,
PR_GetCurrentThread (), (GDestroyNotify) NULL);
do {
- bytes_read = PR_Read (fd, buffer, n);
+ bytes_read = PR_Recv (fd, buffer, n, 0, IO_TIMEOUT);
} while (bytes_read == -1 && PR_GetError () == PR_IO_PENDING_ERROR);
if (cancel_id > 0)
@@ -377,9 +377,9 @@ write_to_prfd (PRFileDesc *fd,
do {
do {
- bytes_written = PR_Write (
+ bytes_written = PR_Send (
fd, buffer + total_written,
- size - total_written);
+ size - total_written, 0, IO_TIMEOUT);
} while (bytes_written == -1 && PR_GetError () == PR_IO_PENDING_ERROR);
if (bytes_written > 0)
@@ -525,7 +525,7 @@ socket_connect (struct addrinfo *host,
cancellable, G_CALLBACK (tcp_stream_cancelled),
PR_GetCurrentThread (), (GDestroyNotify) NULL);
- status = PR_Connect (fd, &netaddr, PR_INTERVAL_NO_TIMEOUT);
+ status = PR_Connect (fd, &netaddr, CONNECT_TIMEOUT);
if (cancel_id > 0)
g_cancellable_disconnect (cancellable, cancel_id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]