Changeset 3578 for trunk/daemon/server.c
- Timestamp:
- Oct 26, 2007, 3:43:27 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/server.c
r3577 r3578 105 105 0 > ipc_addmsg( gl_tree, IPC_MSG_AUTOMAP, intmsg ) || 106 106 0 > ipc_addmsg( gl_tree, IPC_MSG_AUTOSTART, intmsg ) || 107 0 > ipc_addmsg( gl_tree, IPC_MSG_CRYPTO, strmsg ) || 107 108 0 > ipc_addmsg( gl_tree, IPC_MSG_DOWNLIMIT, intmsg ) || 108 109 0 > ipc_addmsg( gl_tree, IPC_MSG_DIR, strmsg ) || 109 110 0 > ipc_addmsg( gl_tree, IPC_MSG_GETAUTOMAP, prefmsg ) || 110 111 0 > ipc_addmsg( gl_tree, IPC_MSG_GETAUTOSTART, prefmsg ) || 112 0 > ipc_addmsg( gl_tree, IPC_MSG_GETCRYPTO, prefmsg ) || 111 113 0 > ipc_addmsg( gl_tree, IPC_MSG_GETDOWNLIMIT, prefmsg ) || 112 114 0 > ipc_addmsg( gl_tree, IPC_MSG_GETDIR, prefmsg ) || … … 636 638 switch( id ) 637 639 { 640 case IPC_MSG_CRYPTO: 641 if(!strcasecmp(val->val.s.s, "preferred")) 642 torrent_set_encryption(TR_ENCRYPTION_PREFERRED); 643 else if(!strcasecmp(val->val.s.s, "required")) 644 torrent_set_encryption(TR_ENCRYPTION_REQUIRED); 645 else 646 { 647 msgresp(client, tag, IPC_MSG_BAD); 648 return; 649 } 650 break; 638 651 case IPC_MSG_DIR: 639 652 torrent_set_directory( val->val.s.s ); … … 903 916 uint8_t * buf; 904 917 size_t buflen; 918 const char * strval; 905 919 906 920 switch( id ) … … 913 927 buf = ipc_mkint( client->ipc, &buflen, IPC_MSG_AUTOSTART, tag, 914 928 torrent_get_autostart() ); 929 break; 930 case IPC_MSG_GETCRYPTO: 931 switch(torrent_get_encryption()) 932 { 933 case TR_ENCRYPTION_PREFERRED: 934 strval = "preferred"; 935 break; 936 case TR_ENCRYPTION_REQUIRED: 937 strval = "required"; 938 break; 939 default: 940 assert(0); 941 return; 942 } 943 buf = ipc_mkstr(client->ipc, &buflen, IPC_MSG_CRYPTO, tag, strval); 915 944 break; 916 945 case IPC_MSG_GETDIR:
Note: See TracChangeset
for help on using the changeset viewer.