Changeset 4305
- Timestamp:
- Dec 24, 2007, 3:48:42 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/server.c
r3578 r4305 639 639 { 640 640 case IPC_MSG_CRYPTO: 641 if(!strcasecmp(val->val.s.s, "preferred")) 641 if(!strcasecmp(val->val.s.s, "plaintext")) 642 torrent_set_encryption(TR_PLAINTEXT_PREFERRED); 643 else if(!strcasecmp(val->val.s.s, "preferred")) 642 644 torrent_set_encryption(TR_ENCRYPTION_PREFERRED); 643 645 else if(!strcasecmp(val->val.s.s, "required")) … … 931 933 switch(torrent_get_encryption()) 932 934 { 935 case TR_PLAINTEXT_PREFERRED: 936 strval = "plaintext"; 937 break; 933 938 case TR_ENCRYPTION_PREFERRED: 934 939 strval = "preferred"; -
trunk/doc/ipcproto.txt
r3926 r4305 199 199 "encryption", "required" 200 200 Details: Set the encryption mode for peer connections. Valid values 201 are "required" and "preferred".201 are "required", "preferred" and "plaintext". 202 202 203 203 Key: "failed" -
trunk/macosx/Controller.m
r4296 r4305 208 208 fBadger = [[Badger alloc] initWithLib: fLib]; 209 209 210 fIPCController = [[IPCController alloc] init WithHandle: fPrefsController];210 fIPCController = [[IPCController alloc] init]; 211 211 [fIPCController setDelegate: self]; 212 [fIPCController setPrefsController: fPrefsController]; 212 213 fRemoteQuit = NO; 213 214 … … 2491 2492 NSString * file; 2492 2493 BOOL torrent = NO; 2493 int canAdd;2494 2494 tr_ctor * ctor; 2495 2495 while ((file = [enumerator nextObject])) -
trunk/macosx/IPCController.h
r4288 r4305 59 59 } 60 60 61 - (id) initWithHandle: (PrefsController *) thePrefsController; 61 62 - (id) init; 62 63 - (id) delegate; 63 64 - (void) setDelegate: (id) newdelegate; 65 - (void) setPrefsController: (id) thePrefsController; 64 66 65 67 @end -
trunk/macosx/IPCController.m
r4298 r4305 119 119 @implementation IPCController 120 120 121 - (id) initWithHandle : (PrefsController *) thePrefsController 122 { 123 fPrefsController = thePrefsController; 121 - (id) init 122 { 124 123 struct sockaddr_un sun; 125 124 … … 151 150 0 > ipc_addmsg( _funcs, IPC_MSG_AUTOMAP, msg_setbool ) || 152 151 0 > ipc_addmsg( _funcs, IPC_MSG_AUTOSTART, msg_setbool ) || 152 0 > ipc_addmsg( _funcs, IPC_MSG_CRYPTO, msg_setstr ) || 153 153 0 > ipc_addmsg( _funcs, IPC_MSG_DIR, msg_setstr ) || 154 154 0 > ipc_addmsg( _funcs, IPC_MSG_DOWNLIMIT, msg_setint ) || 155 155 0 > ipc_addmsg( _funcs, IPC_MSG_GETAUTOMAP, msg_getbool ) || 156 156 0 > ipc_addmsg( _funcs, IPC_MSG_GETAUTOSTART, msg_getbool ) || 157 0 > ipc_addmsg( _funcs, IPC_MSG_GETCRYPTO, msg_getstr ) || 157 158 0 > ipc_addmsg( _funcs, IPC_MSG_GETDIR, msg_getstr ) || 158 159 0 > ipc_addmsg( _funcs, IPC_MSG_GETDOWNLIMIT, msg_getint ) || … … 217 218 } 218 219 220 - (void) setPrefsController: (id) thePrefsController 221 { 222 fPrefsController = thePrefsController; 223 } 224 219 225 @end 220 226 … … 787 793 break; 788 794 case IPC_MSG_GETPEX: 789 // we dont support this :(795 //warning we dont support this :( 790 796 [client sendrespEmpty: IPC_MSG_FAIL tag: tag]; 791 797 break; … … 822 828 { 823 829 IPCClient * client = arg; 830 NSString * cryptoValue; 824 831 825 832 fDefaults = [NSUserDefaults standardUserDefaults]; … … 831 838 [client sendrespStr:IPC_MSG_DIR tag:tag val:[fDefaults stringForKey:@"DownloadFolder"]]; 832 839 break; 840 841 case IPC_MSG_GETCRYPTO: 842 if ([fDefaults boolForKey: @"EncryptionPrefer"]) 843 if ([fDefaults boolForKey: @"EncryptionRequire"]) 844 cryptoValue = @"required"; 845 else 846 cryptoValue = @"preferred"; 847 else 848 cryptoValue = @"plaintext"; 849 850 [client sendrespStr:IPC_MSG_CRYPTO tag:tag val:cryptoValue]; 851 break; 852 833 853 default: 834 854 assert( 0 ); … … 861 881 break; 862 882 case IPC_MSG_PEX: 863 //we dont support this :(883 //warning we dont support this :( 864 884 [client sendrespEmpty: IPC_MSG_FAIL tag: tag]; 865 885 break; … … 890 910 break; 891 911 case IPC_MSG_PORT: 892 #warning show in preference window893 912 [fPrefsController setPort:[NSNumber numberWithInt:val->val.i]]; 913 [fPrefsController updatePortField]; 894 914 break; 895 915 case IPC_MSG_UPLIMIT: … … 925 945 [client sendrespEmpty: IPC_MSG_OK tag: tag]; 926 946 break; 947 948 case IPC_MSG_CRYPTO: 949 if(!strcasecmp(val->val.s.s, "required")) 950 { 951 [fDefaults setBool:TRUE forKey: @"EncryptionPrefer"]; 952 [fDefaults setBool:TRUE forKey: @"EncryptionRequire"]; 953 } 954 955 else if(!strcasecmp(val->val.s.s, "preferred")) 956 { 957 [fDefaults setBool:TRUE forKey: @"EncryptionPrefer"]; 958 [fDefaults setBool:FALSE forKey: @"EncryptionRequire"]; 959 } 960 961 else if(!strcasecmp(val->val.s.s, "plaintext")) 962 { 963 [fDefaults setBool:FALSE forKey: @"EncryptionPrefer"]; 964 [fDefaults setBool:FALSE forKey: @"EncryptionRequire"]; 965 } 966 967 [client sendrespEmpty: IPC_MSG_OK tag: tag]; 968 break; 969 927 970 default: 928 971 assert( 0 ); -
trunk/macosx/PrefsController.h
r4280 r4305 62 62 - (void) setUpdater: (SUUpdater *) updater; 63 63 64 - (void) updatePortField; 64 65 - (void) setPort: (id) sender; 65 66 - (void) setNat: (id) sender; -
trunk/macosx/PrefsController.m
r4280 r4305 223 223 } 224 224 225 //used by ipc 226 - (void) updatePortField 227 { 228 [fPortField setIntValue: [fDefaults integerForKey: @"BindPort"]]; 229 } 230 225 231 - (void) setPort: (id) sender 226 232 {
Note: See TracChangeset
for help on using the changeset viewer.