Changeset 7869e48 for libfaim/conn.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/conn.c

    rcf02dd6 r7869e48  
    88#define FAIM_INTERNAL
    99#define FAIM_NEED_CONN_INTERNAL
    10 #include <aim.h> 
     10#include <aim.h>
    1111
    1212#ifndef _WIN32
     
    2323 * In OSCAR, every connection has a set of SNAC groups associated
    2424 * with it.  These are the groups that you can send over this connection
    25  * without being guarenteed a "Not supported" SNAC error. 
    26  *
    27  * The grand theory of things says that these associations transcend 
     25 * without being guarenteed a "Not supported" SNAC error.
     26 *
     27 * The grand theory of things says that these associations transcend
    2828 * what libfaim calls "connection types" (conn->type).  You can probably
    29  * see the elegance here, but since I want to revel in it for a bit, you 
     29 * see the elegance here, but since I want to revel in it for a bit, you
    3030 * get to hear it all spelled out.
    3131 *
     
    3333 * of your modules has just given you a SNAC of the group 0x0004 to send
    3434 * you.  Maybe an IM destined for some twit in Greenland.  So you start
    35  * at the top of your connection list, looking for a connection that 
     35 * at the top of your connection list, looking for a connection that
    3636 * claims to support group 0x0004.  You find one.  Why, that neat BOS
    3737 * connection of yours can do that.  So you send it on its way.
     
    5151 * that connection.  One of the first things you get from this new server
    5252 * is a message saying that indeed it does support the group you were looking
    53  * for.  So you continue and send rate confirmation and all that. 
    54  * 
     53 * for.  So you continue and send rate confirmation and all that.
     54 *
    5555 * Then you remember you had that SNAC to send, and now you have a means to
    5656 * do it, and you do, and everyone is happy.  Except the Greenlander, who is
     
    6565 * to make libfaim work that way.  It would take a fair amount of effort,
    6666 * and probably some client API changes as well.  (Whenever I don't want
    67  * to do something, I just say it would change the client API.  Then I 
     67 * to do something, I just say it would change the client API.  Then I
    6868 * instantly have a couple of supporters of not doing it.)
    6969 *
     
    159159        aim_tx_cleanqueue(sess, *deadconn);
    160160
    161         if ((*deadconn)->fd != -1) 
     161        if ((*deadconn)->fd != -1)
    162162                aim_conn_close(*deadconn);
    163163
     
    251251        aim_conn_t *newconn;
    252252
    253         if (!(newconn = malloc(sizeof(aim_conn_t))))   
     253        if (!(newconn = malloc(sizeof(aim_conn_t))))
    254254                return NULL;
    255255        memset(newconn, 0, sizeof(aim_conn_t));
     
    282282        aim_conn_t *cur, **prev;
    283283
    284         if (!deadconn || !*deadconn)   
     284        if (!deadconn || !*deadconn)
    285285                return;
    286286
     
    307307 * Close (but not free) a connection.
    308308 *
    309  * This leaves everything untouched except for clearing the 
     309 * This leaves everything untouched except for clearing the
    310310 * handler list and setting the fd to -1 (used to recognize
    311311 * dead connections).  It will also remove cookies if necessary.
     
    335335 * @type: Type of connection to look for
    336336 *
    337  * Searches for a connection of the specified type in the 
     337 * Searches for a connection of the specified type in the
    338338 * specified session.  Returns the first connection of that
    339339 * type found.
     
    347347
    348348        for (cur = sess->connlist; cur; cur = cur->next) {
    349                 if ((cur->type == type) && 
     349                if ((cur->type == type) &&
    350350                                !(cur->status & AIM_CONN_STATUS_INPROGRESS))
    351351                        break;
     
    381381
    382382/**
    383  * aim_proxyconnect - An extrememly quick and dirty SOCKS5 interface. 
     383 * aim_proxyconnect - An extrememly quick and dirty SOCKS5 interface.
    384384 * @sess: Session to connect
    385385 * @host: Host to connect to
     
    584584                 * this function only gets called for some of that rendezvous
    585585                 * crap, and not on SNAC connections, its probably okay for
    586                  * now. 
     586                 * now.
    587587                 *
    588588                 */
     
    600600 * Opens a new connection to the specified dest host of specified
    601601 * type, using the proxy settings if available.  If @host is %NULL,
    602  * the connection is allocated and returned, but no connection 
     602 * the connection is allocated and returned, but no connection
    603603 * is made.
    604604 *
     
    625625        }
    626626
    627         /* 
    628          * As of 23 Jul 1999, AOL now sends the port number, preceded by a 
    629          * colon, in the BOS redirect.  This fatally breaks all previous 
     627        /*
     628         * As of 23 Jul 1999, AOL now sends the port number, preceded by a
     629         * colon, in the BOS redirect.  This fatally breaks all previous
    630630         * libfaims.  Bad, bad AOL.
    631631         *
    632          * We put this here to catch every case. 
     632         * We put this here to catch every case.
    633633         *
    634634         */
     
    662662 * @sess: Session to search
    663663 *
    664  * Returns the highest valued filed descriptor of all open 
     664 * Returns the highest valued filed descriptor of all open
    665665 * connections in @sess.
    666666 *
     
    708708 * Waits for a socket with data or for timeout, whichever comes first.
    709709 * See select(2).
    710  * 
     710 *
    711711 * Return codes in *status:
    712712 *   -1  error in select() (%NULL returned)
     
    715715 *    2  incoming data pending (connection with pending data returned)
    716716 *
    717  */ 
     717 */
    718718faim_export aim_conn_t *aim_select(aim_session_t *sess, struct timeval *timeout, int *status)
    719719{
     
    745745        }
    746746
    747         /* 
     747        /*
    748748         * If we have data waiting to be sent, return
    749749         *
     
    762762                *status = 1;
    763763                return NULL;
    764         } 
     764        }
    765765
    766766        if ((i = select(maxfd+1, &fds, &wfds, NULL, timeout))>=1) {
    767767                for (cur = sess->connlist; cur; cur = cur->next) {
    768                         if ((FD_ISSET(cur->fd, &fds)) || 
    769                                         ((cur->status & AIM_CONN_STATUS_INPROGRESS) && 
     768                        if ((FD_ISSET(cur->fd, &fds)) ||
     769                                        ((cur->status & AIM_CONN_STATUS_INPROGRESS) &&
    770770                                        FD_ISSET(cur->fd, &wfds))) {
    771771                                *status = 2;
     
    790790 *
    791791 * This is my lame attempt at overcoming not understanding the rate
    792  * limiting. 
     792 * limiting.
    793793 *
    794794 * XXX: This should really be replaced with something that scales and
     
    817817 * Call this with your SOCKS5 proxy server parameters before
    818818 * the first call to aim_newconn().  If called with all %NULL
    819  * args, it will clear out a previously set proxy. 
     819 * args, it will clear out a previously set proxy.
    820820 *
    821821 * Set username and password to %NULL if not applicable.
     
    833833
    834834        strncpy(sess->socksproxy.server, server, sizeof(sess->socksproxy.server));
    835         if (username && strlen(username)) 
     835        if (username && strlen(username))
    836836                strncpy(sess->socksproxy.username, username, sizeof(sess->socksproxy.username));
    837837        if (password && strlen(password))
     
    850850
    851851/**
    852  * Initializes a session structure by setting the initial values 
     852 * Initializes a session structure by setting the initial values
    853853 * stuff in the aim_session_t struct.
    854854 *
     
    893893        /*
    894894         * This must always be set.  Default to the queue-based
    895          * version for back-compatibility. 
     895         * version for back-compatibility.
    896896         */
    897897        aim_tx_setenqueue(sess, AIM_TX_QUEUED, NULL);
Note: See TracChangeset for help on using the changeset viewer.