CVS log for epic4/source/parse.c |
![]() |
Request diff between arbitrary revisions
* Move "term.h" out of the way so we can #include <term.h> (mv'd to termx.h) * This makes it possible to avoid empty decls for tparm() * Which is supposed to fix the build for larne on who-only-knows-what. * Rename tparm() to my_tparm(). * Do a make depend since i changed the name of a header file. ugh. * Change the name of (struct term) to (struct my_term) for freebsd sake. ugh.
* Fix /window query, it was a victim of larneproofing. Ooops! (Bugref 6) * Hook in $windowctl(), just for fun for now. * Enclose a few more dcc outputs in the target nick context.
* current_window_priority should be global variable * Valgrind is my hero -- fix buffer underruns with mangle_line(). * Make the "current input window" its server's current window on user input.
* Numerous updates/changes/fixes to DCC, functions, scripts, /EXEC, the new math parser, as per UPDATES and KNOWNBUGS. One potential incompatibility is in the change to $open(). (as per UPDATES)
RFC1459 says that protocol commansd have 15 arguments *in addition to* the command. Fix an off by one error.
Fix /set mangle_inbound
Fix it so you can compile on systems without (intptr_t) again.
* Revert all uses of LOG_CURRENT to LOG_CRAP * Change all uses of message_to(0) to message_to(-1) * Fix show_help() to not change to_window, it doesn't need to care about that. * Fix help_put_it() to not change message_from, doesn't need to care about it. * Fix /lastlog to use message_to(0) to send all output to current window. * Don't make output of /log go to current window -- no point to that. * Teach add_to_screen() to honor from_server's current window for LOG_CURRENT * And for /set current_window_level as well * Fix message_from() not to save/restore lastlog level, doesn't need to care. * All of this pretty much nukes LOG_CURRENT except for /window, HUZZAH!
* Fixed the ENCRYPTED_PRIVMSG/NOTICE hooks to append the decrypted data as before. * Turned the umodes setting on again (set by the server in the 004(?) numeric and accessible in the client via $serverctl([gs]et umodes). I need to talk to people who have difficulties with this.
* Fix buffer overrun crash with CTCP UTC.
Make some compile warnings go away by using (intptr_t). I hope this doesn't bite me -- every system I checked has (intptr_t)..
Cut over m_sprintf() to malloc_sprintf().
* Misc bugfixes as per KNOWNBUGS. * This patch involves renaming crypt.h to sedcrypt.h.
* Rename 'dcc()' to 'dcc_cmd()' so we can use dcc as variable
* Garbage collect unused 'irc_path' global variable.
* Add --with-warns to configure to do FreeBSD "WARNS" like compiler checks
* Many hundreds of changes to improve the "quality of code" in epic, including:
* - Treat all literal strings as (const char *) and fix const correctness.
* - Mopping up all remaining const-correctness issues
* - Do not "launder" a (const char *) to a (char *) in string searches, (ala
strchr) but rather return a ssize_t offset value.
* - Particular, MatchingBracket() returns (ssize_t) and not (char *).
* - Eliminate all "shadow" variable names by changing them to something else.
* - Eliminate most function decls that do not include a prototype list.
* - Add prototypes for all extern functions that are missing them.
* - Ensure most function pointers include a prototype list.
* - In term.c, most of those (char *)'s are really (const char *)'s.
* - Explicitly specify 'static' functions as 'static'
* - Ensure every function is either 'static' or has a prototype.
* - Eliminate (unsigned) < (signed) type comparisons.
* Hopefully you should not notice any changes!
Nominally remove all uses of "unsafe" functions: (Commit 506)
* Convert all uses of strcpy() to strlcpy()
* Convert all uses of strcat() to strlcat()
* Convert all uses of strmcpy() to strlcpy()
* Convert all uses of strmcat() to strlcat()
* Convert all uses of sprintf() to snprintf()
* As much as possible, use 'sizeof var' in snprintf/strlcpy/strlcat.
* Qualify the size of some global vars so we can sizeof() them.
* Nuke strmcpy(), strmcat(), strmcat_ue(), strmccat(),
* Change strmopencat() to strlopencat().
* Change strmpcat() to strlpcat().
* Fix switch_hostname so it doesn't return a (const) string.
* Fix TimerTimeout so it doesn't return a (const) Timeval.
* Change things like (ret) to do ret while (0); for when "ret" is "{}".
* Fix initialization for load_level
* Stop passing in static strings into io(), so we can modify them.
* Make messages passed to io() more informative to the user.
* Fix CTCP FINGER handler not to assume (struct pw) strings can be overwritten.
* Use (socklen_t) and not an (int) for socket sizes.
* Don't return a value in a void function...
* Don't use return value of process_dcc_chat_ctcps() for assignment.
* Don't put semicolons after function bodies
* Fix $getopt() to save 'input_size' so we can use it with strl*().
* Convert all uses of stpcpy() to strlcat() and strlopencat().
* Nix checks for stpcpy() in configure -- regen configure.
* New /set, /SET SWITCH_CHANNELS_BETWEEN_WINDOWS * C language issues (const correctness, integer size correctness) * Revamp channel structure to hold window refnum and not window pointer * Add "current channel counter" to channel structure. * Determine "current channel" by election. * Garbage collect a lot of now unnecessary code. * Add get_echannel_by_refnum(), returns window's "elected" current channel * Add internal function is_waiting_for_channel() * Add internal function move_waiting_channel() * Add internal function get_winref_by_bound_channel() * Add internal function get_bound_channel_by_refnum() * Convert uses of get_channel_by_refnum() to get_echannel_by_refnum() * Fix $winbound() to work when given a window refnum * Fix valgrind issue with $regcomp() * Remove sanity checks from traverse_all_channels(); handled elsewhere now * Change traverse_all_channels() with "this server" or "not this server" arg * Nuke (Window *)->current_channel. Handled by channels now. HUZZAH! * Implement /ON SWITCH_WINDOWS again.
Another merge.
* Move add_user_who, add_user_end from parse.c to numbers.c * Add (set|get)_server_max_cached_chan_size(), max chan size for u@h caching. * Add $serverctl(SET|GET <refnum> MAXCACHESIZE), largest channel we do WHO for. * Move 'whobase' call from /on join to /on 324. * Don't call 'whobase' (userhost caching) if too many users on channel.
Yikes. Merged to become consistent with HEAD. Sorry for all the commits, I'll be quiet again soon. :) -wd
Commit 459 * Add back support for $mychannels(#winref) * Fix null deref with /LOG KILL * Ignore KICKS based on the victim as well as the kicker.
Commit 443 * Uniformly use 32 bit file sizes in dcc. That's the way it has to be. * Split process_incoming_chat into modular functions. It's an experiment. * Remove the old, #if 0'd dcc_getfile_resume. * Remove the second, redundant warning from /window refnum(_or_swap). * Make the ArgList portion of server messages const. All const! Huzzah! * Roll /names, /list, and /mode numeric handlers into numbers.c * Roll "funny" global variables into server-specific variables * Nuke funny.c and funny.h -- huzzah! * /on window_kill provides two args now, $0 is refnum, $1 is name/refnum. * Rename "numeric_banner" to "banner" * Rename "parse_notice" to "p_notice" * In /xecho, rename 'banner' local var to 'want_banner'. * Revamp p_notice to look like and act like p_privmsg as much as possible. * Finish the rest of the larnifications. Done with phase 1. Huzzah!
* Added Tyraks /stack patch as per KNOWNBUGS. * $afterw(), $beforew(), $fromw(), $tow() as per UPDATES. *potential bug* * Regress tests as per KNOWNBUGS. * ERROR hook fix as per KNOWNBUGS. * autoget script as per KNOWNBUGS. * $serverctl() as per UPDATES. * $writeb() as per UPDATES. * /sleep as per UPDATES.
Commit 437 * Fix targets not being assigned correctly for privmsgs to user. * Send output of who replies to LOG_CRAP as per previous behavior.
Commit 436 This commit is deceptive because it is huge in scope but can be explained pretty simply. * Const correctness improvements. * Invert the meaning of 'new_check_flooding' to return TRUE if flooding. * Revamp funny.c, /list, /names, /mode reply handling. * Remove unused joined_nick, public_nick * Change got_initial_version_28() arguments singly and not an array * Change signature of protocol handling to take "command" as an argument * The above change cascades to a lot of other changes. * Allow the /msg'ing of @W<refnum> to msg a window's refnum. * First round of larnification (Protection against unexpected server data) * This involved substantial rewrites of parse.c, and numbers.c * Now "fake" stuff goes through /on odd_server_stuff. * Fix /on invite so it takes 3 arguments, not 2.
* Use server_list_size() and not number_of_servers outside of server.c * Use NOSERV and not -1 for "no server" * Use (Timeval) and not (struct timeval) * Fix (get|set)_server_sent_*() et al to take server refnum. * Use parse_server_index() and not my_atol() to parse server refnums * re-indent quotecmd * Rename is_server_connected() to is_server_registered * Make /quote work as long as server is open (not registered) * Use send_to_aserver() when it can avoid setting from_server unecessarily * Change sent_to_server and clear_sent_to_server to (set|get)server_sent(). * Change doing_* to get_server_doing_*. * Use (unsigned short) and not (u_short) * Use (unsigned long) and not (u_long) * Make output_reject_ctcp() take a refnum * Lock a dcc while we are connecting it, just in case. ;-) * Fix /dcc send -p <port> * Store protocol enforcements as (get|set)_server_protocol_state(). * Use (Stat) and not (struct stat) * Rewrite $timerctl() so it works like $logctl() * Rename is_server_connected() to is_server_registered() * Fix an off-by-one error with /FOR ... IN ... * Keep track of both readable and writable fd's with newio stuff. * Convert server_list to an array of pointers * When user /server -delete's, leave a gap, don't change refnums around. * Nix code that handles deleting server refnums. * New function, new_open_for_writing(), for when we do nonblocking connects. * Change new_open() to deregister fd as "writable" * Renovate the notify stuff to take refnums and not just use from_server. * Renovate /WHO, /ISON, /USERHOST to take refnums and not just use from_server. * Make everything that uses server_list[] use get_server() instead. * Make everything capable of dealing with "gaps" in server_list[]. * Use a bunch of macros, to handle with getting and setting server attrs. * Make as much as possible use refnums as params and not from_server. * And a lot of other stuff...
* Added functions $asciiq() $chrq() $exec() $timerctl() $tcl() $winline() and $floodinfo(). * Altered the two argument version of $read() to ctcp quote the strings it returns. * Added sets FLOOD_RATE_PER and FLOOD_MASKUSER. * Altered the "accept" mode of the dcc_raw and dcc_connect hooks to refer to the local port instead of the remote port. * Added a "-closein %proc" switch to /exec. * Altered the arg list mode of /alias to use extractw instead of next_arg. * Added the documented "words" argument to the above. * Tuned autoget, mudirc, tabkey.ce and commandqueues. * Altered /pretend to not chop the string. * Set about rewriting the flood detection and then decided that it's better off being a script. * Moved the function macros to their own file (functions.h) and replaced all the copies that are strewn throughout the source with an #include. The exception is array.c which broke when I tried it. * Moved the ctcp enquoting/dequoting functions to ircaux.c. * Added some command/function ordering checks to funcs/regress, and a check for all the functions that are undocumented. * Rewrote function chanmodetype() so that it doesn't have all those flakey buffering things. Hopefully it's readable now. The significant change is that if a mode character appears twice in CHANMODES, the first one is returned instead of the last. * Added EPIC::call() in the perl routines and an equivalent under tcl. this is designed to call a $function() directly, but it isn't really that fast, so I might rip them out again. * The /wait internals used to store a few other settings, which were taken out, so I put them back. * Fixed a few problems with normalize_filename() around the place. * Fixed a bug with /timer in which it would never show the timers after a callback.
* Change do_input_timeouts() to a timer callback. * Nuke the now unused global /wait stuff * Revamp timer.c so you can add/change/delete/update timers during a timer * Change add_timer() so it takes a winref not a window pointer. * Make the "key timeout" thing happen on demand instead of a recurring timer * Remove the recurring "key timeout" timer. * Remove the 'key timeout' thing from io(), also 'first time' stuff. * Call get_time() after select() in io(). * Fix two compile bugs found by larne. * Fix bug when you did /flush on a /clear window.
Added a fix for $: and $; (last joined and last public message).
Note: I didn't take out the code for the old method of generating these
variables.
Another round of epic5 changes... * Make $B, $., $,, $:, $;, $I, /WAIT stuff server specific, from epic5 * Make tracking of doing_(privmsg|notice|ctcp) server specific, from epic5 * Fixes for Const Correctness.
Cleaned up a few -Wall warnings.
* /exec leak fix for -line, -part, etc.
* /for var from x to y step z will work for negative z now, but for bug
compatibility, you must use a negative step to actually make this work.
* Local variable tweaks.
* Fixed $word() to not discard words after a "".
* /userip now uses the internal queue, if the server supports it via the
USERIP 005. Otherwise, it will send the command directly to the server.
The problem with this is that to avoid the internal cache returning the
users address, you must use -direct. This needs to be fixed.
* Karll Array overhaul. Removed certain performance traps for very large
arrays, which have very large numbers of like items, and made it such
that arrays can be in an unsorted internaly until the time that they
need to be sorted, when a quicksort is called on them.
* Added two new functions to deal with this: $usetitem() and
$delitems(). These work like their similarly named counterparts, but
leave the array unsorted, and generally perform better.
* Any function which uses indexes or performs a binary search on an
array will cause the array to be sorted.
* For the most part, extended functions to allow for additional
item/index args. $getitem(array $getmatches(array *cat*)) will
return the contents of all items that have the character sequence
"cat" in them. $getitem(array2 $getmatches(array1 *cat*)) will
act much like $copattern().
Fix $ischannel() (actually, is_channel()) to return 0 if a NULL or empty_string is passed. Also fixed a typo inre serverctl comments. -wd
* Added support for CHANMODES, PREFIX and CHANTYPES in the processing of modes. If the server doesn't support these, then hopefuly sane default strings are chosen, and these _don't_ include the wacky extensions that have been added over the years, so conceivably, this could break things like halfops and ban/invite exemptions. * Stored the UMODES field from the 004 numeric in the server data. Can be retrieved with $serverctl(get x umodes). * Altered "/msg @$fd" so that $fd must be a number, otherwise, it will be treated as a privmsg. * Added $xdebug() which returns all single bit flags with + or - added as appropriate. /xdebug $xdebug() is a no-op. * Fixed an /xdebug bug in which - would cause all subsequent flags to be switched off. For bug compatibility, it still works this way, but you can specify + to turn all subsequent values on. * Altered m_sc3cat_s() to call m_sc3cat rather than m_c3cat, which results in a cleaner string. Examination of the uses of this function showed that they all dealt with this bug in some way. * Altered $which() to call path_search() directly, rather than uzfopen(). It may be useful to add a flag to path_search indicating which attributes we are searching for. This could cause problems since the old method would skip over a file if it wasn't readable. * Added clue variables for $unsplit().
Update copyright notices and copyright dates.
* Applied a patch from NSX which fixes a problem with the last commit that prevents the inital server connection working. Other things also commited: * Fix for ODD_SERVER_STUFF so that it will never have a blank server field. * fixed $chr() to not have input size limits, however it still cores on random data. I'll fix this later. * Fix for get_time() in the case of HAVE_GETTIMEOFDAY being undefined. I forget who this was from. * Minor method addition to tabkey.ce.
Due to the way the new attribute parser works, mangle_line needs a destination buffer that is at least eleven times as large as the original string. Change all uses of mangle_line to pass in 11 times as much as necessary. This avoids uneccesary truncation of input lines with excessive attribute changes in them.
No functional changes, just removal of unecessary whitespace at the end of lines. From adm.
Add some larneproofing.
* Fixed two compiler warnings that apparently occur under macos X. * Altered "/ignore #channel crap" to work for quit messages. The rationale behind this is that "/ignore #channel nick" works, and the code for both are very similar. This may conceivably alter the exact behaviour of channel_signoff, but I have made efforts to keep it working as is.
* Enhanced flood checking to keep records based on userhost rather than nick. Not designed to catch clones but to make it harder to avoid. * Flood checking keeps its time in microseconds now, which _may_ make it a little hyperactive on occasions. * Small re-arrangement to find_array_item() to make it slightly faster. * Terminology fix in /alias /s. * Added $regmatches() which works exactly like $regexec, but returns pairs of numbers which can be applied to $mid() to extract the matched strings and substrings from the original string. It also takes a new second argument indicating the maximum number of subexpressions to return. * New -file option to /lastlog. If given, all output will be written to the file rather than the screen. file_put_it() may be questionable. * $channel() will return "h" in the op field if the user is a half-op.
* Bug fix: *shoot me* $encryptparm() wouldn't check if the program field was empty before sprinting it. * Failed received SED messages make their way through encrypted_privmsg and encrypted_notice now just like the successful ones, only without the "[encrypted message]" message. The reasoning is that first of all, it should be possible to block these messages and secondly it makes it a lot easier to script a secure key exchange. The failure hooks are called with only two arguments (no message). This may be a bad idea. On the one hand it makes it easier for a script to catch, on the other, the hook looses certain critical information.
Reset the "sed" global to 0 at the beginning of every PRIVMSG/NOTICE. This may be slightly inconsistant with design in that it seems to be only reset at the end, however, there are also a few exit points that break with consistancy, and this just seems to make more sense.
Ok. ESR asked us to change our manpage. Some of his changes worked, some of them did not. I took the ones that did work. Add /on general_notice and /on general_privmsg. These will be documented in UPDATES -- they are generalized versions of /on (msg*|public*) and /on (notice|server_notice). Break backwards compatability on /on ctcp_reply by changing $* $0 Sender $1 Target [new] $2 CTCP command [Was $1] $3- CTCP Arguments [Was $2-] Everyone i asked wanted this change, so i claim immunity.
Add channel mode +M support, for dalnet. This also includes the actual use of the previous commit, which implements /set auto_rejoin_connect.
Use "safe_new_next_arg" isntead of "next_arg" in any argument that you pass to a printf function, d'uh!
It would be better if publics didn't go to LOG_MSG, mkay?
Commit #34 -- in /on error, include the server name as $0.
Commit #29: * Add /on error, to handle ERROR protocol messages. * Fix /window * toggle, to actually toggle. * Add /defer command, per email on epic list. * New hybrid6 script from is-. * Fix a bug with strlcat() from openbsd via freebsd. * Axe long broken "1 second cursor in window" delay thing. * Repeal the "deferred free" stuff in 0.9.15-10 that wasn't too good. That's it!
Stage 2 -- what am i getting into? This is the second stage of the server connection closed coping mechanism. This will be tested, bugs may ensue!
Add a "reconnect_to" feature to the servers. The idea is that instead of closing the server when we recieve a 465 or 010 numeric, instead we should stash the refnum of the server we want to connect to in the server's data, and then when we recieve the EOF from the server, at that point do the reconnect. This saves users pain and suffering when there is important data after those numerics. Thus, we only ever drop our connection to the server when the user does /server + or /server -.
Commit #11 -- support efnext's 010 numeric (Please use another server) Support dalnet's +O (elite bastard only) channel mode.
Ok. So i'm a doofus. Replace && with ||.
Support Unreal ircd's unreal gratuitous breakage that results in them sending a void mode change to the user upon connect. This violates the protocol twicewise and whoever came up with this deserves to be drawn and quartered and then burned at the stake.
Initial import into CVS
Initial revision
| CVS Admin |
Powered by ViewCVS 0.9.2 |