Ignore:
Timestamp:
2007-02-18T22:45:39Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
34337a7
Parents:
0fd8559
Message:

Added Jabber server port number restrictions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r0fd8559 r0f4c1bb5  
    3737        set_t *s;
    3838       
    39         s = set_add( &acc->set, "port", "5222", set_eval_int, acc );
     39        s = set_add( &acc->set, "port", JABBER_PORT_DEFAULT, set_eval_int, acc );
    4040        s->flags |= ACC_SET_OFFLINE_ONLY;
    4141       
     
    161161        set_login_progress( gc, 0, "Connecting" );
    162162       
     163        if( set_getint( &acc->set, "port" ) < JABBER_PORT_MIN ||
     164            set_getint( &acc->set, "port" ) > JABBER_PORT_MAX )
     165        {
     166                serv_got_crap( gc, "Incorrect port number, must be in the %d-%d range",
     167                               JABBER_PORT_MIN, JABBER_PORT_MAX );
     168                signoff( gc );
     169                return;
     170        }
     171       
    163172        /* For non-SSL connections we can try to use the port # from the SRV
    164173           reply, but let's not do that when using SSL, SSL usually runs on
Note: See TracChangeset for help on using the changeset viewer.