CVS log for epic5/source/exec.c |
![]() |
Request diff between arbitrary revisions
* Phase two of larne's patch is to isolate features that require job control * You can #define NO_JOB_CONTROL to turn off fork/exec type stuff. * Soon, the configure script will auto-grok this.
* Roll in a bunch of changes from larne to make epic5 more vms-friendly * Rename if.h -> ifcmd.h (larne) -- Make sure you rerun configure! * Run make depend to pick up name change of if.h * Check for <sys/param.h> in configure (larne) * Extern funcs are case insensitive in strict c90, fix (larne) * Rename options -> options.h since vms requires a dot in filename (larne) * Change "readonly" -> "rdonly" since "readonly" is a symbol in vms. (larne) * Pull in "compat.h" for gailib.c and glob.c (larne) * Set stdout to be explciitly line buffered at startup (larne) * Returning a value from void functino forbidden by strict c90. fix (larne) * Fix some compiler warnings that were lying around. * There are more changes forthcoming, these were the easy ones.
* Add a new internal function prepare_display2() a reduced version of p_d(). * Add a new internal function fix_string_width(), the guts of $fix_string() * Fix /set indent to use prepare_display2(). Now you can use ^C codes. yay! * Fix fd leak if fork() fails for /exec. * Fix window toplines so they extend the width of the screen like statusbars.
* Add new level SYSERR (see UPDATES) * Add a server refnum to syserr() to send the syserr to the proper window. * Add a server refnum to new_open() so we can pass it to syserr(). * Add new flag to /XECHO, /XECHO -AS (output to all windows on server) * This should make syserrs go to the "correct window" most of the time (larne)
* Fix problem with get_child_exit() can block SIGCHLD. * Change $mask() so it doesn't require a full $uhc() value, compat with epic4 * Avoid crash by actually removing ssl entries when they're shut down
* Switch users of LEVEL_CRAP to LEVEL_OTHER. yay! * Whack some unused functions and decls, make *toa() funcs return const. * Roll get_window_by_name() into get_window_by_desc(), it's only user.
* Fix /away -all so it doesn't error on gaps in server list (weirdo) * Fix bogon in /xecho. doh. * Fix /who -real so it matches both with and without the hopcount. * Convert all uses of message_to() to message_setall(). yay!
Guard all output from backend /exec stuff with message_from()s, for weirdo.
* Change /exec -out to output to the current target, (*gulp*)
* Take a new arg to new_open() to control whether INFO -- errors are output. * Don't output the "INFO --" things for dcc or execs
Fix fd leak, observed by ce.
Fix more bugs. yay!
Fix more bugs.
PHEAR the breakage! * Major refactoring of newio system: * Change main io() look into a "fill" cycle and a "drain" cycle, using buffers * Change new_open() to take an io policy to perform when fd is "ready" * Use token to determine if an fd is "dirty" or "clean" (is data ready?) * Process accept()s through newio/dgets. * Merge nonblocking connects as just another type of new_open() policy. * Nonblocking connects emit sockaddr info when connected for dgets(). * Change dgets() to not perform io, but just drain from the buffer * Now all data goes through dgets()! huzzah! * Nuke kqueue support for the moment (will come back later) * Hide the "holding" status of a fd inside the IO metadata. * This allows me to support "holding" in other IO models. * Major refactoring of ssl support: * Move all meta-data about ssl in ssl.c in a linked list * As much as possible, have server treat the ssl case as "normal" * Implement all ssl interfaces even in non-ssl case, guard with panics ^^^^ None of the above should be user-visible changes.
* Fix /dmsg =<numeric> again, fix compiler warnings. * Whack dgets() into submission regarding incomplete unbuffered lines. * Revamp how partial lines from an /exec process are handled.
Fix bogus error message with /exec -direct
* Begin massive refactorization of alias.c, redefining "Alias" as "Symbol" * Refactor parse_line() with a bunch of front end call_* functions. * And a general parse_line() front end, "runcmds()". * Roll builtin expandos in with the user variables * Roll variables and commands together into one name space. HUZZAH! * Nix the caches for the global name space, for now. * I definitely broke /stack alias|assign here. I'll fix it later. * Inline expandos are now officially strings instead of a single char. * Fix bug with $unshift() that popped up. * Move after_expando() to ircaux.c. I think it belongs there more.
Fix typo in exec that leads to a blocking read. found by ce.
* Make new_open[_for_write] take a callback function, stash it in io_rec. * Add handle_filedescs() which takes select() results and calls callbacks * Make io() call handle_filedescs() instead of the four callback functions. * This is the first stage of an extendable callback event looper! huzzah!
Make 'empty_string' (const char []). Now we're cooking with gas!
* Fix for a bounds error in /exec -direct.
* 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)
* 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!
Convert m_strdup() to malloc_strdup().
* 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!
These are relatively minor changes except for the $prefix() fix. * commandqueues as per UPDATES. * $prefix() fix and regression test as per KNOWNBUGS. * /exec and nick rolling as per KNOWN bugs.
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.
Okay. User input is now handled specially, and parse_command() will not accept incomplete command names anymore. -wd
Another merge.
* Reorganize param list to dgets() to include a length argument * Add (set|get)_server_line_length(), the maximum size of an irc protocol line. * Convert dgets() callers to the new calling style.
Yikes. Merged to become consistent with HEAD. Sorry for all the commits, I'll be quiet again soon. :) -wd
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.
Documented /exec features.
Note: The -line* switches for the %proc mode are new and haven't been
commited yet.
* Remove colon at end of RETURN_MSTR so it is like others. * Unify dgets() and SSL_dgets() * Add a 4th argument to dgets(), an (SSL *) for ssl reads, NULL for normals * Integrate SSL stuff more tightly by removing unecessary #ifdef's * Change 'enable_ssl' to 'try_ssl' to avoid confusion with 'ssl_enabled' * Remove uneccesary members of (Window) * #include "functions.h" in any file implementing built in functions. * panic if ssl op attempted on non-ssl connection. * Don't call functions in RETURN_* macros. (they're evaled twice) * Nuke #ifdef 0'd uses of 'ceiling_of_display'
* 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.
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.
* /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().
Update copyright notices and copyright dates.
I'm going to start sweeping the entire source, adding the official copyright notice to each file (like ircII does already), and making sure that the /* $EPIC$ */ thingee is at the top of the file. This is my first swath of files.
No functional changes, just removal of unecessary whitespace at the end of lines. From adm.
Two new functions in ircsig.c: "block_signal" and "unblock_signal" which use sigprocmask() which I hope everybody has! Based on a discussion with |Rain|, block the SIGCHLD signal before we go waitpid()ing, and then unblock it when we're done. This cleans up a race condition that might happen if two of our child processes die in the same time slice; we would only get one call to our SIGCHLD handler, but we would have two children to reap; "dead_children_processes" would then be a negative value and bad things would occur. Now we handle SIGCHLD as a condition rather than a discrete event; whenever we get a SIGCHLD, the next time through a sequence point we block SIGCHLD, reap our children, reset "dead_children_processes" to 0 and then unblock SIGCHLD and go on our way.
Get rid of the awful hideous bsd_*env() hacks we had in compat.c and start using getenv() and setenv() like normal programs do. Unfortunately on many systems, setenv() may result in memory leaks, but this is really not anything I have control over. It's better that we use environment variables in the way the system intends it than to try to go off and do it on our own. This means you can /setenv TZ EST5EDT for example, to set the timezone of your clock, and it also means you can do /setenv ONE two and expect $ONE to expand to "two". It also means that /setenv values are actually propogated to child processes. This is all just a better choice than avoiding a theoretical memory leak.
* Fix server assignment in /exec so it works in /on's again. * Fix failsafe declaration for MAXPATHLEN for hurd in irc_std.h and glob.c. * Fixes to make dcc-over-ctcp-over-dcc work again (|Rain|) * Fix $querywin() so it can take a second argument, a server ref (for scromp)
Use FD_CLR to prevent multiple hits on a file descriptor between select calls. Discovered by Q when he was testing the 010 redirect handler.
Initial import into CVS
Initial revision
| CVS Admin |
Powered by ViewCVS 0.9.2 |