Changeset 177

Show
Ignore:
Timestamp:
28/04/07 16:11:05 (19 months ago)
Author:
smoku
Message:

Removed HAVE_IDN checks. libidn is required. Closes #27

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/c2s/authreg.c

    r156 r177  
    2121#include "c2s.h" 
    2222 
    23 #ifdef HAVE_IDN 
    2423#include <stringprep.h> 
    25 #endif 
    2624 
    2725/* authreg module manager */ 
     
    200198 
    201199    snprintf(username, 1024, "%.*s", NAD_CDATA_L(nad, elem), NAD_CDATA(nad, elem)); 
    202 #ifdef HAVE_IDN 
    203200    if(stringprep_xmpp_nodeprep(username, 1024) != 0) { 
    204201        log_debug(ZONE, "auth get username failed nodeprep, bouncing it"); 
     
    206203        return; 
    207204    } 
    208 #endif 
    209205 
    210206    ar_mechs = c2s->ar_mechanisms; 
     
    300296 
    301297    snprintf(username, 1024, "%.*s", NAD_CDATA_L(nad, elem), NAD_CDATA(nad, elem)); 
    302 #ifdef HAVE_IDN 
    303298    if(stringprep_xmpp_nodeprep(username, 1024) != 0) { 
    304299        log_debug(ZONE, "auth set username failed nodeprep, bouncing it"); 
     
    306301        return; 
    307302    } 
    308 #endif 
    309303 
    310304    /* make sure we have the resource */ 
     
    320314 
    321315    snprintf(resource, 1024, "%.*s", NAD_CDATA_L(nad, elem), NAD_CDATA(nad, elem)); 
    322 #ifdef HAVE_IDN 
    323316    if(stringprep_xmpp_resourceprep(resource, 1024) != 0) { 
    324317        log_debug(ZONE, "auth set resource failed resourceprep, bouncing it"); 
     
    326319        return; 
    327320    } 
    328 #endif 
    329321 
    330322    ar_mechs = c2s->ar_mechanisms; 
     
    580572 
    581573    snprintf(username, 1024, "%.*s", NAD_CDATA_L(nad, elem), NAD_CDATA(nad, elem)); 
    582 #ifdef HAVE_IDN 
    583574    if(stringprep_xmpp_nodeprep(username, 1024) != 0) { 
    584575        log_debug(ZONE, "register set username failed nodeprep, bouncing it"); 
     
    586577        return; 
    587578    } 
    588 #endif 
    589579 
    590580    elem = nad_find_elem(nad, 1, ns, "password", 1); 
  • trunk/c2s/main.c

    r176 r177  
    2121#include "c2s.h" 
    2222 
    23 #ifdef HAVE_IDN 
    2423#include <stringprep.h> 
    25 #endif 
    2624 
    2725static sig_atomic_t c2s_shutdown = 0; 
     
    592590        strncpy(id, elem->values[i], 1024); 
    593591        id[1023] = '\0'; 
    594 #ifdef HAVE_IDN 
    595592        if (stringprep_nameprep(id, 1024) != 0) { 
    596593            log_write(c2s->log, LOG_ERR, "cannot stringprep id %s, aborting", id); 
    597594            exit(1); 
    598595        } 
    599 #endif 
    600596 
    601597        host->realm = (realm != NULL) ? realm : pstrdup(xhash_pool(c2s->hosts), id); 
  • trunk/configure.in

    r175 r177  
    274274        AC_MSG_ERROR([Libidn >= 0.3.0 not found]) 
    275275    fi 
    276  
    277     AC_DEFINE(HAVE_IDN,1,[Define to 1 if Libidn is available.]) 
    278276fi 
    279277 
  • trunk/sm/main.c

    r162 r177  
    2020 
    2121#include "sm.h" 
    22  
    23 #ifdef HAVE_IDN 
    24   #include <stringprep.h> 
    25 #endif 
     22#include <stringprep.h> 
    2623 
    2724/** @file sm/main.c 
     
    252249    strncpy(id, sm->id, 1024); 
    253250    id[sizeof(id)-1] = '\0'; 
    254 #ifdef HAVE_IDN 
    255251    if (stringprep_nameprep(id, 1024) != 0) { 
    256252        log_write(sm->log, LOG_ERR, "cannot stringprep id %s, aborting", sm->id); 
    257253        exit(1); 
    258254    } 
    259 #endif 
    260255    sm->id = id; 
    261256 
  • trunk/sm/mod_amp.c

    r141 r177  
    2323#include "sm.h" 
    2424#include "util/util.h" 
    25 #ifdef HAVE_IDN 
    2625#include <stringprep.h> 
    27 #endif 
    2826 
    2927/** @file sm/mod_amp.c 
  • trunk/util/jid.c

    r159 r177  
    2020 
    2121#include "util.h" 
    22  
    23 #ifdef HAVE_IDN 
    2422#include <stringprep.h> 
    25 #endif 
    2623 
    2724/** Forward declaration **/ 
     
    3027/** preparation cache */ 
    3128prep_cache_t prep_cache_new(void) { 
    32 #ifdef HAVE_IDN 
    3329    prep_cache_t pc; 
    3430 
     
    4137 
    4238    return pc; 
    43 #else 
    44     return NULL; 
    45 #endif 
    4639} 
    4740 
    4841void prep_cache_free(prep_cache_t pc) { 
    49 #ifdef HAVE_IDN 
    5042    xhash_free(pc->node); 
    5143    xhash_free(pc->domain); 
    5244    xhash_free(pc->resource); 
    5345    free(pc); 
    54 #endif 
    5546} 
    5647 
     
    8172/** do stringprep on the pieces */ 
    8273static int jid_prep_pieces(prep_cache_t pc, char *node, char *domain, char *resource) { 
    83 #ifdef HAVE_IDN 
    8474    char str[1024], *prep; 
    8575 
     
    138128    } 
    139129 
    140 #endif 
    141130    return 0; 
    142131}