# HG changeset patch # User Eric Warmenhoven # Date 959281101 0 # Node ID f8a29745247cb1360b12592a1a6e890c79d9be03 # Parent 5c19f91e7ce48753f2d8e6dd24a0158ef170b297 [gaim-migrate @ 278] Two star college football players need to pass the final to play in the big game. The professor loves football, but knows these guys aren't the brightest bulbs in teh box, so he gives them a special final, puts them in a room by themselves, and gives them an hour. The guys look at each other, and start in on the final, which has only one question: "What did Old MacDonald have?" One guy looks at the other and says, "Do you know the answer to this?" The other guy says, "Duh, a farm." "How do you spell that?" "Stupid! EIEIO!" committer: Tailor Script diff -r 5c19f91e7ce4 -r f8a29745247c src/html.c --- a/src/html.c Thu May 25 08:37:29 2000 +0000 +++ b/src/html.c Thu May 25 18:58:21 2000 +0000 @@ -101,11 +101,11 @@ char *webdata = NULL; int sock; int len; + int read_rv; int datalen = 0; struct in_addr *host; char buf[256]; char data; - FILE *sockfile; int startsaving = 0; GtkWidget *pw = NULL, *pbar = NULL, *label; @@ -123,17 +123,20 @@ if ((sock = connect_address(host->s_addr, website.port)) < 0) return g_strdup("g003: Error opening connection.\n"); - sockfile = fdopen(sock, "r+"); - g_snprintf(buf, sizeof(buf), "GET /%s HTTP/1.0\n\n", website.page); g_snprintf(debug_buff, sizeof(debug_buff), "Request: %s\n", buf); debug_print(debug_buff); - fputs(buf, sockfile); + write(sock, buf, strlen(buf)); webdata = NULL; len = 0; + /* + * avoid fgetc(), it causes problems on solaris while ((data = fgetc(sockfile)) != EOF) { + */ + /* read_rv will be 0 on EOF and < 0 on error, so this should be fine */ + while ((read_rv = read(sock, &data, 1)) > 0) { if (!data) continue;