Changeset 019c031 for protocols/jabber


Ignore:
Timestamp:
2005-12-04T21:55:15Z (19 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
568aaf7
Parents:
500a1b6 (diff), d636233 (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 from Wilmer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r500a1b6 r019c031  
    2222 */
    2323
    24 #ifdef HAVE_CONFIG_H
    25 #include "config.h"
    26 #endif
    27 
    2824#ifndef _WIN32
    2925#include <sys/utsname.h>
     
    5955#define DEFAULT_PORT 5222
    6056#define DEFAULT_PORT_SSL 5223
     57#define JABBER_PORT_MIN 5220
     58#define JABBER_PORT_MAX 5229
    6159
    6260#define JABBER_GROUP "Friends"
     
    541539        gjconn gjc;
    542540       
    543         if (!g_slist_find(get_connections(), gc)) {
    544                 ssl_disconnect(source);
    545                 return;
    546         }
    547        
    548541        jd = gc->proto_data;
    549542        gjc = jd->gjc;
     
    551544        if (source == NULL) {
    552545                STATE_EVT(JCONN_STATE_OFF)
     546                return;
     547        }
     548       
     549        if (!g_slist_find(get_connections(), gc)) {
     550                ssl_disconnect(source);
    553551                return;
    554552        }
     
    589587        else if (port == -1 && ssl)
    590588                port = DEFAULT_PORT_SSL;
     589        else if (port < JABBER_PORT_MIN || port > JABBER_PORT_MAX) {
     590                serv_got_crap(GJ_GC(gjc), "For security reasons, the Jabber port number must be in the %d-%d range.", JABBER_PORT_MIN, JABBER_PORT_MAX);
     591                STATE_EVT(JCONN_STATE_OFF)
     592                return;
     593        }
    591594       
    592595        if (server == NULL)
Note: See TracChangeset for help on using the changeset viewer.