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;
}
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;
}
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;
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;
}
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;
}
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;
}