Changeset 9626


Ignore:
Timestamp:
Nov 29, 2009, 8:05:47 AM (13 years ago)
Author:
charles
Message:

(trunk libT) resolve "noslashes" vs "keep_slashes" variable name inconsistency between the declaration and the definition of tr_http_escape()

Location:
trunk/libtransmission
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer.c

    r9593 r9626  
    704704        inet_ntop( AF_INET6, ipv6, ipv6_readable, INET6_ADDRSTRLEN );
    705705        evbuffer_add_printf( buf, "&ipv6=");
    706         tr_http_escape( buf, ipv6_readable, strlen(ipv6_readable), 0 );
     706        tr_http_escape( buf, ipv6_readable, strlen(ipv6_readable), TRUE );
    707707    }
    708708
  • trunk/libtransmission/web.c

    r9531 r9626  
    650650
    651651/* escapes a string to be URI-legal as per RFC 2396.
    652    like curl_escape() but can optionally avoid munging slashes. */
     652   like curl_escape() but can optionally avoid escaping slashes. */
    653653void
    654 tr_http_escape( struct evbuffer *out, const char *str, int len, int keep_slashes )
     654tr_http_escape( struct evbuffer  * out,
     655                const char       * str,
     656                int                len,
     657                tr_bool            escape_slashes )
    655658{
    656659    int i;
     660
     661    if( ( len < 0 ) && ( str != NULL ) )
     662        len = strlen( str );
    657663
    658664    for( i = 0; i < len; i++ ) {
     
    674680            break;
    675681        case '/':
    676             if(keep_slashes) {
     682            if(!escape_slashes) {
    677683                evbuffer_add( out, &str[i], 1 );
    678684                break;
  • trunk/libtransmission/web.h

    r9531 r9626  
    3939struct evbuffer;
    4040
    41 void tr_http_escape( struct evbuffer *out, const char *str, int len, int noslashes );
     41void tr_http_escape( struct evbuffer *out, const char *str, int len, tr_bool escape_slashes );
    4242
    4343char* tr_http_unescape( const char * str, int len );
  • trunk/libtransmission/webseed.c

    r9544 r9626  
    110110    /* if url ends with a '/', add the torrent name */
    111111    if( url[url_len - 1] == '/' && file->name )
    112         tr_http_escape( out, file->name, strlen(file->name), 1 );
     112        tr_http_escape( out, file->name, strlen(file->name), FALSE );
    113113
    114114    ret = tr_strndup( EVBUFFER_DATA( out ), EVBUFFER_LENGTH( out ) );
Note: See TracChangeset for help on using the changeset viewer.