Changeset 8efa2f4


Ignore:
Timestamp:
2005-12-08T14:57:13Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
09adf08
Parents:
7989fcf3 (diff), c2295f7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge some fixes from my integration branch

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • crypting.c

    r7989fcf3 r8efa2f4  
    4646} irc_t;
    4747
    48 #define set_add( a, b, c, d )
    49 #define set_find( a, b ) NULL
    50 
    5148#include "md5.h"
    5249#include "crypting.h"
     
    6966void setpassnc (irc_t *irc, const char *pass)
    7067{
    71         if (!set_find (irc, "password"))
    72                 set_add (irc, "password", NULL, passchange);
    73        
    7468        if (irc->password) g_free (irc->password);
    7569       
     
    8276}
    8377
    84 char *passchange (irc_t *irc, void *set, char *value) {
    85         setpassnc (irc, value);
    86         return (NULL);
    87 }
    88 
    89 int setpass (irc_t *irc, const char *pass, char* md5sum) {
     78int setpass (irc_t *irc, const char *pass, const char* md5sum)
     79{
    9080        md5_state_t md5state;
    9181        md5_byte_t digest[16];
  • crypting.h

    r7989fcf3 r8efa2f4  
    2525
    2626void setpassnc (irc_t *irc, const char *pass); /* USE WITH CAUTION! */
    27 char *passchange (irc_t *irc, void *set, char *value);
    28 int setpass (irc_t *irc, const char *pass, char* md5sum);
     27int setpass (irc_t *irc, const char *pass, const char* md5sum);
    2928char *hashpass (irc_t *irc);
    3029char *obfucrypt (irc_t *irc, char *line);
  • irc.c

    r7989fcf3 r8efa2f4  
    3131
    3232GSList *irc_connection_list = NULL;
     33
     34char *passchange (irc_t *irc, void *set, char *value)
     35{
     36        setpassnc (irc, value);
     37        return (NULL);
     38}
    3339
    3440irc_t *irc_new( int fd )
     
    129135        set_add( irc, "to_char", ": ", set_eval_to_char );
    130136        set_add( irc, "typing_notice", "false", set_eval_bool );
     137        set_add( irc, "password", NULL, passchange);
    131138       
    132139        conf_loaddefaults( irc );
  • nick.c

    r7989fcf3 r8efa2f4  
    2727#include "bitlbee.h"
    2828
    29 void nick_set( irc_t *irc, char *handle, int proto, char *nick )
     29void nick_set( irc_t *irc, const char *handle, int proto, const char *nick )
    3030{
    3131        nick_t *m = NULL, *n = irc->nicks;
     
    5656}
    5757
    58 char *nick_get( irc_t *irc, char *handle, int proto, const char *realname )
     58char *nick_get( irc_t *irc, const char *handle, int proto, const char *realname )
    5959{
    6060        static char nick[MAX_NICK_LENGTH+1];
     
    129129}
    130130
    131 void nick_del( irc_t *irc, char *nick )
     131void nick_del( irc_t *irc, const char *nick )
    132132{
    133133        nick_t *l = NULL, *n = irc->nicks;
     
    176176}
    177177
    178 int nick_ok( char *nick )
    179 {
    180         char *s;
     178int nick_ok( const char *nick )
     179{
     180        const char *s;
    181181       
    182182        /* Empty/long nicks are not allowed */
     
    237237}
    238238
    239 int nick_cmp( char *a, char *b )
     239int nick_cmp( const char *a, const char *b )
    240240{
    241241        char aa[1024] = "", bb[1024] = "";
     
    253253}
    254254
    255 char *nick_dup( char *nick )
    256 {
    257         char *cp;
    258        
    259         cp = g_new0 ( char, MAX_NICK_LENGTH + 1 );
    260         strncpy( cp, nick, MAX_NICK_LENGTH );
    261        
    262         return( cp );
    263 }
     255char *nick_dup( const char *nick )
     256{
     257        return g_strndup( nick, MAX_NICK_LENGTH );
     258}
  • nick.h

    r7989fcf3 r8efa2f4  
    3232} nick_t;
    3333
    34 void nick_set( irc_t *irc, char *handle, int proto, char *nick );
    35 char *nick_get( irc_t *irc, char *handle, int proto, const char *realname );
    36 void nick_del( irc_t *irc, char *nick );
     34void nick_set( irc_t *irc, const char *handle, int proto, const char *nick );
     35char *nick_get( irc_t *irc, const char *handle, int proto, const char *realname );
     36void nick_del( irc_t *irc, const char *nick );
    3737void nick_strip( char *nick );
    3838
    39 int nick_ok( char *nick );
     39int nick_ok( const char *nick );
    4040int nick_lc( char *nick );
    4141int nick_uc( char *nick );
    42 int nick_cmp( char *a, char *b );
    43 char *nick_dup( char *nick );
     42int nick_cmp( const char *a, const char *b );
     43char *nick_dup( const char *nick );
  • protocols/proxy.c

    r7989fcf3 r8efa2f4  
    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;
     
    8373
    8474
    85 static struct sockaddr_in *gaim_gethostbyname(char *host, int port)
     75static struct sockaddr_in *gaim_gethostbyname(const char *host, int port)
    8676{
    8777        static struct sockaddr_in sin;
     
    154144}
    155145
    156 static int proxy_connect_none(char *host, unsigned short port, struct PHB *phb)
     146static int proxy_connect_none(const char *host, unsigned short port, struct PHB *phb)
    157147{
    158148        struct sockaddr_in *sin;
     
    281271}
    282272
    283 static int proxy_connect_http(char *host, unsigned short port, struct PHB *phb)
     273static int proxy_connect_http(const char *host, unsigned short port, struct PHB *phb)
    284274{
    285275        phb->host = g_strdup(host);
     
    365355}
    366356
    367 static int proxy_connect_socks4(char *host, unsigned short port, struct PHB *phb)
     357static int proxy_connect_socks4(const char *host, unsigned short port, struct PHB *phb)
    368358{
    369359        phb->host = g_strdup(host);
     
    547537}
    548538
    549 static int proxy_connect_socks5(char *host, unsigned short port, struct PHB *phb)
     539static int proxy_connect_socks5(const char *host, unsigned short port, struct PHB *phb)
    550540{
    551541        phb->host = g_strdup(host);
     
    588578}
    589579
    590 int proxy_connect(char *host, int port, GaimInputFunction func, gpointer data)
     580int proxy_connect(const char *host, int port, GaimInputFunction func, gpointer data)
    591581{
    592582        struct PHB *phb;
  • protocols/proxy.h

    r7989fcf3 r8efa2f4  
    5656G_MODULE_EXPORT void gaim_input_remove(gint);
    5757
    58 G_MODULE_EXPORT int proxy_connect(char *host, int port, GaimInputFunction func, gpointer data);
     58G_MODULE_EXPORT int proxy_connect(const char *host, int port, GaimInputFunction func, gpointer data);
    5959
    6060#endif /* _PROXY_H_ */
Note: See TracChangeset for help on using the changeset viewer.