Changeset 0f4c1bb5


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

Added Jabber server port number restrictions.

Location:
protocols/jabber
Files:
2 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
  • protocols/jabber/jabber.h

    r0fd8559 r0f4c1bb5  
    5151                                           XEP85 (typing notification shite). */
    5252} jabber_buddy_flags_t;
     53
     54#define JABBER_PORT_DEFAULT "5222"
     55#define JABBER_PORT_MIN 5220
     56#define JABBER_PORT_MAX 5229
    5357
    5458struct jabber_data
Note: See TracChangeset for help on using the changeset viewer.