diff options
| -rw-r--r-- | protocols/msn/gw.c | 15 | ||||
| -rw-r--r-- | protocols/msn/ns.c | 7 | 
2 files changed, 11 insertions, 11 deletions
| diff --git a/protocols/msn/gw.c b/protocols/msn/gw.c index 60514139..5f285f8d 100644 --- a/protocols/msn/gw.c +++ b/protocols/msn/gw.c @@ -86,16 +86,16 @@ void msn_gw_callback(struct http_request *req)  	gw->waiting = FALSE;  	gw->polling = FALSE; +	if (req->status_code != 200 || !req->reply_body) { +		gw->callback(gw->md, -1, B_EV_IO_READ); +		return; +	} +  	if (getenv("BITLBEE_DEBUG")) {  		fprintf(stderr, "\n\x1b[90mHTTP:%s\n", req->reply_body);  		fprintf(stderr, "\n\x1b[97m\n");  	} -	if (req->status_code != 200) { -		gw->callback(gw->md, -1, B_EV_IO_READ); -		return; -	} -  	if ((value = get_rfc822_header(req->reply_headers, "X-MSN-Messenger", 0))) {  		if (!msn_gw_parse_session_header(gw, value)) {  			gw->callback(gw->md, -1, B_EV_IO_READ); @@ -112,7 +112,10 @@ void msn_gw_callback(struct http_request *req)  	if (req->body_size) {  		g_byte_array_append(gw->in, (const guint8 *) req->reply_body, req->body_size); -		gw->callback(gw->md, -1, B_EV_IO_READ); + +		if (!gw->callback(gw->md, -1, B_EV_IO_READ)) { +			return; +		}  	}  	if (gw->poll_timeout != -1) { diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index 0011d7e7..0aab149d 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -180,6 +180,7 @@ static gboolean msn_ns_callback(gpointer data, gint source, b_input_condition co  	if (st <= 0) {  		imcb_error(ic, "Error while reading from server");  		imc_logout(ic, TRUE); +		g_free(bytes);  		return FALSE;  	} @@ -187,11 +188,7 @@ static gboolean msn_ns_callback(gpointer data, gint source, b_input_condition co  	g_free(bytes); -	/* Ignore ret == 0, it's already disconnected then. */ -	msn_handler(md); - -	return TRUE; -	 +	return msn_handler(md);  }  int msn_ns_command(struct msn_data *md, char **cmd, int num_parts) | 
