changeset 13744:c10237fd961c

[gaim-migrate @ 16155] js->writeh is unsigned, and "0" should be used instead of "-1" to mean "there is no watcher" committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 08 May 2006 04:02:34 +0000
parents 33294de08fe0
children fcb3f77df50d
files src/protocols/jabber/jabber.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Mon May 08 03:52:53 2006 +0000
+++ b/src/protocols/jabber/jabber.c	Mon May 08 04:02:34 2006 +0000
@@ -214,7 +214,7 @@
 
 	if (writelen == 0) {
 		gaim_input_remove(js->writeh);
-		js->writeh = -1;
+		js->writeh = 0;
 		return;
 	}
 
@@ -264,7 +264,7 @@
 			sasl_encode(js->sasl, &data[pos], towrite, &out, &olen);
 			pos += towrite;
 
-			if (js->writeh != -1)
+			if (js->writeh > 0)
 				ret = jabber_do_send(js, out, olen);
 			else {
 				ret = -1;
@@ -276,7 +276,7 @@
 			else if (ret < olen) {
 				if (ret < 0)
 					ret = 0;
-				if (js->writeh == -1)
+				if (js->writeh == 0)
 					js->writeh = gaim_input_add(
 						js->gsc ? js->gsc->fd : js->fd,
 						GAIM_INPUT_WRITE,
@@ -292,7 +292,7 @@
 	if (len == -1)
 		len = strlen(data);
 
-	if (js->writeh == -1)
+	if (js->writeh == 0)
 		ret = jabber_do_send(js, data, len);
 	else {
 		ret = -1;
@@ -304,7 +304,7 @@
 	else if (ret < len) {
 		if (ret < 0)
 			ret = 0;
-		if (js->writeh == -1)
+		if (js->writeh == 0)
 			js->writeh = gaim_input_add(
 				js->gsc ? js->gsc->fd : js->fd,
 				GAIM_INPUT_WRITE, jabber_send_cb, js);
@@ -514,7 +514,6 @@
 	js->user = jabber_id_new(gaim_account_get_username(account));
 	js->next_id = g_random_int();
 	js->write_buffer = gaim_circ_buffer_new(512);
-	js->writeh = -1;
 
 	if(!js->user) {
 		gaim_connection_error(gc, _("Invalid Jabber ID"));
@@ -859,7 +858,6 @@
 	}
 
 	js->write_buffer = gaim_circ_buffer_new(512);
-	js->writeh = -1;
 
 	if(!js->user->resource) {
 		char *me;