changeset 278:29e1669b006b

[gaim-migrate @ 288] check versions works (?) committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 29 May 2000 00:56:37 +0000
parents bba300ed4fab
children 501e09c51cbc
files src/aim.c src/html.c src/util.c
diffstat 3 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/aim.c	Sun May 28 22:09:30 2000 +0000
+++ b/src/aim.c	Mon May 29 00:56:37 2000 +0000
@@ -490,10 +490,7 @@
 
 	if (general_options & OPT_GEN_CHECK_VERSIONS)
 	{
-/* FIXME:
-	Thread this code later
 		check_gaim_versions();
-*/
 	}
 
 	if (general_options & OPT_GEN_DEBUG)
--- a/src/html.c	Sun May 28 22:09:30 2000 +0000
+++ b/src/html.c	Mon May 29 00:56:37 2000 +0000
@@ -32,6 +32,8 @@
 #include <sys/socket.h>
 #include <netdb.h>
 #include <netinet/in.h>
+#include <fcntl.h>
+#include <errno.h>
 
 gchar * strip_html(gchar * text)
 {
@@ -127,6 +129,7 @@
 	g_snprintf(debug_buff, sizeof(debug_buff), "Request: %s\n", buf);
 	debug_print(debug_buff);
 	write(sock, buf, strlen(buf));
+	fcntl(sock, F_SETFL, O_NONBLOCK);
 
         webdata = NULL;
         len = 0;
@@ -136,7 +139,12 @@
 	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) {
+	while ((read_rv = read(sock, &data, 1)) > 0 || errno == EWOULDBLOCK) {
+		if (errno == EWOULDBLOCK) {
+			errno = 0;
+			continue;
+		}
+
 		if (!data)
 			continue;
 		
--- a/src/util.c	Sun May 28 22:09:30 2000 +0000
+++ b/src/util.c	Mon May 29 00:56:37 2000 +0000
@@ -727,22 +727,21 @@
 	char *cur_ver;
 	char *tmp;
 
-	cur_ver = (char *)malloc(BUF_LONG);
 	tmp = (char *)malloc(BUF_LONG);
 
 	cur_ver = (char *)grab_url("http://www.marko.net/gaim/latest-gaim");
 
 	if (!strncasecmp(cur_ver, "g00", 3))
 	{
-		free(cur_ver);
-		free(tmp);
+		g_free(cur_ver);
+		g_free(tmp);
 		return;
 	}
 
 	g_snprintf(tmp, BUF_LONG, "%s", strstr(cur_ver, "plain")+9);
 	g_strchomp(tmp);
 
-	if (strcasecmp(tmp, latest_ver))
+	if (strcmp(tmp, latest_ver))
 	{
 		g_snprintf(cur_ver, BUF_LONG, "GAIM v%s is now available.\n\nDownload it at http://www.marko.net/gaim\n", tmp);