[evolution-data-server] Making e-d-s build on Windows and also build on other platforms :)



commit feffe724cf952e85fe9b866b2ce4028c520c5ee0
Author: Fridrich Å trba <fridrich strba bluewin ch>
Date:   Thu Jun 3 09:05:17 2010 +0200

    Making e-d-s build on Windows and also build on other platforms :)

 camel/camel-tcp-stream-raw.c |    8 ++++++++
 camel/camel-tcp-stream-ssl.c |   10 +++++++++-
 camel/camel-tcp-stream.c     |    2 +-
 3 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index 333cf31..a41156f 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -397,7 +397,11 @@ connect_to_socks4_proxy (const gchar *proxy_host, gint proxy_port, struct addrin
 
 	ai = camel_getaddrinfo (proxy_host, serv, &hints, NULL); /* NULL-CamelException */
 	if (!ai) {
+#ifdef G_OS_WIN32
+		errno = WSAEHOSTUNREACH;
+#else
 		errno = EHOSTUNREACH; /* FIXME: this is not an accurate error; we should translate the CamelException to an errno */
+#endif
 		return -1;
 	}
 
@@ -428,7 +432,11 @@ connect_to_socks4_proxy (const gchar *proxy_host, gint proxy_port, struct addrin
 
 	if (!(reply[0] == 0		/* first byte of reply is 0 */
 	      && reply[1] == 90)) {	/* 90 means "request granted" */
+#ifdef G_OS_WIN32
+		errno = WSAECONNREFUSED;
+#else
 		errno = ECONNREFUSED;
+#endif
 		goto error;
 	}
 
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 24db04d..366c289 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -215,7 +215,7 @@ read_from_prfd (PRFileDesc *fd, gchar *buffer, gsize n)
 		sockopts.value.non_blocking = TRUE;
 		PR_SetSocketOption (fd, &sockopts);
 
-		pollfds[0].fd = fd
+		pollfds[0].fd = fd;
 		pollfds[0].in_flags = PR_POLL_READ;
 		pollfds[1].fd = cancel_fd;
 		pollfds[1].in_flags = PR_POLL_READ;
@@ -1148,7 +1148,11 @@ connect_to_socks4_proxy (CamelTcpStreamSSL *ssl, const gchar *proxy_host, gint p
 
 	ai = camel_getaddrinfo (proxy_host, serv, &hints, NULL);  /* NULL-CamelException */
 	if (!ai) {
+#ifdef G_OS_WIN32
+		errno = WSAEHOSTUNREACH;
+#else
 		errno = EHOSTUNREACH; /* FIXME: this is not an accurate error; we should translate the CamelException to an errno */
+#endif
 		d (g_print ("  camel_getaddrinfo() for the proxy failed\n}\n"));
 		return NULL;
 	}
@@ -1189,7 +1193,11 @@ connect_to_socks4_proxy (CamelTcpStreamSSL *ssl, const gchar *proxy_host, gint p
 
 	if (!(reply[0] == 0		/* first byte of reply is 0 */
 	      && reply[1] == 90)) {	/* 90 means "request granted" */
+#ifdef G_OS_WIN32
+		errno = WSAECONNREFUSED;
+#else
 		errno = ECONNREFUSED;
+#endif
 		d (g_print ("  proxy replied with code %d\n", reply[1]));
 		goto error;
 	}
diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c
index c66cc8b..47f1f5c 100644
--- a/camel/camel-tcp-stream.c
+++ b/camel/camel-tcp-stream.c
@@ -73,7 +73,7 @@ camel_tcp_stream_class_init (CamelTcpStreamClass *class)
 static void
 camel_tcp_stream_init (CamelTcpStream *tcp_stream)
 {
-	tcp_stream->priv = CAMEL_TCP_STREAM_GET_PRIVATE (cpi);
+	tcp_stream->priv = CAMEL_TCP_STREAM_GET_PRIVATE (tcp_stream);
 	tcp_stream->priv->socks_host = NULL;
 	tcp_stream->priv->socks_port = 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]