Changeset e61f9d1 for protocols/msn


Ignore:
Timestamp:
2015-11-28T18:32:21Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
25f6151
Parents:
4e4616a
Message:

msn: Send VER/CVR/USR together in the first request for faster login

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/ns.c

    r4e4616a re61f9d1  
    110110        struct im_connection *ic = md->ic;
    111111
     112        /* this should be taken from XFR, but hardcoding it for now. it also prevents more redirects. */
     113        const char *redir_data = "VmVyc2lvbjogMQ0KWGZyQ291bnQ6IDINCklzR2VvWGZyOiB0cnVlDQo=";
     114
    112115        if (source == -1 && !md->is_http) {
    113116                imcb_error(ic, "Could not connect to server");
     
    135138        }
    136139
    137         if (msn_ns_write(ic, source, "VER %d %s CVR0\r\n", ++md->trId, MSNP_VER)) {
     140        /* Having to handle potential errors in each write sure makes these ifs awkward...*/
     141
     142        if (msn_ns_write(ic, source, "VER %d %s CVR0\r\n", ++md->trId, MSNP_VER) &&
     143            msn_ns_write(ic, source, "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s %s\r\n",
     144                         ++md->trId, ic->acc->user, redir_data) &&
     145            msn_ns_write(ic, md->fd, "USR %d SSO I %s\r\n", ++md->trId, ic->acc->user)) {
     146
    138147                if (!md->is_http) {
    139148                        md->inpa = b_input_add(md->fd, B_EV_IO_READ, msn_ns_callback, md);
     
    208217                }
    209218
    210                 return(msn_ns_write(ic, md->fd, "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s VmVyc2lvbjogMQ0KWGZyQ291bnQ6IDINClhmclNlbnRVVENUaW1lOiA2MzU2MTQ3OTU5NzgzOTAwMDANCklzR2VvWGZyOiB0cnVlDQo=\r\n",
    211                                     ++md->trId, ic->acc->user));
    212219        } else if (strcmp(cmd[0], "CVR") == 0) {
    213220                /* We don't give a damn about the information we just received */
    214                 return msn_ns_write(ic, md->fd, "USR %d SSO I %s\r\n", ++md->trId, ic->acc->user);
    215221        } else if (strcmp(cmd[0], "XFR") == 0) {
    216222                char *server;
Note: See TracChangeset for help on using the changeset viewer.