diff options
Diffstat (limited to 'protocols/msn/gw.c')
-rw-r--r-- | protocols/msn/gw.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/protocols/msn/gw.c b/protocols/msn/gw.c index e046f0c8..eecbdb3b 100644 --- a/protocols/msn/gw.c +++ b/protocols/msn/gw.c @@ -69,6 +69,7 @@ void msn_gw_callback(struct http_request *req) struct msn_gw *gw = req->data; gw->waiting = FALSE; + gw->polling = FALSE; if (!gw->open) { /* the user tried to logout while the request was pending @@ -109,7 +110,7 @@ void msn_gw_callback(struct http_request *req) if (gw->poll_timeout != -1) { b_event_remove(gw->poll_timeout); } - gw->poll_timeout = b_timeout_add(5000, msn_gw_poll_timeout, gw); + gw->poll_timeout = b_timeout_add(500, msn_gw_poll_timeout, gw); } @@ -126,6 +127,11 @@ void msn_gw_dorequest(struct msn_gw *gw, char *args) gw->out = g_byte_array_new(); } + if (!bodylen && !args) { + args = "Action=poll&Lifespan=60"; + gw->polling = TRUE; + } + request = g_strdup_printf(REQUEST_TEMPLATE, gw->session_id ? : "", args ? : "", gw->last_host, bodylen, body ? : ""); @@ -171,7 +177,7 @@ void msn_gw_write(struct msn_gw *gw, char *buf, size_t len) g_byte_array_append(gw->out, (const guint8 *) buf, len); if (!gw->open) { msn_gw_open(gw); - } else if (!gw->waiting) { + } else if (gw->polling || !gw->waiting) { msn_gw_dorequest(gw, NULL); } } |