Changeset 7869e48 for libfaim/service.c


Ignore:
Timestamp:
Jan 12, 2013, 1:43:13 PM (11 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
e3a0d71, 4485285
Parents:
4626016
git-author:
Jason Gross <jgross@mit.edu> (01/12/13 13:13:18)
git-committer:
Jason Gross <jgross@mit.edu> (01/12/13 13:43:13)
Message:
Remove trailing whitespace

This commit was made with the command sequence

    for i in $(git ls-files | tr '\n' ' ');
    do
      echo $i; sed -i s'/\s\+$//g' "$(readlink -f $i)";
    done
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfaim/service.c

    rcf02dd6 r7869e48  
    2929        /*
    3030         * Send only the tool versions that the server cares about (that it
    31          * marked as supporting in the server ready SNAC). 
     31         * marked as supporting in the server ready SNAC).
    3232         */
    3333        for (sg = ins->groups; sg; sg = sg->next) {
     
    5050/*
    5151 * Subtype 0x0003 - Host Online
    52  * 
     52 *
    5353 * See comments in conn.c about how the group associations are supposed
    5454 * to work, and how they really work.
     
    5858 * We don't actually call the client here.  This starts off the connection
    5959 * initialization routine required by all AIM connections.  The next time
    60  * the client is called is the CONNINITDONE callback, which should be 
     60 * the client is called is the CONNINITDONE callback, which should be
    6161 * shortly after the rate information is acknowledged.
    62  * 
     62 *
    6363 */
    6464static int hostonline(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
     
    8989        aim_setversions(sess, rx->conn);
    9090
    91         return 1; 
     91        return 1;
    9292}
    9393
     
    161161 * it.  The rate classes, their limiting properties, and the definitions
    162162 * of which SNACs are belong to which class, are defined in the
    163  * Rate Response packet at login to each host. 
     163 * Rate Response packet at login to each host.
    164164 *
    165165 * Logically, all rate offenses within one class count against further
     
    194194 *
    195195 * The only other thing of note is that class 5 (chat) has slightly looser
    196  * limiting properties than class 3 (normal messages).  But thats just a 
     196 * limiting properties than class 3 (normal messages).  But thats just a
    197197 * small bit of trivia for you.
    198198 *
     
    200200 * system is how the actual numbers relate to the passing of time.  This
    201201 * seems to be a big mystery.
    202  * 
     202 *
    203203 */
    204204
     
    289289                 * depending on the version we advertised in 1/17.  If we
    290290                 * didn't send 1/17 (evil!), then this will crash and you
    291                  * die, as it will default to the old version but we have 
    292                  * the new version hardcoded here. 
     291                 * die, as it will default to the old version but we have
     292                 * the new version hardcoded here.
    293293                 */
    294294                if (mod->version >= 3)
     
    350350{
    351351        aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
    352         aim_frame_t *fr;       
     352        aim_frame_t *fr;
    353353        aim_snacid_t snacid;
    354354        struct rateclass *rc;
    355355
    356356        if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 512)))
    357                 return -ENOMEM; 
     357                return -ENOMEM;
    358358
    359359        snacid = aim_cachesnac(sess, 0x0001, 0x0008, 0x0000, NULL, 0);
     
    372372{
    373373        aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
    374         aim_frame_t *fr;       
     374        aim_frame_t *fr;
    375375        aim_snacid_t snacid;
    376376        struct rateclass *rc;
    377377
    378378        if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 512)))
    379                 return -ENOMEM; 
     379                return -ENOMEM;
    380380
    381381        snacid = aim_cachesnac(sess, 0x0001, 0x0009, 0x0000, NULL, 0);
     
    400400        code = aimbs_get16(bs);
    401401        rateclass = aimbs_get16(bs);
    402        
     402
    403403        windowsize = aimbs_get32(bs);
    404404        clear = aimbs_get32(bs);
     
    418418 * How Migrations work.
    419419 *
    420  * The server sends a Server Pause message, which the client should respond to 
    421  * with a Server Pause Ack, which contains the families it needs on this 
    422  * connection. The server will send a Migration Notice with an IP address, and 
    423  * then disconnect. Next the client should open the connection and send the 
     420 * The server sends a Server Pause message, which the client should respond to
     421 * with a Server Pause Ack, which contains the families it needs on this
     422 * connection. The server will send a Migration Notice with an IP address, and
     423 * then disconnect. Next the client should open the connection and send the
    424424 * cookie.  Repeat the normal login process and pretend this never happened.
    425425 *
     
    465465
    466466        /*
    467          * This list should have all the groups that the original 
    468          * Host Online / Server Ready said this host supports.  And 
     467         * This list should have all the groups that the original
     468         * Host Online / Server Ready said this host supports.  And
    469469         * we want them all back after the migration.
    470470         */
     
    521521
    522522        memset(&userinfo, 0, sizeof(aim_userinfo_t));
    523        
     523
    524524        newevil = aimbs_get16(bs);
    525525
     
    558558 *
    559559 * This is the final SNAC sent on the original connection during a migration.
    560  * It contains the IP and cookie used to connect to the new server, and 
     560 * It contains the IP and cookie used to connect to the new server, and
    561561 * optionally a list of the SNAC groups being migrated.
    562562 *
     
    576576         * moves to the new server.  When not all the groups for a connection
    577577         * are migrated, or they are all migrated but some groups are moved
    578          * to a different server than others, it is called a bifurcated 
     578         * to a different server than others, it is called a bifurcated
    579579         * migration.
    580580         *
     
    624624         *   3 System bulletin
    625625         *   4 Nothing's wrong ("top o the world" -- normal)
    626          *   5 Lets-break-something. 
     626         *   5 Lets-break-something.
    627627         *
    628628         */
    629629        id = aimbs_get16(bs);
    630630
    631         /* 
    632          * TLVs follow 
     631        /*
     632         * TLVs follow
    633633         */
    634634        tlvlist = aim_tlvlist_read(bs);
     
    646646}
    647647
    648 /* 
     648/*
    649649 * Subtype 0x0014 - Set privacy flags
    650650 *
     
    663663 * Subtype 0x0016 - No-op
    664664 *
    665  * WinAIM sends these every 4min or so to keep the connection alive.  Its not 
     665 * WinAIM sends these every 4min or so to keep the connection alive.  Its not
    666666 * really necessary.
    667667 *
    668  * Wha?  No?  Since when?  I think WinAIM sends an empty channel 3 
     668 * Wha?  No?  Since when?  I think WinAIM sends an empty channel 3
    669669 * SNAC as a no-op...
    670670 */
     
    674674}
    675675
    676 /* 
     676/*
    677677 * Subtype 0x0017 - Set client versions
    678678 *
    679  * If you've seen the clientonline/clientready SNAC you're probably 
     679 * If you've seen the clientonline/clientready SNAC you're probably
    680680 * wondering what the point of this one is.  And that point seems to be
    681681 * that the versions in the client online SNAC are sent too late for the
    682682 * server to be able to use them to change the protocol for the earlier
    683  * login packets (client versions are sent right after Host Online is 
     683 * login packets (client versions are sent right after Host Online is
    684684 * received, but client online versions aren't sent until quite a bit later).
    685685 * We can see them already making use of this by changing the format of
     
    705705        /*
    706706         * Send only the versions that the server cares about (that it
    707          * marked as supporting in the server ready SNAC). 
     707         * marked as supporting in the server ready SNAC).
    708708         */
    709709        for (sg = ins->groups; sg; sg = sg->next) {
     
    741741}
    742742
    743 /* 
     743/*
    744744 * Subtype 0x001e - Extended Status
    745745 *
    746746 * Sets your ICQ status (available, away, do not disturb, etc.)
    747747 *
    748  * These are the same TLVs seen in user info.  You can 
     748 * These are the same TLVs seen in user info.  You can
    749749 * also set 0x0008 and 0x000c.
    750750 */
     
    767767        snacid = aim_cachesnac(sess, 0x0001, 0x001e, 0x0000, NULL, 0);
    768768        aim_putsnac(&fr->data, 0x0001, 0x001e, 0x0000, snacid);
    769        
     769
    770770        aim_tlvlist_add_32(&tl, 0x0006, data);
    771771        aim_tlvlist_write(&fr->data, &tl);
    772772        aim_tlvlist_free(&tl);
    773        
     773
    774774        aim_tx_enqueue(sess, fr);
    775775
     
    777777}
    778778
    779 /* 
     779/*
    780780 * Subtype 0x001e - Extended Status.
    781781 *
    782  * Sets your "available" message.  This is currently only supported by iChat 
     782 * Sets your "available" message.  This is currently only supported by iChat
    783783 * and Gaim.
    784784 *
    785  * These are the same TLVs seen in user info.  You can 
     785 * These are the same TLVs seen in user info.  You can
    786786 * also set 0x0008 and 0x000c.
    787787 */
     
    851851 * the data that the specific client should have, the client will get the
    852852 * following message from "AOL Instant Messenger":
    853  *    "You have been disconnected from the AOL Instant Message Service (SM) 
     853 *    "You have been disconnected from the AOL Instant Message Service (SM)
    854854 *     for accessing the AOL network using unauthorized software.  You can
    855  *     download a FREE, fully featured, and authorized client, here 
     855 *     download a FREE, fully featured, and authorized client, here
    856856 *     http://www.aol.com/aim/download2.html"
    857857 * The connection is then closed, recieving disconnect code 1, URL
    858  * http://www.aim.aol.com/errors/USER_LOGGED_OFF_NEW_LOGIN.html. 
    859  *
    860  * Note, however, that numerous inconsistencies can cause the above error, 
     858 * http://www.aim.aol.com/errors/USER_LOGGED_OFF_NEW_LOGIN.html.
     859 *
     860 * Note, however, that numerous inconsistencies can cause the above error,
    861861 * not just sending back a bad hash.  Do not immediatly suspect this code
    862862 * if you get disconnected.  AOL and the open/free software community have
     
    935935        if ((flag == AIM_SENDMEMBLOCK_FLAG_ISHASH) && buf && (len == 0x10)) { /* we're getting a hash */
    936936
    937                 aimbs_putraw(&fr->data, buf, 0x10); 
     937                aimbs_putraw(&fr->data, buf, 0x10);
    938938
    939939        } else if (buf && (len > 0)) { /* use input buffer */
     
    941941                md5_byte_t digest[0x10];
    942942
    943                 md5_init(&state);       
     943                md5_init(&state);
    944944                md5_append(&state, (const md5_byte_t *)buf, len);
    945945                md5_finish(&state, digest);
     
    954954                /*
    955955                 * These MD5 routines are stupid in that you have to have
    956                  * at least one append.  So thats why this doesn't look 
     956                 * at least one append.  So thats why this doesn't look
    957957                 * real logical.
    958958                 */
     
    965965        } else {
    966966
    967                 /* 
     967                /*
    968968                 * This data is correct for AIM 3.5.1670.
    969969                 *
     
    10061006 * Subtype 0x0021 - Receive our extended status
    10071007 *
    1008  * This is used for iChat's "available" messages, and maybe ICQ extended 
    1009  * status messages?  It's also used to tell the client whether or not it 
     1008 * This is used for iChat's "available" messages, and maybe ICQ extended
     1009 * status messages?  It's also used to tell the client whether or not it
    10101010 * needs to upload an SSI buddy icon... who engineers this stuff, anyway?
    10111011 */
     
    10171017        fu8_t flags, length;
    10181018
    1019         type = aimbs_get16(bs); 
     1019        type = aimbs_get16(bs);
    10201020        flags = aimbs_get8(bs);
    10211021        length = aimbs_get8(bs);
Note: See TracChangeset for help on using the changeset viewer.