diff options
author | ulim <a.sporto+bee@gmail.com> | 2008-06-02 14:58:57 +0200 |
---|---|---|
committer | ulim <a.sporto+bee@gmail.com> | 2008-06-02 14:58:57 +0200 |
commit | c821e8ad0d1cf9ab71e6e34c685d0adea2dde923 (patch) | |
tree | 0273986e236651d17157ccd3907f64242fd13da9 /protocols/msn/ns.c | |
parent | cce0450184b4358ef06d91cca985fa3ca389fcd6 (diff) | |
parent | de8e584d7f4fea214934af094a4df2672d7e0be8 (diff) |
merged in upstream r384. No conflicts.
Diffstat (limited to 'protocols/msn/ns.c')
-rw-r--r-- | protocols/msn/ns.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index ff7da6ed..ffaa90a7 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -177,7 +177,15 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) } debug( "Connecting to a new switchboard with key %s", cmd[5] ); - sb = msn_sb_create( ic, server, port, cmd[5], MSN_SB_NEW ); + + if( ( sb = msn_sb_create( ic, server, port, cmd[5], MSN_SB_NEW ) ) == NULL ) + { + /* Although this isn't strictly fatal for the NS connection, it's + definitely something serious (we ran out of file descriptors?). */ + imcb_error( ic, "Could not create new switchboard" ); + imc_logout( ic, TRUE ); + return( 0 ); + } if( md->msgq ) { @@ -467,8 +475,18 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) debug( "Got a call from %s (session %d). Key = %s", cmd[5], session, cmd[4] ); - sb = msn_sb_create( ic, server, port, cmd[4], session ); - sb->who = g_strdup( cmd[5] ); + if( ( sb = msn_sb_create( ic, server, port, cmd[4], session ) ) == NULL ) + { + /* Although this isn't strictly fatal for the NS connection, it's + definitely something serious (we ran out of file descriptors?). */ + imcb_error( ic, "Could not create new switchboard" ); + imc_logout( ic, TRUE ); + return( 0 ); + } + else + { + sb->who = g_strdup( cmd[5] ); + } } else if( strcmp( cmd[0], "ADD" ) == 0 ) { |