Changeset 4179
- Timestamp:
- Dec 15, 2007, 10:22:30 PM (15 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/fdlimit.c
r4177 r4179 89 89 TR_MAX_SOCKETS = 512, 90 90 91 TR_MAX_OPEN_FILES = 8, /* real files, not sockets */91 TR_MAX_OPEN_FILES = 16, /* real files, not sockets */ 92 92 93 93 TR_RESERVED_FDS = 16 /* sockets reserved for tracker connections */ -
trunk/libtransmission/platform.c
r4108 r4179 55 55 #include "net.h" 56 56 #include "platform.h" 57 #include "trcompat.h" 57 58 #include "utils.h" 58 59 … … 288 289 #endif 289 290 290 const char *291 static const char * 291 292 tr_getHomeDirectory( void ) 292 293 { … … 349 350 static char buf[MAX_PATH_LENGTH]; 350 351 static int init = 0; 351 static size_t buflen = sizeof(buf); 352 const char* h; 352 const char * trhome; 353 353 354 354 if( init ) 355 355 return buf; 356 356 357 h = tr_getHomeDirectory(); 358 #ifdef __BEOS__ 359 find_directory( B_USER_SETTINGS_DIRECTORY, 360 dev_for_path("/boot"), true, buf, buflen ); 361 strcat( buf, "/Transmission" ); 357 trhome = getenv( "TRANSMISSION_HOME" ); 358 if( trhome != NULL ) 359 { 360 strlcpy( buf, trhome, sizeof( buf ) ); 361 } 362 else 363 { 364 #ifdef __BEOS__ 365 find_directory( B_USER_SETTINGS_DIRECTORY, 366 dev_for_path("/boot"), true, 367 buf, sizeof( buf ) ); 368 strcat( buf, "/Transmission" ); 362 369 #elif defined( SYS_DARWIN ) 363 tr_buildPath ( buf, buflen, h, 364 "Library", "Application Support", "Transmission", NULL ); 370 const char * h = tr_getHomeDirectory( ); 371 tr_buildPath ( buf, sizeof( buf ), 372 tr_getHomeDirectory( ), 373 "Library", 374 "Application Support", 375 "Transmission", 376 NULL ); 365 377 #elif defined(__AMIGAOS4__) 366 snprintf( buf, buflen, "PROGDIR:.transmission" ); 367 #elif defined(WIN32) 368 { 369 char tmp[MAX_PATH_LENGTH]; 370 SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, tmp ); 371 tr_buildPath( buf, sizeof(buf), tmp, "Transmission", NULL ); 372 buflen = strlen( buf ); 378 strlcpy( buf, "PROGDIR:.transmission", sizeof( buf ) ); 379 #elif defined(WIN32) 380 char appdata[MAX_PATH_LENGTH]; 381 SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata ); 382 tr_buildPath( buf, sizeof(buf), 383 appdata, 384 "Transmission", 385 NULL ); 386 #else 387 tr_buildPath ( buf, sizeof(buf), tr_getHomeDirectory( ), ".transmission", NULL ); 388 #endif 373 389 } 374 #else375 tr_buildPath ( buf, buflen, h, ".transmission", NULL );376 #endif377 390 378 391 tr_mkdirp( buf, 0777 ); -
trunk/libtransmission/platform.h
r4092 r4179 28 28 typedef struct tr_thread tr_thread; 29 29 30 const char * tr_getHomeDirectory( void );31 30 const char * tr_getCacheDirectory( void ); 32 31 const char * tr_getTorrentsDirectory( void );
Note: See TracChangeset
for help on using the changeset viewer.