Ignore:
Timestamp:
Aug 15, 2008, 8:28:43 PM (13 years ago)
Author:
charles
Message:

(libT) fix a couple of compiler warnings from gcc -Wmissing-prototypes -Wdeclaration-after-statement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpc-server.c

    r6533 r6534  
    133133handle_upload( struct shttpd_arg * arg )
    134134{
    135     struct tr_rpc_server * s = arg->user_data;
     135    struct tr_rpc_server * s;
     136    struct ConnBuf * cbuf;
     137
     138    s = arg->user_data;
    136139    s->lastRequestTime = time( NULL );
    137     struct ConnBuf * cbuf = getBuffer( s, arg );
     140    cbuf = getBuffer( s, arg );
    138141
    139142    /* if we haven't parsed the POST, do that now */
    140143    if( !EVBUFFER_LENGTH( cbuf->out ) )
    141144    {
     145        const char * query_string;
     146        const char * content_type;
     147        const char * delim;
     148        const char * in;
     149        size_t inlen;
     150        char * boundary;
     151        size_t boundary_len;
     152        char buf[64];
     153        int paused;
     154
    142155        /* if we haven't finished reading the POST, read more now */
    143156        evbuffer_add( cbuf->in, arg->in.buf, arg->in.len );
     
    146159            return;
    147160
    148         const char * query_string = shttpd_get_env( arg, "QUERY_STRING" );
    149         const char * content_type = shttpd_get_header( arg, "Content-Type" );
    150         const char * delim;
    151         const char * in = (const char *) EVBUFFER_DATA( cbuf->in );
    152         size_t inlen = EVBUFFER_LENGTH( cbuf->in );
    153         char * boundary = tr_strdup_printf( "--%s", strstr( content_type, "boundary=" ) + strlen( "boundary=" ) );
    154         const size_t boundary_len = strlen( boundary );
    155         char buf[64];
    156         int paused = ( query_string != NULL )
    157                   && ( shttpd_get_var( "paused", query_string, strlen( query_string ), buf, sizeof( buf ) ) == 4 )
    158                   && ( !strcmp( buf, "true" ) );
     161        query_string = shttpd_get_env( arg, "QUERY_STRING" );
     162        content_type = shttpd_get_header( arg, "Content-Type" );
     163        in = (const char *) EVBUFFER_DATA( cbuf->in );
     164        inlen = EVBUFFER_LENGTH( cbuf->in );
     165        boundary = tr_strdup_printf( "--%s", strstr( content_type, "boundary=" ) + strlen( "boundary=" ) );
     166        boundary_len = strlen( boundary );
     167        paused = ( query_string != NULL )
     168              && ( shttpd_get_var( "paused", query_string, strlen( query_string ), buf, sizeof( buf ) ) == 4 )
     169              && ( !strcmp( buf, "true" ) );
    159170
    160171        delim = tr_memmem( in, inlen, boundary, boundary_len );
     
    258269handle_rpc( struct shttpd_arg * arg )
    259270{
    260     struct tr_rpc_server * s = arg->user_data;
     271    struct tr_rpc_server * s;
     272    struct ConnBuf * cbuf;
     273
     274    s = arg->user_data;
    261275    s->lastRequestTime = time( NULL );
    262     struct ConnBuf * cbuf = getBuffer( s, arg );
     276    cbuf = getBuffer( s, arg );
    263277
    264278    if( !EVBUFFER_LENGTH( cbuf->out ) )
Note: See TracChangeset for help on using the changeset viewer.