From: Herman B. <her...@us...> - 2002-10-13 16:38:08
|
Update of /cvsroot/gaim/gaim/src/protocols/jabber In directory usw-pr-cvs1:/tmp/cvs-serv31087 Modified Files: jabber.c Log Message: win32 fix Index: jabber.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/jabber.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- jabber.c 13 Oct 2002 15:05:06 -0000 1.70 +++ jabber.c 13 Oct 2002 16:38:05 -0000 1.71 @@ -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; } |