Changeset ca974d7


Ignore:
Timestamp:
2011-12-04T19:14:29Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
df98ee8
Parents:
bd31661
Message:

Debug output tweaks: Try to send everything to stderr, and add ifdef to
enable printing of all SSL traffic.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/ssl_gnutls.c

    rbd31661 rca974d7  
    4444#define GNUTLS_STUPID_CAST (int)
    4545#endif
     46
     47#define SSLDEBUG 0
    4648
    4749struct scd
     
    198200                ssl_errno = SSL_AGAIN;
    199201       
    200         if( 0 && getenv( "BITLBEE_DEBUG" ) && st > 0 ) len = write( 1, buf, st );
     202        if( SSLDEBUG && getenv( "BITLBEE_DEBUG" ) && st > 0 ) len = write( 2, buf, st );
    201203       
    202204        return st;
     
    219221                ssl_errno = SSL_AGAIN;
    220222       
    221         if( 0 && getenv( "BITLBEE_DEBUG" ) && st > 0 ) len = write( 1, buf, st );
     223        if( SSLDEBUG && getenv( "BITLBEE_DEBUG" ) && st > 0 ) len = write( 2, buf, st );
    222224       
    223225        return st;
  • lib/xmltree.c

    rbd31661 rca974d7  
    330330        /* Indentation */
    331331        for( c = node; c->parent; c = c->parent )
    332                 printf( "    " );
     332                fprintf( stderr, "    " );
    333333       
    334334        /* Start the tag */
    335         printf( "<%s", node->name );
     335        fprintf( stderr, "<%s", node->name );
    336336       
    337337        /* Print the attributes */
     
    339339        {
    340340                char *v = g_markup_escape_text( node->attr[i].value, -1 );
    341                 printf( " %s=\"%s\"", node->attr[i].key, v );
     341                fprintf( stderr, " %s=\"%s\"", node->attr[i].key, v );
    342342                g_free( v );
    343343        }
     
    348348        if( node->text == NULL && node->children == NULL )
    349349        {
    350                 printf( "/>\n" );
     350                fprintf( stderr, "/>\n" );
    351351                return;
    352352                /* Then we're finished! */
     
    354354       
    355355        /* Otherwise... */
    356         printf( ">" );
     356        fprintf( stderr, ">" );
    357357       
    358358        /* Only print the text if it contains more than whitespace (TEST). */
     
    363363                {
    364364                        char *v = g_markup_escape_text( node->text, -1 );
    365                         printf( "%s", v );
     365                        fprintf( stderr, "%s", v );
    366366                        g_free( v );
    367367                }
     
    369369       
    370370        if( node->children )
    371                 printf( "\n" );
     371                fprintf( stderr, "\n" );
    372372       
    373373        for( c = node->children; c; c = c->next )
     
    376376        if( node->children )
    377377                for( c = node; c->parent; c = c->parent )
    378                         printf( "    " );
     378                        fprintf( stderr, "    " );
    379379       
    380380        /* Non-empty tag is now finished. */
    381         printf( "</%s>\n", node->name );
     381        fprintf( stderr, "</%s>\n", node->name );
    382382}
    383383
  • protocols/msn/soap.c

    rbd31661 rca974d7  
    218218        {
    219219                if( ( s = strstr( headers, "\r\n\r\n" ) ) )
    220                         st = write( 1, headers, s - headers + 4 );
     220                        st = write( 2, headers, s - headers + 4 );
    221221                else
    222                         st = write( 1, headers, strlen( headers ) );
     222                        st = write( 2, headers, strlen( headers ) );
    223223        }
    224224       
     
    663663       
    664664        if( getenv( "BITLBEE_DEBUG" ) )
    665                 printf( "%p %s %d\n", bu, handle, bd->flags );
     665                fprintf( stderr, "%p %s %d\n", bu, handle, bd->flags );
    666666       
    667667        return XT_HANDLED;
     
    810810       
    811811        if( getenv( "BITLBEE_DEBUG" ) )
    812                 printf( "%s %s\n", id, name );
     812                fprintf( stderr, "%s %s\n", id, name );
    813813       
    814814        return XT_HANDLED;
     
    871871       
    872872        if( getenv( "BITLBEE_DEBUG" ) )
    873                 printf( "%s %s %s %s\n", id, type, handle, display_name );
     873                fprintf( stderr, "%s %s %s %s\n", id, type, handle, display_name );
    874874       
    875875        return XT_HANDLED;
Note: See TracChangeset for help on using the changeset viewer.