Changeset 672

Show
Ignore:
Timestamp:
15/08/08 19:50:22 (5 months ago)
Author:
smoku
Message:

Implemented logging of compressed conection established. Closes #243

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/c2s/authreg.c

    r629 r672  
    322322    if(authd) 
    323323    { 
    324         log_write(c2s->log, LOG_NOTICE, "[%d] legacy authentication succeeded: host=%s, username=%s, resource=%s%s", sess->s->tag, sess->host->realm, username, resource, sess->s->ssf ? ", TLS negotiated" : ""); 
     324        log_write(c2s->log, LOG_NOTICE, "[%d] legacy authentication succeeded: host=%s, username=%s, resource=%s%s%s", sess->s->tag, sess->host->realm, username, resource, sess->s->ssf ? ", TLS negotiated" : "", sess->s->compressed ? ", ZLIB compression enabled" : ""); 
    325325 
    326326        /* create new bound jid holder */ 
  • trunk/c2s/c2s.c

    r662 r672  
    473473            /* they sasl auth'd, so we only want the new-style session start */ 
    474474            else { 
    475                 log_write(sess->c2s->log, LOG_NOTICE, "[%d] SASL authentication succeeded: mechanism=%s; authzid=%s%s", sess->s->tag, &sess->s->auth_method[5], sess->s->auth_id, sess->s->ssf ? ", TLS negotiated" : ""); 
     475                log_write(sess->c2s->log, LOG_NOTICE, "[%d] SASL authentication succeeded: mechanism=%s; authzid=%s%s%s", sess->s->tag, &sess->s->auth_method[5], sess->s->auth_id, sess->s->ssf ? ", TLS negotiated" : "", sess->s->compressed ? ", ZLIB compression enabled" : ""); 
    476476                sess->sasl_authd = 1; 
    477477            } 
  • trunk/c2s/main.c

    r662 r672  
    692692#endif 
    693693 
     694#ifdef HAVE_LIBZ 
     695    /* get compression up and running */ 
     696    if(c2s->compression) 
     697        sx_env_plugin(c2s->sx_env, sx_compress_init); 
     698#endif 
     699 
     700#ifdef ENABLE_EXPERIMENTAL 
     701    /* get stanza ack up */ 
     702    sx_env_plugin(c2s->sx_env, sx_ack_init); 
     703 
     704    /* and user IP address plugin */ 
     705    sx_env_plugin(c2s->sx_env, sx_address_init); 
     706#endif 
     707 
    694708    /* get sasl online */ 
    695709    c2s->sx_sasl = sx_env_plugin(c2s->sx_env, sx_sasl_init, "xmpp", _c2s_sx_sasl_callback, (void *) c2s); 
     
    698712        exit(1); 
    699713    } 
    700  
    701 #ifdef HAVE_LIBZ 
    702     /* get compression up and running */ 
    703     if(c2s->compression) 
    704         sx_env_plugin(c2s->sx_env, sx_compress_init); 
    705 #endif 
    706  
    707 #ifdef ENABLE_EXPERIMENTAL 
    708     /* get stanza ack up */ 
    709     sx_env_plugin(c2s->sx_env, sx_ack_init); 
    710  
    711     /* and user IP address plugin */ 
    712     sx_env_plugin(c2s->sx_env, sx_address_init); 
    713 #endif 
    714714 
    715715    /* get bind up */ 
  • trunk/sx/compress.c

    r658 r672  
    4343 
    4444    /* only want compress packets */ 
    45     if(NAD_ENS(nad, 0) < 0 || NAD_NURI_L(nad, NAD_ENS(nad, 0)) != strlen(uri_COMPRESS) || strncmp(NAD_NURI(nad, NAD_ENS(nad, 0)), uri_COMPRESS, strlen(uri_COMPRESS)) != 0) 
     45    if(NAD_ENS(nad, 0) < 0 || NAD_NURI_L(nad, NAD_ENS(nad, 0)) != sizeof(uri_COMPRESS)-1 || strncmp(NAD_NURI(nad, NAD_ENS(nad, 0)), uri_COMPRESS, sizeof(uri_COMPRESS)-1) != 0) 
    4646        return 1; 
    4747 
     
    6060 
    6161            /* go ahead */ 
    62             jqueue_push(s->wbufq, _sx_buffer_new("<compressed xmlns='" uri_COMPRESS "'/>", strlen(uri_COMPRESS) + 22, _sx_compress_notify_compress, NULL), 0); 
     62            jqueue_push(s->wbufq, _sx_buffer_new("<compressed xmlns='" uri_COMPRESS "'/>", sizeof(uri_COMPRESS)-1 + 22, _sx_compress_notify_compress, NULL), 0); 
    6363            s->want_write = 1; 
    6464 
     
    224224            _sx_buffer_alloc_margin(buf, 0, SX_COMPRESS_CHUNK); 
    225225 
    226                 sc->rstrm.avail_out = SX_COMPRESS_CHUNK; 
     226            sc->rstrm.avail_out = SX_COMPRESS_CHUNK; 
    227227            sc->rstrm.next_out = buf->data + buf->len; 
    228228 
     
    362362 
    363363    /* go */ 
    364     jqueue_push(s->wbufq, _sx_buffer_new("<compress xmlns='" uri_COMPRESS "'><method>zlib</method></compress>", strlen(uri_COMPRESS) + 51, NULL, NULL), 0); 
     364    jqueue_push(s->wbufq, _sx_buffer_new("<compress xmlns='" uri_COMPRESS "'><method>zlib</method></compress>", sizeof(uri_COMPRESS)-1 + 51, NULL, NULL), 0); 
    365365    s->want_write = 1; 
    366366    _sx_event(s, event_WANT_WRITE, NULL);