Mercurial > pidgin.yaz
comparison libpurple/protocols/msn/servconn.c @ 19398:39248f5b53ad
Input handlers are unsigned integers. So set them to 0 instead of -1 after
removing it.
This is a semi-Dj vu of 979d5b68c76417625271f63b5c4fcff37ec38019
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 24 Aug 2007 02:50:55 +0000 |
parents | 5c0f2eab43d9 |
children | 44b4e8bd759b 1754155051a4 |
comparison
equal
deleted
inserted
replaced
19397:baa10a1f2bd3 | 19398:39248f5b53ad |
---|---|
49 servconn->httpconn = msn_httpconn_new(servconn); | 49 servconn->httpconn = msn_httpconn_new(servconn); |
50 | 50 |
51 servconn->num = session->servconns_count++; | 51 servconn->num = session->servconns_count++; |
52 | 52 |
53 servconn->tx_buf = purple_circ_buffer_new(MSN_BUF_LEN); | 53 servconn->tx_buf = purple_circ_buffer_new(MSN_BUF_LEN); |
54 servconn->tx_handler = -1; | 54 servconn->tx_handler = 0; |
55 | 55 |
56 return servconn; | 56 return servconn; |
57 } | 57 } |
58 | 58 |
59 void | 59 void |
301 | 301 |
302 writelen = purple_circ_buffer_get_max_read(servconn->tx_buf); | 302 writelen = purple_circ_buffer_get_max_read(servconn->tx_buf); |
303 | 303 |
304 if (writelen == 0) { | 304 if (writelen == 0) { |
305 purple_input_remove(servconn->tx_handler); | 305 purple_input_remove(servconn->tx_handler); |
306 servconn->tx_handler = -1; | 306 servconn->tx_handler = 0; |
307 return; | 307 return; |
308 } | 308 } |
309 | 309 |
310 ret = write(servconn->fd, servconn->tx_buf->outptr, writelen); | 310 ret = write(servconn->fd, servconn->tx_buf->outptr, writelen); |
311 | 311 |
326 | 326 |
327 g_return_val_if_fail(servconn != NULL, 0); | 327 g_return_val_if_fail(servconn != NULL, 0); |
328 | 328 |
329 if (!servconn->session->http_method) | 329 if (!servconn->session->http_method) |
330 { | 330 { |
331 if (servconn->tx_handler == -1) { | 331 if (servconn->tx_handler == 0) { |
332 switch (servconn->type) | 332 switch (servconn->type) |
333 { | 333 { |
334 case MSN_SERVCONN_NS: | 334 case MSN_SERVCONN_NS: |
335 case MSN_SERVCONN_SB: | 335 case MSN_SERVCONN_SB: |
336 ret = write(servconn->fd, buf, len); | 336 ret = write(servconn->fd, buf, len); |
351 } | 351 } |
352 | 352 |
353 if (ret < 0 && errno == EAGAIN) | 353 if (ret < 0 && errno == EAGAIN) |
354 ret = 0; | 354 ret = 0; |
355 if (ret >= 0 && ret < len) { | 355 if (ret >= 0 && ret < len) { |
356 if (servconn->tx_handler == -1) | 356 if (servconn->tx_handler == 0) |
357 servconn->tx_handler = purple_input_add( | 357 servconn->tx_handler = purple_input_add( |
358 servconn->fd, PURPLE_INPUT_WRITE, | 358 servconn->fd, PURPLE_INPUT_WRITE, |
359 servconn_write_cb, servconn); | 359 servconn_write_cb, servconn); |
360 purple_circ_buffer_append(servconn->tx_buf, buf + ret, | 360 purple_circ_buffer_append(servconn->tx_buf, buf + ret, |
361 len - ret); | 361 len - ret); |