Changeset b994034


Ignore:
Timestamp:
2015-05-31T02:40:05Z (5 years ago)
Author:
dequis <dx@…>
Children:
3c28bd4
Parents:
3fb7139
git-author:
dequis <dx@…> (15-05-15 04:04:28)
git-committer:
dequis <dx@…> (31-05-15 02:40:05)
Message:

msn: check for dead connections in msn_ns_callback

Location:
protocols/msn
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/gw.c

    r3fb7139 rb994034  
    8585
    8686        if (req->status_code != 200 || !req->reply_body) {
    87                 gw->callback(gw->md, -1, B_EV_IO_READ);
     87                gw->callback(req->data, -1, B_EV_IO_READ);
    8888                return;
    8989        }
     
    9696        if ((value = get_rfc822_header(req->reply_headers, "X-MSN-Messenger", 0))) {
    9797                if (!msn_gw_parse_session_header(gw, value)) {
    98                         gw->callback(gw->md, -1, B_EV_IO_READ);
     98                        gw->callback(req->data, -1, B_EV_IO_READ);
    9999                        g_free(value);
    100100                        return;
     
    111111                g_byte_array_append(gw->in, (const guint8 *) req->reply_body, req->body_size);
    112112
    113                 if (!gw->callback(gw->md, -1, B_EV_IO_READ)) {
     113                if (!gw->callback(req->data, -1, B_EV_IO_READ)) {
    114114                        return;
    115115                }
  • protocols/msn/ns.c

    r3fb7139 rb994034  
    150150        if (msn_ns_write_cmd(ic, "CNT", "CON", "<connect><ver>2</ver><agent><os>winnt</os><osVer>5.2</osVer><proc>x86</proc><lcid>en-us</lcid></agent></connect>")) {
    151151                if (!md->is_http) {
    152                         md->inpa = b_input_add(md->fd, B_EV_IO_READ, msn_ns_callback, md);
     152                        md->inpa = b_input_add(md->fd, B_EV_IO_READ, msn_ns_callback, ic);
    153153                }
    154154                imcb_log(ic, "Connected to server, waiting for reply");
     
    182182static gboolean msn_ns_callback(gpointer data, gint source, b_input_condition cond)
    183183{
    184         struct msn_data *md = data;
    185         struct im_connection *ic = md->ic;
     184        struct im_connection *ic = data;
     185        struct msn_data *md;
    186186        char *bytes;
    187187        int st;
     188
     189        if (g_slist_find(msn_connections, ic) == NULL) {
     190                return FALSE;
     191        }
     192
     193        md = ic->proto_data;
    188194
    189195        if (md->is_http) {
Note: See TracChangeset for help on using the changeset viewer.