CVS log for epic4/source/ircaux.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.
* Add /on signal (pegasus) * Fix /set indent if /set continued_line contains ^C stuff (pegasus)
* Add a missing cast for printf when sending a dcc handshake. * Support isfinite() for hpux/c99 alongside finite() for bsd. * Fix bug where SIGCHLD can be blocked and never unblocked.
* Fix space-related panic. See UPDATES for all the gruesome details. * Add ALT_CHAR to the list of things that can be mangled.
Change the mangler so ANSI turns off ALL_OFF unless all six attributes are being stripped.
* Fix bug with nicks ending with \ in the 353 numeric which has trailing space * Auto-close DCC's that can't send handshakes due to family mismatch.
* Fixed $shuffle*() to respect extractw. * Altered $rest() so that a negative first argument makes it a compliment to $right() in the same way that a positive arg makes it a compliment to $left(). This may conceivably cause problems for scripts. * Spruced $joinstr() up a bit. It now accepts any number of variables and respects extractw. * Fixed an extractw bug in malloc_strcat_word_c while testing the above. * Added $splicec() in functions script. * Added /set dcc_dequote_filenames. Perhaps this should default to off?
* Make inet_vhostsockaddr() extern so dcc can use it * Make dcc_open() use inet_vhostsockaddr() to bind /hostname to dcc conns * Don't allow -b and -q, or -b -and -s, as they cause deadlocks/panics * Fix casting error that caused $urlencode() of high bit chars to segfault * If swapping in a window that has no room for double status, recalculate all * If double-on in a window that has no room for it, recalculate all
* The last argument to open_file_for_write() needs to be lowercase. * Add $numlines() from fudd. EPIC4-1.2.3!
More compiler nits fixed. Nothing worth fretting over.
* 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.
From previous commit... * Fix urldecode * /lastlog -msgs 3 is obliged to skip back 3 msgs, not just 3 lastlog entries. * Fix warnings in gailib.h From this commit... * Fix some const correctness issues * Make message_to() take an (int) and not (unsigned) so we can pass in -1. * Fix some arglist regression tests to reflect new extractw semantics. * Fix uninitialized variable in ok_to_output() that caused panics.
See KNOWNBUGS
* Fix panic with $joinstr() * Fix compiler warning comparing pointer against integer * Fix word appender to NOT USE DOUBLE QUOTES if /xdebug extractw is off! * Fix the word appender so it actually works right.
* 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)
* Add /set wserv_type, either "xterm" or "screen". * Add malloc_strcat_word_c, add a single word to word list, with "" support * Convert a bunch of stuff to use malloc_strcat_word_c to honor ""s right. * GC a bunch of unused code.
Implement "privleged yells" which allow syou to do /set debug 7 at the same time as /set output_rewrite. Yea~!
Make ^ and ~ equivalent since all irc servers do already...
Make some compile warnings go away by using (intptr_t). I hope this doesn't bite me -- every system I checked has (intptr_t)..
* Don't prohibit universal_next_arg_count() from returning empty_string.
* Fix time functions to take (const Timeval) if they don't change the arg. * Create a special handler for /squit to avoid sending QUIT * to server. * Protect some IPv6 stuff i added recently to dcc with #ifdef INET6. Ooops. * Hack up $repeat(<num><space><space>) so it works again. ugh. * Hack up /set <variable><space><space> so it works again. ugh. * Dont allow /timer -repeat -1 0 because that busy-loops. * Add shell of $windowctl() which will be filled in going forward.
Commit #555: * Add #define MINIMUM_CLOCK_INTERVAL and MINIMUM_MAIL_INTERVAL in config.h * Add #define DEFAULT_CLOCK_INTERVAL and DEFAULT_MAIL_INTERVAL in config.h * Add reset_system_timers(), do_update_clock(), and set_cpu_saver_after() * Add time_to_next_interval(), general form of time_to_next_minute(). * Add get_clock() and reset_clock() to replace update_clock(). * Make remove_timer() an extern function so i can delete timers. ;-) * Add /SET CLOCK_INTERVAL and /SET MAIL_INTERVAL * Make $T use the static clock. * Reorganize system timers 1 and 2 into four timers: * - CPU SAVER timer, checks for idleness, to turn on cpu saver * - CLOCK timer, updates the status bar clock periodically * - MAIL timer, checks for new mail periodically * - NOTIFY timer, checks for others on irc periodically * The above three honor "cpu saver" mode. * Nix the old "do_every_minute" timer. * Reorganize the clock generation stuff into "reset_*_clock" functions * Generate the clock statically; only update it from the CLOCK timer * Add reset_system_timers() which regenerates all four system timers. * Don't set system timers in main, call reset_system_timers() instead. * Don't enforce "notify interval" in do_notify(), handle that in NOTIFY timer. * Comment stuff in words.c
Commit 552 * Fix a couple of compiler warnings from freebsd-5 * Revamp move_to_prev_word() so its behavior isn't stinky * Same thing with move_to_next_word(), and they need to be commented. * Now move_to_abs_word() doesn't need to skip leading spaces. * Remove now pointless "strip extraneous spaces" feature. * Don't worry about cheating in real_extractw * Fix last_arg() per all of the above
Commit 551 -- second to last commit for this project -- the big one! * Roll in the new universal_next_arg_count() and attendant macros. * Comment out some deprecated function decls in ircaux.h * Do another round of make depends. * Modify alias arglist code to use the new universal_next_arg_count() stuff * Convert dequote() to dequoter(). * Convert new_new_next_arg() into new_new_next_arg_count(). * Comment out deprecated functions in ircaux.c -- will be deleted later.
Overhaul of malloced string handling functions: * Convert m_[s]c3cat[_s]() to malloc_strcat_wordlist_c() * Nix m_e3cat(), m_s3cat(), m_s3cat_s(), m_3cat() * Nix m_ec3cat(), m_sc3cat(), m_sc3cat_s(), m_c3cat(). * Convert m_dupchar() to malloc_dupchar(). * Convert m_strndup() to malloc_strndup(). * Make malloc_strcpy/malloc_strcat/malloc_strcat2/malloc_strcat_wordlist macros * Convert m_2dup() to malloc_strdup2(). * Convert m_3cat() to malloc_strcat2[_c](). * Convert m_3dup() to malloc_strdup3(). * Convert m_ec3cat() to malloc_strcat2_c() * Use strlcat_c() in $repeat() instead of strlcpy(). whee! * Sanity check first arg to $regcomp(), to avoid crashes. * Don't pass NULL to bsearch(), even if 'nmem' is 0 [$remws()] * Nix the original malloc_strcpy (supplanted by malloc_strcpy_c) * Comment out all the deprecated functions
Convert m_strdup() to malloc_strdup().
* Add some new functions to ircaux.c for malloced string handling * Fix some const correctness issues.
Fix some stragglers and GC unused m_sprintf() function. Fix $serverwin() which was doing a bogus check on server refnums.
Cut over m_sprintf() to malloc_sprintf().
Add support for clock_gettime() which is the posix version of gettimeofday().
Commit 541
* Move #define CTCP_* into ctcp.h
* Add /xdebug extractw_debug
* Move #define LOCAL_COPY and SAFE into irc_std.h
* Create compat.h, move all the compat.c decls into there (from ircaux.h)
* Create network.h, move all the network.c decls into there (from ircaux.h)
* Create words.h, move all the words.c decls into there (from ircaux.h)
* Include "compat.h" and "network.h" in ircaux.h
* Do another round of make depends
* Rename 'search' to 'search_for'.
* Fix the metric clock hooking /on timer too much.
* Revamp words.c, to support passing word quoter (' or ") as an argument.
Metric clock support!
Commit 531: Fix bug reading files where gunzip is a symlink to gzip because of how path_search() calls realpath(). Oh well.
Commit 527 New ignore implementation. I will document all this stuff tomorrow. As it stands, I've tested this for several days and all seems well. Of course let me know if you see any problems.
It is better to use (ssize_t) instead of (int) when refering to string lengths.
Commit 519 * Change m_strcat_ues_c to take a (char *) "unescape" param and not (int) * Rename m_strcat_ues_c to malloc_strcat_ues_c * Rewrite malloc_strcat_ues_c to support new semantics. * Make sure not to pass 0 to alloca() in ctcp checks * Initialize (DCC)->server [found by valgrind] * Change 'expand_alias' so 'unescape' is (char *) and not (int) * Add extra sanity checks in mangle_line against buffer overruns * Fix window_channel() to use new malloc_strcat_ues() arguments.
* 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!
Commit 509: * Move /DCC from commands.c to dcc.c * Nix the "dcc deadlist" crap. Handle deleted dcc's more sensibly now. * Add a "dequote" internal function that removes "s in extended words. * Add "QWORDS" as new arglist type, for quoted-words with "s left in. * Add "arglist" regression test. * Fix strlcpy() in compat.c so it doesn't walk off end of string. * Implement more sensible "locking" mechanism for dcc's * Nix the nominally unimplemented "encrypt" feature for dcc * Create "dcc_create" to create dcc entry * Remove "creation" functionality from "dcc_searchlist" * Nix global variables 'filesize' and 'global_family' now unneeded. * Change order around of arguments to "dcc_searchlist". * Rename "dcc_opened" to "dcc_connected" since that is what it does. * Add "dcc_garbage_collect" which looks for dcc's that need removal. * Add "get_dcc_by_filedesc" and "get_dcc_by_refnum" to look up dcc's * Add "lock_dcc" and "unlock_dcc" to prevent dcc's from being GC'd. * Double check that all output that occurs in dcc.c goes to LOG_DCC * Use dcc_open in dcc_raw_listen() instead of doing the network stuff directly. * Allow "booster ctcp" to be sent for dcc chat re-offerings. * Reorganize register_dcc_offer() so it doesn't create dcc until all is well. * Reorganize process_outgoing_file() into sub-functions. * Don't call "dcc_dead" or "dcc_check" in main io() looper. * Fix new_next_arg_count() to use real_move_to_abs_word() to emulate $1 usage
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.
Dont use isinf(), it's a bsd-ism. Use !finite() instead.
* 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.
Whooo! I'm on a roll! Commit #487
* Add /timer -delete_for_window <winref> to delete window's timer.
* Enhance my_strerror() to take an EPIC Network Error and an errno.
* Enhance Getaddrinfo() to use AF_UNIX path as 'path' not 'host'.
* Confirmed that $match("\\[s s1 "s *"\\]" "s s") works like it should now.
* Store a "current window priority" number in each window.
* Add get_winref_by_servref() returns highest "priority" window for a server
* Have /defer track server, use server's "current window" (per above)
* I'd like to have other things use this, like maybe /xeval -s.
Fix various specious warnings from gcc, also, don't test for "sun_len" in configure; use "sa_len" test for that.
* Explicitly set "mask" to 0 in cs_alist_hash(), so it is initialized * Change type() to typecmd() to avoid name conflicts. * Change 'dot' to 'dotlocl' to avoid name conflicts. * Change 'op' to 'reduce' to avoid name conflicts. * Fix a typo in the error message from /window kill. * Add a panic to detect larne's recent bug that I fixed, just in case. * Constify the "path" argument to uzfopen(). * Make sure return value of strlen() is assigned to a 'size_t' not an 'int'. * Split load() into load() and load1(), load1() reads a file opened by load(). * Now load() is "interpretation-free", and load1() can be replaced. * Fix various minor compile-time issues. * Change %P status line expando to give more useful information.
* $dccctl() changes as per UPDATES. * Misc bug fixes as per KNOWNBUGS.
Yikes. Merged to become consistent with HEAD. Sorry for all the commits, I'll be quiet again soon. :) -wd
* DoS warning as per KNOWNBUGS. PLEASE READ.
* "Word Philosophy" alterations, /alias leak, flood checking, $glob(),
tabkey.ce, regression tests, autoget, /fe, /fec, safe_new_next_arg, as
per KNOWNBUGS.
* $findws(), functions (script), ${i}finditems(), $dccctl(), as per
UPDATES.
* Docs say that $info(o) includes 'g' if $glob() is available. Add it.
* Revamp $win(serv|size|chan|bound|level)() to use get_window_by_desc.
* Revamp $win(screen)() to use get_window_by_desc.
* Use get_window_by_refnum(0) and not 'current_window'
* Allow a \ to escape a space where spaces would be stripped.
* Above bug fixes things like switch ($foo) {(foo\ ) {...}} to work.
* Add handler for /on 330, "user is logged in" numeric in ircu.
* Don't honor/ignore "#" in a window name/refnum. This was lame anways.
* Fix is_window_visible/get_window to use get_window_by_desc().
* Updated the /redirect usage line to reflect features it already had. * Removed the size limitations in enquote_it() which fixes a bug with the two argument mode of $read().
Commit #427 * Add -l<tcl> to the front of $LIBS so -lm can come after it * Look for SSL stuff in default location before hunting for it in /usr/local. * Reset $withval after check for perl so --without-perl doesn't --without-tcl * Make first arg of cvtchar() a (const char *) to silence warning. * Move 'this_sucks' label to a place where it is legal. * Make check_val() cope with NaNs and INFs more graciously... * Fix null deref with /lastlog -c * Update the input line in set_update(), not the caller * Do update the input line when redrawing status * Change make_status() to return a success/failure value. * Don't clear the "status line wants redraw" flag if redrawing status fails. * Nuke the now unecessary "in_window_command" global variable. * Fix bug where <scrollback> + <scrollforward> left you in scrollback mode. * Force init of Window->lines_held = 0 even though that shouldnt be needed.
* Altered the default FLOATING_POINT_PRECISION from 6 to 16 which fixes a math bug. * Melded a count argument into next_args and new_next args to cause a specific number of words to be returned. * Rewrote the /alias xxx (args) form of /alias to avoid using extractw and to use *next_args_count instead. * Tuned the call.xtrace alias in debug.irc. * Extended $is_on() in guh to allow and return multiple arguments. * Added $is_off() as a compliment to $is_on(). * Made a minor philosophical change to the way flood detection works: A message is not counted as a flood if it is the first message in a flood. The most important impact of this is that rate calculations are more accurate.
Documented /exec features.
Note: The -line* switches for the %proc mode are new and haven't been
commited yet.
* 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.
* Implement top-of-minute handling in a system timer * Eliminate top-of-minute handling from io(). * Eliminate CPU_SAVER stuff for the time being. * Change time_to_next_minute() to return a (double) not (Timeval)
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.
* Add /set random_source 3, an arc4random random number generator.
Fix brain-o and a few other non-operative changes.
* Change expand_twiddle(), path_search() to take results as params, int retval * Add normalize_filename(), to do job expand_twiddle() used to do. * Add isdir(), just because * Change /CD, /LOAD, /SAVE, /DCC SEND, /DCC GET, to use normalize_filename. * Change /DCC RESUME, $open(), $which(), $unlink() to use normalize_filename. * Change $rename(), $rmdir(), $fexist(), $fsize() to use normalize_filename. * Change $glob(), $globi(), $mkdir(), $chmod() to use normalize_filename. * Change $ftime(), $randread(), and uzfopen() to use normalize_filename. * Change /LOG, /SET LOGFILE, servers file to use normalize_filename. * Fix /LOG so maximum number of targets per log is a compile time #define. * Revamp expand_twiddle() and uzfopen(). * Fix uzfopen() to look for 'bunzip2' in addition to 'bunzip'. * Fix bug with /QUEUE -delete * Remove unused variable in window_scroll().
Allow /hostname - (or /irchost -) to turn off current vhost.
* Fix expand_twiddle to take a (const char *) * Fix do_log and set_log_file to take a (const char *) * Remove a couple of no-ops in keys.c * Revamp do_log into two parts; open_log and close_log; do_log now a wrapper. * Fix a string that had a newline in it. spotted by Szabolcs Rumi.
* 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().
Add GAILIB, a bsd licensed getaddrinfo/getnameinfo implementation for ipv4 only systems. This was lifted from ruby, who lifted it from WIDE. Add #ifdef's as necessary to compile on non-ipv6 systems.
Update copyright notices and copyright dates.
* Merged in another /fe fix I was brewing.
* Altered new_next_arg to not truncate the arguments list if the argument
taken happened to be empty. This fixes bugs with /fe and $shift() where
the list has "" arguments.
* Gave malloc_strcat and m_strcat_ues a clue variable and used it within
the variable expansion routines so that expanding works in liner time.
* I am a little bothered by this. The _correct_ thing to do is to put
the clue variables into the malloc data for the strings themselves
like perl does.
* Moved the base structure for 1cmd in command queues from last.qcmd. to
1cmd.
* Added command completion to tabkey.ce.
* 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.
Fix indent-o in ircaux.c Change uses of the variable "error" to 'err' since "error" is a function. Change inet_vhostsockaddr() to take a port number, and furthermore change it to use Getaddrinfo() instead of slogging around directly with sockaddrs. This makes it protocol independant. Make ip_bindery() protocol independant. Huzzah! One step closer to IPv6 DCC. "Oops", there goes all the random port garbage. Too bad. It was an IPv4 only solution so the time has come for it to go.
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.
Remove the second argument to inet_ntostr(), [socklen_t of the first argument] because the socket length of the first argument can be inferred directly from the first argument and passing in the length is totaly unecessary. Changes to callers of inet_ntostr() per above change. Change connectory() to call Getaddrinfo() directly and to iterate over all of the returned addresses until it finds one it likes. This change permits epic to automatically detect/support IPv4 and IPv6 server connections without user intervention. make Getaddrinfo(), Freeaddrinfo(), socklen(), Accept(), and Connect() all static functions.
* Fix for an SSL problem where SSL fails to negotiate. It will bail to non-encrytion in this case now. * Fix for splitw() which is used by $uniq() and other functions where some of the elements could be null pointers due to its use of new_next arg. This would cause qsort() to coredump. Switched to safe_new_next_arg which seems to have a performance penalty of about 4%. * Added an "OTHER" flag to $stripcrap() and the mangle settings, which catches all characters that other flags don't. It isn't included in the ALL flag.
Lots more work on the ipv6 front. Remove the last of the vestiges of the old historical address handlers (inet_ntop/inet_pton/inet_aton/inet_ntoa). Now everything, and I mean EVERYTHING goes through inet_strton and inet_ntostr which are just fancy front ends to getaddrinfo() and getnameinfo(). Quite a bit of EPIC is already family-independent, but there is still some left to be clubbed into submission. The project to add support for IPv6 is now about 75% complete! Perversely enough, the only thing stopping DCC from being essentially 100% IPv6 capable is the inability to send an IPv6 hostname through a handshake without breaking the standard...
Fix some function names that I didn't like after sleeping on them. Add extra argument to inet_ntostr() which is passed to getaddrinfo().
Huge major commit #1 in the great IPv6 support addition... Rather than include all of the changes here, read KNOWNBUGS changes.
No functional changes, just removal of unecessary whitespace at the end of lines. From adm.
This is a huge monster commit -- I put the particulars of the commit in KNOWNBUGS. I will only say here that this fixes a lot of issues with DCC and introduces a lot of protocol independance into the networking API that epic works with. Good things will continue to come in the future!
Next round of in_addr/u_short -> sockaddr_in conversions, along with some other minor details. As far as i know, this shouldn't break anything, but I don't promise that. Save your old binary first! If anything is really bad, let me know. I'll fix it ASAP.
Fix some debugging info, make /window channel 0 do the reasonable thing. Change the "sillyname" and release date based on a conversation on #epic. Just a silly little release. =)
This is my first go at supporting embedded colons in server specs. You can use double-quoted words now in your server spec. Man, I Hope this doesn't break anything (famous last words). Here's an example: /server /tmp/.ircd/6667::"tmp:pass":hop:groovy Would add "/tmp/.ircd/6667" as a server, with the group "groovy" using the nickname "hop" and the password "tmp:pass", all without the double quotes, of course. Using double-quotes to surround arguments like this will protect colons inside from being mistaken. I would like to support backslashed colons at some point, but since backslshes are perfectly legal nickname characters, I can't see a way to do this without hackery. :/ I added a "findchar" function in ircaux.c to find the next instance of a character that isn't backslashed.
Garbage collect unused "scanstr" function Major rewrite/redesign of the /QUEUE command. I will be documenting all of the changes in UPDATING. This is overdue by several years.
* Minor cleanups to $mask() and figure_out_address. * Bugfix for $mask().
Thanks to wd for this patch, which: * Breaks part of figure_out_address() off into figure_out_domain(). * Fixes /ignore and $mask() such that they don't munge the given address inappropriately. I have compared $mask() behaviour with previous versions to confirm that it works, which would tend to imply that the main guts are all working, but nevertheless, figure_out_address seems to be particularly delicate so there may be problems.
Silly bug with the (undocumented) malloc dumper. I forgot to close the file.
The small stuff first: * $fskip now takes a second optional argument for the number of lines to skip, and returns the number of lines skipped. If the two numbers match, no error was encountered. If the number is -1, the file was in an error state at the start. * While trying to figure $regexec out, made $encode() and $decode() use the ircaux.c versions instead, and fixed a bug along the way. If this has any imact on these functions then there is a bug. Regex tomfoolery: * Changed the regcomp() library call args a little to make way for $regmatches() which isn't working yet. This should have no impact, but it may, because regcomp is a libc thing. * Eliminated the first argument to $regerror() to bring it in line with the documentation. Cursory examination of some publically available scripts show that although people have been coding around bugs in $regexec(), $regerror() is only ever used the documented way. * Altered $regerror() to return nothing in the case of a successful match for compatibility. See above.
Various compiliation warning fixes. No meaningful changes.
* Added a url encoded message switch to /xquote, designed with socks proxy scripts in mind. eg: "xquote -u $urlencode(ISON xxx)%0a" works. One problem with this is that the last command works, and can be used to get around the built in barriers for such things. Is this good or bad? * -- and any other invalid option will end /xquote switch processing now. * Added $servergroup() and $serverourname(). These were copied from $servername() and behave in much the same way, differing in their return values.
* $rcopattern() added. Coppied verbatim from $copattern() except that the wildcard test is reversed so that the first argument is a string, and the second is a variable with a set of wildcard patterns. * Added three aliases to debug.irc to time and trace commands. * Minor comment update to exec_pipe in ircaux.c. * And, for a grand finale, incremented commit_id.
OK, so trunc(3) wasn't as compatible as I thought, this time I used fmod(3). Also incremented commit_id. :-)
This makes integer math work right again. ${2/3} is now 0 instead of 1,
as it should be.
A minor change to exec_pipe. If the program couldn't be run, the yell, being in the forked process would be sent back to epic through stdout.
* Fixed a buffer overflow in the new /encrypt program mechanism. * Minor cosmetic update for encrypted messages for which the encryption program returns nothing.
This extends /encrypt to add a new argument, which will be treated as a program with which to filter messages through to be encrypted/decrypted. The protocol so far is: One line in text mode, with the key as the first word. Followed (starting on the second line and ending at EOF), by the encrypted message in binary. Binary messages returned are automatically quoted and unquoted for transmission over the wire. Ascii Armoring if performed by the program will "bypass" the quoting features. This patch also alters the way floating point numbers are returned. Before, canon_number was passed over the textual value. Now, ftoa() reads the correct way to do it from FLOATING_POINT_MATH.
Altered the floating point precision to 50 digits, added $ceil(), $floor() and $abs(), rewrote exec_pipe. _And_, altered $trunc(0 ...) to convert the given number to an integer.
This does precisely nothing at this point except, perhaps cause compilation to fail. It is necessary for external encryption, to come later. It adds exec_pipe which forks a sub process with a given list of args, feeds it a given input on stdin and returns stdout as one big string.
Extended the precision of floating point return values to 999 characters since some calculations can return hundreds of digits. This will dramatically decrease the error of calculations, but the length may be a little excessive for displaying, so it may need tuning. It would be nice to make this a define, but this could be a little tricky because the format specifier in question is a string.
Start exposing the commit_id to the user in debugging messages and other various places. Since this will appear along side the version id in things like panic messages, this will greatly help aid in tracking down specific issues.
Hurried patch. This rolls back the $read() patch for now.
This is the new highlight/attribute renderer. It is a "true renderer" because it actually renders things to look like what you say. No longer does turning on some attributes (color) turn others off, nor does turning some off (bold) turn others off. Some things may break with this, please let me know, or feel free to pitch in and fix them. Zinx will be happy to know that i did NOT use the epic5 "prepare_display" routine because he was right, i did totaly break it. I used the epic4 prepare_display function but just made it aware of the new attribute stuff.
The beginning of the migration away from 'time_t's towards 'struct timeval's. This first round of support is very rough and may have some issues, which I will be happy to fix (or you can fix them yourself if you want), but it is more proof-of-concept work for now. I don't expect that I will migrate *everything* to struct timeval, just the important stuff. I have not made any serious attempt to optimize this yet and please don't jump the gun and start optimizing this until I've got the bugs settled out. Thanks. =) Oh yes, I almost forgot the good part -- /timer now has highly accurate sub-second timer resolution. This means you can do /timer 0.82 echo test and it will go off in exactly 0.82 seconds. No more "approximate" timers! The traditional restrictions about timer execution (timers do not go off while another timer is executing, and while you are /wait'ing) still apply.
* Miscelaneous 3cat updates.
* History expansion copies the history buffer verbatim now.
* Bugfix: /!0 would not retrieve the first command entered.
* Bugfix: Negative numbers not found would be display the
incorrect number in the error message. eg: /!-4444
* Alterations to remove_trailing_spaces interface.
* $igetrmatches() was defined, but inaccessible.
More complete support for random local ports; /set random_local_ports now cooperates with /setenv EPIC_USE_HIGHPORTS=1, and it works on freebsd, openbsd, and linux, such as it is.
Permit double quotes in the target of /msg, Reformat some of the stuff that ce commited, and fix an issue with word breaking.
Do some restructuring of crazyeddy's port, add fatal_malloc_check in new_realloc, because we really need to check that... I still need to talk to him about remove_trailing_spaces, though.
Two patches applied, aka, the string and perl patches.
The perl patch adds perl support via three perl functions.
The string patch:
* Rewrites new_realloc to more closely resemble new_realloc in its
interface, and in that it calls realloc directly.
* Adds an argument to the 3cat functions that permits it to seek
directly to the end of the string. Designed to improve performance.
* Alters a few things to use the above.
* Tunes a few other string functions in ircaux.c.
* Rewrites $uniq() for performance reasons.
* Removes the part of $jot() that preallocates the string. I feel a
little guilty about this somehow though it seems to have absolutely
no effect on performance anymore.
Commit #47
* /window server resets the "reconnect attempt" counter ala /server
* /for i in <pattern> {...} now reserved, and emits an error.
* "make depend" done again.
* "my_next_expr" revamped, extra argument added
* "next_expr_with_type" like "next_expr" but first char is "type".
* The /for i in (list) and /for i from x to y commands now use the
above cruft.
* This is epic4-0.9.16-10
* "break_args" now uses "next_expr_with_type"
* "do_log" should use localtime(3) and not gmtime(3), duh.
* "clear_reconnect_counts" is now an extern function from server.c
Add the /for <var> in (<list>) {<commands>} command
Add the /for <var> from <min> to <max> {<commands>} command
Implement "break_args" that breaks argument lists to commands to an array.
Implement "skip_spaces" which skips leading spaces in a string.
This is commit #46, isn't it?
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!
Commit #28 -- try to null out pointers in the free repository.
Implement the "delayed free" queue, a dynamically sized holding area for pointers passed to new_free() that will be free()d whenever we are about to return to the main() function. This obviates the "pointer on the stack" crashes, at the expense of not being able to have crashes tell us when we have a pointer on the stack. ;-)