Changeset 952
- Timestamp:
- 06/17/07 17:45:09 (1 year ago)
- Files:
-
- 1.8.3/branches/devel/CHANGES.182 (modified) (1 diff)
- 1.8.3/branches/devel/game/mushcnf.dst (modified) (1 diff)
- 1.8.3/branches/devel/game/txt/hlp/pennflag.hlp (modified) (2 diffs)
- 1.8.3/branches/devel/hdrs/mushtype.h (modified) (1 diff)
- 1.8.3/branches/devel/hdrs/switches.h (modified) (1 diff)
- 1.8.3/branches/devel/src/bsd.c (modified) (5 diffs)
- 1.8.3/branches/devel/src/csrimalloc.c (modified) (1 diff)
- 1.8.3/branches/devel/src/flags.c (modified) (2 diffs)
- 1.8.3/branches/devel/src/mysocket.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/branches/devel/CHANGES.182
r931 r952 17 17 Version 1.8.2 patchevel 6 ??? ??, 2007 18 18 19 Minor changes: 20 * KEEPALIVE flag makes the server send a telnet NOP after 21 a short period of inactivity; helps prevent timeouts from 22 NAT/router devices with a short timeout. [MUX] 23 19 24 Fixes: 20 25 * Fixed assorted small memory leaks. [SW] 26 * Fixed handling of telnet NOPs sent by clients. [SW] 21 27 22 28 Version 1.8.2 patchlevel 5 June 13, 2007 1.8.3/branches/devel/game/mushcnf.dst
r790 r952 214 214 # the internet, and don't deal well with persistant connections like 215 215 # mushes use. This option will make the server automatically send a 216 # 'Are you still there?' query every few minutes to keep the216 # TCP-level 'Are you still there?' query every few minutes to keep the 217 217 # connection active. 218 218 # NOTE: This doesn't work on all OSes, but does on the most popular 219 # ones for mush hosting such as linux. 219 # ones for mush hosting such as linux. Other options include the KEEPALIVE 220 # flag and the IDLE command. 220 221 keepalive_timeout 5m 221 222 1.8.3/branches/devel/game/txt/hlp/pennflag.hlp
r802 r952 51 51 d - Destroy_Ok e - Enter_Ok g - Gagged 52 52 h - Halt i - Orphan j - Jury_Ok 53 l - Light m - Myopic, Mistrust n - No_Command54 o - On-Vacation p - Puppet, Paranoid r - Royalty55 s - Suspect t - Transparent u - Uninspected56 v - Verbose w - No_Warn x - Terse, Cloudy57 ? - Unregistered ^ - Listen_Parent ~ - Noaccents58 " - NoSpoof53 k - Keepalive l - Light m - Myopic, Mistrust 54 n - No_Command o - On-Vacation p - Puppet, Paranoid 55 r - Royalty s - Suspect t - Transparent 56 u - Uninspected v - Verbose w - No_Warn 57 x - Terse, Cloudy ? - Unregistered ^ - Listen_Parent 58 ~ - Noaccents " - NoSpoof 59 59 ----------------------------------------------------------------------- 60 60 Some flags may not be enabled on some MUSHes. @flag/list will show … … 402 402 When a room is set JUMP_OK, then that room can be teleported into 403 403 by anyone. See @teleport. 404 & KEEPALIVE 405 Flag: KEEPALIVE (players) 406 407 When this flag is set on a player with a telnet-capable connection, 408 a telnet NOP (no-operation) is sent after there's been no activity 409 on the connection for a minute, to generate socket activity without 410 generating any output. In a way, it's the opposite of the IDLE 411 command. IDLE is sent by clients to keep a connection open, while 412 KEEPALIVE tells the server to send a message. Both are intended for 413 use by people going through home router/NAT appliances with short 414 inactivity timeouts. 415 416 See also: IDLE, terminfo() 404 417 & LIGHT 405 418 Flag: LIGHT (all types) 1.8.3/branches/devel/hdrs/mushtype.h
r905 r952 129 129 unsigned char *raw_input; /**< Pointer to start of next raw input */ 130 130 unsigned char *raw_input_at; /**< Pointer to position in raw input */ 131 longconnected_at; /**< Time of connection */132 longlast_time; /**< Time of last activity */131 time_t connected_at; /**< Time of connection */ 132 time_t last_time; /**< Time of last activity */ 133 133 int quota; /**< Quota of commands allowed */ 134 134 int cmds; /**< Number of commands sent */ 1.8.3/branches/devel/hdrs/switches.h
r950 r952 154 154 #define SWITCH_YES 151 155 155 #define SWITCH_ZONE 152 156 #endif /* SWITCHES_H */156 #endif /* SWITCHES_H */ 1.8.3/branches/devel/src/bsd.c
r945 r952 1789 1789 } 1790 1790 break; 1791 case NOP: /* No-op */ 1791 case NOP: 1792 /* No-op */ 1792 1793 if (*q >= qend) 1793 1794 return -1; … … 1795 1796 fprintf(stderr, "Got IAC NOP\n"); 1796 1797 #endif 1798 *q++; 1797 1799 break; 1798 1800 case AYT: /* Are you there? */ … … 2627 2629 if (d->player == player) { 2628 2630 numd++; 2629 if ( now - d->last_time > 60)2631 if (difftime(now, d->last_time) > 60.0) 2630 2632 in = d; 2631 2633 } … … 4086 4088 { 4087 4089 DESC *d, *nextd; 4088 time_t now , idle, idle_for, unconnected_idle;4089 i f (!INACTIVITY_LIMIT && !UNCONNECTED_LIMIT)4090 return; 4090 time_t now; 4091 int idle, idle_for, unconnected_idle; 4092 4091 4093 now = mudtime; 4092 4094 idle = INACTIVITY_LIMIT ? INACTIVITY_LIMIT : INT_MAX; … … 4094 4096 for (d = descriptor_list; d; d = nextd) { 4095 4097 nextd = d->next; 4096 idle_for = now - d->last_time; 4098 idle_for = (int) difftime(now, d->last_time); 4099 4097 4100 /* If they've been connected for 60 seconds without getting a telnet-option 4098 4101 back, the client probably doesn't understand them */ 4099 if ((d->conn_flags & CONN_TELNET_QUERY) && idle_for > 60) 4102 if (d->conn_flags & CONN_TELNET_QUERY 4103 && difftime(now, d->connected_at) >= 60.0) 4100 4104 d->conn_flags &= ~CONN_TELNET_QUERY; 4105 4106 /* If they've been idle for 60 seconds and are set KEEPALIVE and using 4107 a telnet-aware client, send a NOP */ 4108 if (d->conn_flags & CONN_TELNET && idle_for >= 60 4109 && IS(d->player, TYPE_PLAYER, "KEEPALIVE")) { 4110 const uint8_t nopmsg[2] = { IAC, NOP }; 4111 queue_newwrite(d, nopmsg, 2); 4112 process_output(d); 4113 } 4114 4101 4115 if ((d->connected) ? (idle_for > idle) : (idle_for > unconnected_idle)) { 4102 4116 1.8.3/branches/devel/src/csrimalloc.c
r945 r952 970 970 #ifdef CSRI_TRACE 971 971 /* Tracing malloc definitions - helps find leaks */ 972 univptr_t trace__malloc 973 _((size_t nbytes, const char *fname, int linenum)); 974 univptr_t trace__calloc 975 _((size_t nelem, size_t elsize, const char *fname, int linenum)); 976 univptr_t trace__realloc 977 _((univptr_t cp, size_t nbytes, const char *fname, int linenum)); 978 univptr_t trace__valloc _((size_t size, const char *fname, int linenum)); 979 univptr_t trace__memalign 980 _((size_t alignment, size_t size, const char *fname, int linenum)); 981 univptr_t trace__emalloc _((size_t nbytes, const char *fname, int linenum)); 972 univptr_t 973 trace__malloc 974 _((size_t nbytes, const char *fname, int linenum)); 975 univptr_t 976 trace__calloc 977 _((size_t nelem, size_t elsize, const char *fname, int linenum)); 978 univptr_t 979 trace__realloc 980 _((univptr_t cp, size_t nbytes, const char *fname, int linenum)); 981 univptr_t trace__valloc 982 _((size_t size, const char *fname, int linenum)); 983 univptr_t 984 trace__memalign 985 _((size_t alignment, size_t size, const char *fname, int linenum)); 986 univptr_t trace__emalloc 987 _((size_t nbytes, const char *fname, int linenum)); 982 988 univptr_t 983 989 trace__ecalloc _((size_t nelem, size_t sz, const char *fname, int linenum)); 990 univptr_t trace__erealloc 991 _((univptr_t ptr, size_t nbytes, const char *fname, int linenum)); 992 char *trace__strdup _((const char *s, const char *fname, int linenum)); 993 char *trace__strsave _((const char *s, const char *fname, int linenum)); 994 void 995 trace__free _((univptr_t cp, const char *fname, int linenum)); 996 void 997 trace__cfree _((univptr_t cp, const char *fname, int linenum)); 998 #else /* CSRI_TRACE */ 984 999 univptr_t 985 trace__erealloc 986 _((univptr_t ptr, size_t nbytes, const char *fname, int linenum)); 987 char * 988 trace__strdup 989 _((const char *s, const char *fname, int linenum)); 990 char * 991 trace__strsave 992 _((const char *s, const char *fname, int linenum)); 1000 malloc 1001 _((size_t nbytes)); 1002 univptr_t 1003 calloc 1004 _((size_t nelem, size_t elsize)); 1005 univptr_t 1006 realloc 1007 _((univptr_t cp, size_t nbytes)); 1008 univptr_t 1009 valloc 1010 _((size_t size)); 1011 univptr_t 1012 memalign 1013 _((size_t alignment, size_t size)); 1014 univptr_t 1015 emalloc 1016 _((size_t nbytes)); 1017 univptr_t 1018 ecalloc 1019 _((size_t nelem, size_t sz)); 1020 univptr_t 1021 erealloc 1022 _((univptr_t ptr, size_t nbytes)); 1023 Free_t free 1024 _((univptr_t cp)); 1025 Free_t cfree 1026 _((univptr_t cp)); 1027 #endif /* CSRI_TRACE */ 1028 1029 int 1030 __m_botch 1031 _((const char *s1, const char *s2, univptr_t p, 1032 int is_end_ptr, const char *filename, int linenumber)); 993 1033 void 994 trace__free995 _(( univptr_t cp, const char *fname, int linenum));1034 __m_prnode 1035 _((SPBLK * spblk)); 996 1036 void 997 trace__cfree 998 _((univptr_t cp, const char *fname, int linenum)); 999 #else /* CSRI_TRACE */ 1000 univptr_t malloc 1001 _((size_t nbytes)); 1002 univptr_t calloc 1003 _((size_t nelem, size_t elsize)); 1004 univptr_t realloc 1005 _((univptr_t cp, size_t nbytes)); 1006 univptr_t valloc 1007 _((size_t size)); 1008 univptr_t memalign 1009 _((size_t alignment, size_t size)); 1010 univptr_t emalloc 1011 _((size_t nbytes)); 1012 univptr_t ecalloc 1013 _((size_t nelem, size_t sz)); 1014 univptr_t erealloc 1015 _((univptr_t ptr, size_t nbytes)); 1016 Free_t free _((univptr_t cp)); 1017 Free_t cfree _((univptr_t cp)); 1018 #endif /* CSRI_TRACE */ 1019 1020 int 1021 __m_botch 1022 _((const char *s1, const char *s2, univptr_t p, 1023 int is_end_ptr, const char *filename, int linenumber)); 1024 void 1025 __m_prnode _((SPBLK * spblk)); 1026 void 1027 mal_contents _((FILE * fp)); 1037 mal_contents 1038 _((FILE * fp)); 1028 1039 #ifdef CSRI_DEBUG 1029 1040 void 1030 mal_debug _((int level)); 1041 mal_debug 1042 _((int level)); 1031 1043 int 1032 mal_verify _((int fullcheck)); 1044 mal_verify 1045 _((int fullcheck)); 1033 1046 #endif 1034 1047 void 1035 mal_dumpleaktrace _((FILE * fp)); 1048 mal_dumpleaktrace 1049 _((FILE * fp)); 1036 1050 void 1037 mal_heapdump _((FILE * fp)); 1051 mal_heapdump 1052 _((FILE * fp)); 1038 1053 void 1039 mal_leaktrace _((int value)); 1054 mal_leaktrace 1055 _((int value)); 1040 1056 void 1041 mal_sbrkset _((int n)); 1057 mal_sbrkset 1058 _((int n)); 1042 1059 void 1043 mal_slopset _((int n)); 1060 mal_slopset 1061 _((int n)); 1044 1062 #ifdef CSRI_PROFILESIZES 1045 1063 void 1046 mal_statsdump _((FILE * fp)); 1064 mal_statsdump 1065 _((FILE * fp)); 1047 1066 #endif 1048 1067 void 1049 mal_trace _((int value)); 1068 mal_trace 1069 _((int value)); 1050 1070 void 1051 mal_mmap _((char *fname)); 1071 mal_mmap 1072 _((char *fname)); 1052 1073 1053 1074 #ifdef CSRI_TRACE 1.8.3/branches/devel/src/flags.c
r950 r952 145 145 {"GOING_TWICE", '\0', NOTYPE, GOING_TWICE, F_INTERNAL | F_DARK, 146 146 F_INTERNAL | F_DARK}, 147 {"KEEPALIVE", 'k', TYPE_PLAYER, 0, F_ANY, F_ANY}, 147 148 {NULL, '\0', 0, 0, 0, 0} 148 149 }; … … 861 862 862 863 if (n->tab == &ptab_flag) { 864 add_flag("KEEPALIVE", 'k', TYPE_PLAYER, F_ANY, F_ANY); 863 865 add_flag("MISTRUST", 'm', TYPE_THING | TYPE_EXIT | TYPE_ROOM, F_INHERIT, 864 866 F_INHERIT); 1.8.3/branches/devel/src/mysocket.c
r905 r952 375 375 376 376 /* And set the ping time to something reasonable instead of the 377 default 2 hours. Linux , NetBSD and others use TCP_KEEPIDLE to do377 default 2 hours. Linux and possibly others use TCP_KEEPIDLE to do 378 378 this. OS X and possibly others use TCP_KEEPALIVE. */ 379 379 #if defined(TCP_KEEPIDLE)
