Changeset 720

Show
Ignore:
Timestamp:
02/25/08 07:55:36 (9 months ago)
Author:
dsallings
Message:

Print the listening protocol in debug.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/binary/server/memcached.c

    r719 r720  
    295295} 
    296296 
     297static char *prot_text(const int prot) { 
     298    char *rv="unknown"; 
     299    switch(prot) { 
     300        case ascii_prot: 
     301            rv="ascii"; 
     302            break; 
     303        case binary_prot: 
     304            rv="binary"; 
     305            break; 
     306        case ascii_udp_prot: 
     307            rv="ascii-udp"; 
     308            break; 
     309    } 
     310    return rv; 
     311} 
     312 
    297313conn *conn_new(const int sfd, const int init_state, const int event_flags, 
    298314                const int read_buffer_size, const int prot, 
     
    356372    if (settings.verbose > 1) { 
    357373        if (init_state == conn_listening) { 
    358             fprintf(stderr, "<%d server listening\n", sfd); 
     374            fprintf(stderr, "<%d server listening (%s)\n", sfd, 
     375                prot_text(prot)); 
    359376        } else if (IS_UDP(prot)) { 
    360377            fprintf(stderr, "<%d server listening (udp)\n", sfd); 
     
    35643581        /* create the UDP listening socket and bind it */ 
    35653582        u_socket = server_socket(settings.udpport, ascii_udp_prot, 
    3566                        &u_socket_count); 
     3583            &u_socket_count); 
    35673584        if (u_socket == NULL) { 
    35683585            fprintf(stderr, "failed to listen on UDP port %d\n", settings.udpport);