Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/proxy.c

    r21d09ac r7b23afd  
    5050#define GAIM_ERR_COND   (G_IO_HUP | G_IO_ERR | G_IO_NVAL)
    5151
    52 /*FIXME*               
    53         #ifndef _WIN32
    54                 if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
    55                         closesocket(fd);
    56                         g_free(phb);
    57                         return -1;
    58                 }
    59                 fcntl(fd, F_SETFL, 0);
    60 #endif*/
    61 
    6252char proxyhost[128] = "";
    6353int proxyport = 0;
     
    10797}
    10898
     99#ifdef PROXYPROFILER
     100struct proxyprofiler
     101{
     102        GaimInputFunction function;
     103        gpointer data;
     104       
     105        int count;
     106       
     107        struct proxyprofiler *next;
     108} *pp = NULL;
     109
     110void proxyprofiler_dump()
     111{
     112        struct proxyprofiler *l;
     113        char s[128];
     114        FILE *fp;
     115       
     116        sprintf( s, "proxyprofiler.%d", (int) getpid() );
     117        fp = fopen( s, "w" );
     118       
     119        fprintf( fp, "%-18s  %-18s  %10s\n", "Function", "Data", "Count" );
     120        for( l = pp; l; l = l->next )
     121                fprintf( fp, "0x%-16x  0x%-16x  %10d\n", (int) l->function, (int) l->data, l->count );
     122       
     123        fclose( fp );
     124}
     125#endif
     126
    109127static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data)
    110128{
     
    112130        GaimInputCondition gaim_cond = 0;
    113131
     132#ifdef PROXYPROFILER
     133        struct proxyprofiler *l;
     134       
     135        for( l = pp; l; l = l->next )
     136        {
     137                if( closure->function == l->function && closure->data == l->data )
     138                        break;
     139        }
     140        if( l )
     141        {
     142                l->count ++;
     143        }
     144        else
     145        {
     146                l = g_new0( struct proxyprofiler, 1 );
     147                l->function = closure->function;
     148                l->data = closure->data;
     149                l->count = 1;
     150               
     151                l->next = pp;
     152                pp = l;
     153        }
     154#endif
     155       
     156        count_io_event(source, "proxy");
     157       
    114158        if (condition & GAIM_READ_COND)
    115159                gaim_cond |= GAIM_INPUT_READ;
Note: See TracChangeset for help on using the changeset viewer.