Changeset 9626
- Timestamp:
- Nov 29, 2009, 8:05:47 AM (13 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/announcer.c
r9593 r9626 704 704 inet_ntop( AF_INET6, ipv6, ipv6_readable, INET6_ADDRSTRLEN ); 705 705 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 ); 707 707 } 708 708 -
trunk/libtransmission/web.c
r9531 r9626 650 650 651 651 /* 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. */ 653 653 void 654 tr_http_escape( struct evbuffer *out, const char *str, int len, int keep_slashes ) 654 tr_http_escape( struct evbuffer * out, 655 const char * str, 656 int len, 657 tr_bool escape_slashes ) 655 658 { 656 659 int i; 660 661 if( ( len < 0 ) && ( str != NULL ) ) 662 len = strlen( str ); 657 663 658 664 for( i = 0; i < len; i++ ) { … … 674 680 break; 675 681 case '/': 676 if( keep_slashes) {682 if(!escape_slashes) { 677 683 evbuffer_add( out, &str[i], 1 ); 678 684 break; -
trunk/libtransmission/web.h
r9531 r9626 39 39 struct evbuffer; 40 40 41 void tr_http_escape( struct evbuffer *out, const char *str, int len, int noslashes );41 void tr_http_escape( struct evbuffer *out, const char *str, int len, tr_bool escape_slashes ); 42 42 43 43 char* tr_http_unescape( const char * str, int len ); -
trunk/libtransmission/webseed.c
r9544 r9626 110 110 /* if url ends with a '/', add the torrent name */ 111 111 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 ); 113 113 114 114 ret = tr_strndup( EVBUFFER_DATA( out ), EVBUFFER_LENGTH( out ) );
Note: See TracChangeset
for help on using the changeset viewer.