changeset 3667:11ab2a5f6677

[gaim-migrate @ 3796] win32 fix committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Sun, 13 Oct 2002 16:38:05 +0000
parents ae72be911db5
children 5b82f99d028d
files src/protocols/jabber/jabber.c
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Sun Oct 13 16:37:33 2002 +0000
+++ b/src/protocols/jabber/jabber.c	Sun Oct 13 16:38:05 2002 +0000
@@ -1964,15 +1964,28 @@
 		char buf[1024];
 		g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.1\r\nHost: %s\r\n\r\n", jft->url->page, jft->url->address);
 		write(source, buf, strlen(buf));
+#ifndef _WIN32
 		fcntl(source, F_SETFL, O_NONBLOCK);
+#else
+		{
+			u_long imode = 1;
+			ioctlsocket(source, FIONBIO, (u_long*)&imode);
+		}
+#endif
 		jft->sentreq = TRUE;
 		jft->watcher = gaim_input_add(source, GAIM_INPUT_READ, jabber_http_recv_callback,data);
 		return;
 	}
 
 	if(!jft->startsaving) {
+#ifndef _WIN32
 		if(read(source, &test, sizeof(test)) > 0 || errno == EWOULDBLOCK) {
-			if(errno == EWOULDBLOCK) {
+			if(errno == EWOULDBLOCK)
+#else
+		if(recv(source, &test, sizeof(test), 0) > 0 || WSAGetLastError() == WSAEWOULDBLOCK) {
+			if(WSAEWOULDBLOCK == WSAGetLastError())
+#endif
+			{
 				errno = 0;
 				return;
 			}