comparison src/protocols/jabber/jabber.c @ 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 1a6d3f3bc682
children da6e3c984985
comparison
equal deleted inserted replaced
3666:ae72be911db5 3667:11ab2a5f6677
1962 jft->fd = source; 1962 jft->fd = source;
1963 if(!jft->sentreq) { 1963 if(!jft->sentreq) {
1964 char buf[1024]; 1964 char buf[1024];
1965 g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.1\r\nHost: %s\r\n\r\n", jft->url->page, jft->url->address); 1965 g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.1\r\nHost: %s\r\n\r\n", jft->url->page, jft->url->address);
1966 write(source, buf, strlen(buf)); 1966 write(source, buf, strlen(buf));
1967 #ifndef _WIN32
1967 fcntl(source, F_SETFL, O_NONBLOCK); 1968 fcntl(source, F_SETFL, O_NONBLOCK);
1969 #else
1970 {
1971 u_long imode = 1;
1972 ioctlsocket(source, FIONBIO, (u_long*)&imode);
1973 }
1974 #endif
1968 jft->sentreq = TRUE; 1975 jft->sentreq = TRUE;
1969 jft->watcher = gaim_input_add(source, GAIM_INPUT_READ, jabber_http_recv_callback,data); 1976 jft->watcher = gaim_input_add(source, GAIM_INPUT_READ, jabber_http_recv_callback,data);
1970 return; 1977 return;
1971 } 1978 }
1972 1979
1973 if(!jft->startsaving) { 1980 if(!jft->startsaving) {
1981 #ifndef _WIN32
1974 if(read(source, &test, sizeof(test)) > 0 || errno == EWOULDBLOCK) { 1982 if(read(source, &test, sizeof(test)) > 0 || errno == EWOULDBLOCK) {
1975 if(errno == EWOULDBLOCK) { 1983 if(errno == EWOULDBLOCK)
1984 #else
1985 if(recv(source, &test, sizeof(test), 0) > 0 || WSAGetLastError() == WSAEWOULDBLOCK) {
1986 if(WSAEWOULDBLOCK == WSAGetLastError())
1987 #endif
1988 {
1976 errno = 0; 1989 errno = 0;
1977 return; 1990 return;
1978 } 1991 }
1979 1992
1980 jft->headers = g_string_append_c(jft->headers, test); 1993 jft->headers = g_string_append_c(jft->headers, test);