Changeset 10396


Ignore:
Timestamp:
Mar 19, 2010, 6:48:37 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #2911 "requirement of javascript/transmission.js for webinterface unnecessary" -- implemented in trunk for 2.00

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform.c

    r9987 r10396  
    517517
    518518static int
    519 isClutchDir( const char * path )
     519isWebClientDir( const char * path )
    520520{
    521521    struct stat sb;
    522     char * tmp = tr_buildPath( path, "javascript", "transmission.js", NULL );
     522    char * tmp = tr_buildPath( path, "index.html", NULL );
    523523    const int ret = !stat( tmp, &sb );
    524524    tr_inf( _( "Searching for web interface file \"%s\"" ), tmp );
     
    528528
    529529const char *
    530 tr_getClutchDir( const tr_session * session UNUSED )
     530tr_getWebClientDir( const tr_session * session UNUSED )
    531531{
    532532    static char * s = NULL;
     
    557557            s = tr_buildPath( appString, "Contents", "Resources", "web", NULL );
    558558
    559             if( !isClutchDir( s ) ) {
     559            if( !isWebClientDir( s ) ) {
    560560                tr_free( s );
    561561
    562562                /* Fallback to the Application Support folder */
    563563                s = tr_buildPath( tr_sessionGetConfigDir( session ), "web", NULL );
    564                 if( !isClutchDir( s ) ) {
     564                if( !isWebClientDir( s ) ) {
    565565                    tr_free( s );
    566566                    s = NULL;
     
    580580                SHGetFolderPath( NULL, CSIDL_COMMON_APPDATA, NULL, 0, dir );
    581581                s = tr_buildPath( dir, "Transmission", "Web", NULL );
    582                 if( !isClutchDir( s ) ) {
     582                if( !isWebClientDir( s ) ) {
    583583                    tr_free( s );
    584584                    s = NULL;
     
    590590                SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, dir );
    591591                s = tr_buildPath( dir, "Transmission", "Web", NULL );
    592                 if( !isClutchDir( s ) ) {
     592                if( !isWebClientDir( s ) ) {
    593593                    tr_free( s );
    594594                    s = NULL;
     
    600600                GetModuleFileName( GetModuleHandle( NULL ), dir, sizeof( dir ) );
    601601                s = tr_buildPath( dirname( dir ), "Web", NULL );
    602                 if( !isClutchDir( s ) ) {
     602                if( !isWebClientDir( s ) ) {
    603603                    tr_free( s );
    604604                    s = NULL;
     
    644644            for( l=candidates; l; l=l->next ) {
    645645                char * path = tr_buildPath( l->data, "transmission", "web", NULL );
    646                 const int found = isClutchDir( path );
     646                const int found = isWebClientDir( path );
    647647                if( found ) {
    648648                    s = path;
  • trunk/libtransmission/platform.h

    r10276 r10396  
    4242 * @see tr_getResumeDir()
    4343 * @see tr_getTorrentDir()
    44  * @see tr_getClutchDir()
     44 * @see tr_getWebClientDir()
    4545 */
    4646void tr_setConfigDir( tr_session * session, const char * configDir );
     
    5252const char * tr_getTorrentDir( const tr_session * );
    5353
    54 /** @brief return the directory where Clutch's web ui files are kept */
    55 const char * tr_getClutchDir( const tr_session * );
     54/** @brief return the directory where the Web Client's web ui files are kept */
     55const char * tr_getWebClientDir( const tr_session * );
    5656
    5757/** @} */
  • trunk/libtransmission/rpc-server.c

    r9944 r10396  
    287287        const char *    mime_type;
    288288    } types[] = {
    289         /* these are just the ones we need for serving clutch... */
     289        /* these are the ones we need for serving the web client's files... */
    290290        { "css",  "text/css"                  },
    291291        { "gif",  "image/gif"                 },
     
    440440
    441441static void
    442 handle_clutch( struct evhttp_request * req,
    443                struct tr_rpc_server *  server )
    444 {
    445     const char * clutchDir = tr_getClutchDir( server->session );
     442handle_web_client( struct evhttp_request * req,
     443                   struct tr_rpc_server *  server )
     444{
     445    const char * webClientDir = tr_getWebClientDir( server->session );
    446446
    447447    assert( !strncmp( req->uri, "/transmission/web/", 18 ) );
    448448
    449     if( !clutchDir || !*clutchDir )
     449    if( !webClientDir || !*webClientDir )
    450450    {
    451451        send_simple_response( req, HTTP_NOTFOUND,
     
    475475        {
    476476            char * filename = tr_strdup_printf( "%s%s%s",
    477                                  clutchDir,
     477                                 webClientDir,
    478478                                 TR_PATH_DELIMITER_STR,
    479479                                 subpath && *subpath ? subpath : "index.html" );
     
    619619        else if( !strncmp( req->uri, "/transmission/web/", 18 ) )
    620620        {
    621             handle_clutch( req, server );
     621            handle_web_client( req, server );
    622622        }
    623623        else if( !strncmp( req->uri, "/transmission/upload", 20 ) )
Note: See TracChangeset for help on using the changeset viewer.