Changeset 5514
- Timestamp:
- Apr 5, 2008, 4:32:09 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/remote.c
r5289 r5514 237 237 "\n" 238 238 " -a --add <torrent> Add a torrent\n" 239 " -c --encryption required Require encryption for all peers\n" 239 240 " -c --encryption preferred Prefer peers to use encryption\n" 240 " -c --encryption required Require encryption for all peers\n"241 " -c --encryption tolerated Prefer peers to use plaintext\n" 241 242 " -d --download-limit <int> Max download rate in KiB/s\n" 242 243 " -D --download-unlimited No download rate limit\n" … … 321 322 break; 322 323 case 'c': 323 if(!strcasecmp(optarg, "preferred")) 324 if(!strcasecmp(optarg, "required")) 325 opts->crypto = "required"; 326 else if(!strcasecmp(optarg, "preferred")) 324 327 opts->crypto = "preferred"; 325 else if(!strcasecmp(optarg, " required"))326 opts->crypto = " required";328 else if(!strcasecmp(optarg, "tolerated")) 329 opts->crypto = "tolerated"; 327 330 else 328 331 usage("invalid encryption mode: %s", optarg); -
trunk/daemon/server.c
r5506 r5514 634 634 { 635 635 case IPC_MSG_CRYPTO: 636 if(!strcasecmp(val->val.s.s, "plaintext")) 637 torrent_set_encryption(TR_PLAINTEXT_PREFERRED); 638 else if(!strcasecmp(val->val.s.s, "preferred")) 639 torrent_set_encryption(TR_ENCRYPTION_PREFERRED); 640 else if(!strcasecmp(val->val.s.s, "required")) 641 torrent_set_encryption(TR_ENCRYPTION_REQUIRED); 642 else 643 { 636 if( !strcasecmp( val->val.s.s, "required" ) ) 637 torrent_set_encryption( TR_ENCRYPTION_REQUIRED ); 638 else if( !strcasecmp( val->val.s.s, "preferred" ) ) 639 torrent_set_encryption( TR_ENCRYPTION_PREFERRED ); 640 else if( !strcasecmp( val->val.s.s, "tolerated" ) ) 641 torrent_set_encryption( TR_PLAINTEXT_PREFERRED ); 642 else { 644 643 msgresp(client, tag, IPC_MSG_BAD); 645 644 return; 646 645 } 647 646 break; 647 648 648 case IPC_MSG_DIR: 649 649 torrent_set_directory( val->val.s.s ); … … 928 928 break; 929 929 case IPC_MSG_GETCRYPTO: 930 switch(torrent_get_encryption()) 931 { 932 case TR_PLAINTEXT_PREFERRED: 933 strval = "plaintext"; 934 break; 935 case TR_ENCRYPTION_PREFERRED: 936 strval = "preferred"; 937 break; 938 case TR_ENCRYPTION_REQUIRED: 939 strval = "required"; 940 break; 941 default: 942 assert(0); 943 return; 930 switch(torrent_get_encryption()) { 931 case TR_ENCRYPTION_REQUIRED: strval = "required"; break; 932 case TR_ENCRYPTION_PREFERRED: strval = "preferred"; break; 933 case TR_PLAINTEXT_PREFERRED: strval = "tolerated"; break; 934 default: assert(0); return; 944 935 } 945 936 buf = ipc_mkstr(client->ipc, &buflen, IPC_MSG_CRYPTO, tag, strval); -
trunk/doc/ipcproto.txt
r5144 r5514 269 269 Example: 12:get-info-alll4:hash4:namee 270 270 "get-info-all", ("hash", "name") 271 Details: Same as "get info" message with all torrent IDs specified.271 Details: Same as "get-info" message with all torrent IDs specified. 272 272 273 273 Key: "get-pex" … … 375 375 Details: Change the port the server uses to listen for incoming peer 376 376 connections. 377 378 Key: "encryption" 379 Version: 2 380 Format: string 381 Example: 10:encryption9:preferred 382 "encryption", "preferred" 383 Details: Returns thestring is one of: 384 "required", "preferred", "tolerated" 377 385 378 386 Key: "quit"
Note: See TracChangeset
for help on using the changeset viewer.