CVS log for epic5/source/server.c |
![]() |
Request diff between arbitrary revisions
* Add $serverctl(READ_FILE filename) to add servers from a servers file. * Add some preliminary code for sending a /msg to a logfile. * Make scrollback_start/end use "scroll up/down 999,999 lines" * This is for future consolidation of the scrollback code.
* Fixed q1cmd in command queues to address space mangling issues first noticed by Kraca. * Fixed data_struct to work with dword. * Fixed tabkey.ce to work better with args with spaces in them. * Fixed tabkey.ce to not put / prefix on recursed commands (again). * Fixed tabkey.ce to work with 005 CHANTYPES. * Fixed $xdebug() to work with multiple arguments as it once did. * Fixed what appears to be a typo in elf.c and I don't really know what it does. I hope it doesn't break anything for anybody. XXX * Minor optimisation for notify.c. * Added handling of the 340 numeric in numbers.c * Handle extraneous spaces in server MODE messages. Austhex adds these. * Trigger waiting ISON's when we connect again. I don't recall why I took this out in the first place. * Added "/userhost -flush", which will flush the queue of messages waiting to be sent, NOT the queue awaiting replies. * Extended "/ison -f" to also flush the queue of ISON's waiting to be sent.
* Make /xecho -w -1 go to the current window, for compat with epic4 (rb Black) * Make the /server list show the vhost you're using. * /LOADing an executable file results in a warning and not an error. * Fix input line so it doesn't display hidden contents after ^L (rb wjr) * Add a $strptime() function, but I still need a strptime() compat version. * Add $ignorectl(SUSPEND) and $ignorectl(UNSUSPEND) to turn off ignores.
* Change /on listings so they tell you if a hook is "disabled". * Add forgotten code to move lastlog items between windows for /window number * Fix bug where default numeric output wouldn't go to a channel's window. * Remove a superfluous message_from() when parsing server stuff.
From KNOWNBUGS: * Updated $shift() and $pop() with multiple args to work with dword but left it #ifdef'd out as per UDPATES. Also updated regress/funcs to test these. * Added current package to end of $loadinfo(). * Changed /reconnect to jump to the next server in the address list if possible. * If epic crashes and /xdebug crash is set, sleep and wait for a debugger. Most of these should probably be commented on in UPDATES.
* Revert commit 1498 (the dcc stuff) -- it was half baked. * Fix warnings found with --with-warns.
* Fix missing NULL for $hookctl(list ...) [rb howl] * Fix various other issues that valgrind found (yay!)
* Added $serverctl(get/set -1 realname/default_realname). * $Y now is a synonym for $serverctl(get -1 realname). * Added $xform(iconv fromcode/tocode ...) wrapper around iconv(3). With this epic5 takes babysteps towards supporting Unicode.
* Add /SET DEFAULT_REALNAME and DEFAULT_USERNAME * Add scripted /set realname and /ircuser in builtins for backwards compat.
* 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)
Changes suggested by gcc-4.2. No changes in behavior.
* Add ^Vs to the start of DEFAULT_STATUS_FORMAT* in config.h * Comment out code for /set reverse_status_line pending removal later. * GC the code for -f/-F/-o/-O command line arguments * Fix the serverctl() comment for howl
* Fix output of /disconnect when disconnected to be less confusing. * Some changes to tabkey.jm to see if we can get it working. * Move old items from KNOWNBUGS to the epic5 change file.
Fix a very minor bug.
Only one boneheaded error last night. Much better than my normal average!
* Add arg to panic() controlling whether panic is sent via QUIT (rb black)
* Add $serverctl(ALLGROUPS) for kreca
* Fix fulldesc handling code to put []s around ipv6 p-addrs. oops! * GC the if 0'd decls from before the switch to ServerInfos * Add $serverctl(GET <refnum> FULLDESC) for kreca.
Fix bug reported by kitambi.
* Fix bugs with 'builtins' (zlonix) * Revamp the term_init() function, document, etc. * Unconditionally turn off IEXTEN, IXON, IXOFF, to reclaim all of the chars that kernels steal from us (like ^S, ^Q, ^O, ^V, etc) * Whack the -f/-F/-o/-O command line options; per above. * I can now bind and use ^S and ^Q and ^V. Yay! * Fix initialization of ruby, so it actually works for the first time! YAY! * Refactor how lastlog is trimmed, by removing a specific item * Start working on code to remove items from lastlog by grep. * Fix crashes with /stack push set that kitambi told me about * Put in a trivial sleep when checking screen size to avoid race with screen.
* Don't unconditionally set who_level to NONE in /window. * Set and reset message_from() info around each /window operation. * This fixes /window <refnum> echo "<string>" so the line is added to lastlog. * Fix $ruby(puts 0.4.0) by calling rb_rescue2() to catch /all/ exceptions. * Fix /window add/query so they auto-remove nicks from other wins first. * Fix build on non-ipv6 systems. (bruns)
* Interrogate, and pass upwards, the socket error from getsockopt() for nonblocking connects, and then output that error to the user. Requested by twincest.
* Change startup code so it outputs the pid of the bot process for -b. * Fix $info(o) bug. rb zlonix * Output the errno value ret by failed nonblocking server connects on error. * Add auto-close boolean flag for server (see UPDATES)
Add /userhost -extra for nullie
Add a very slight delay when receiving the 001 numeric to fix a race condition that I'm seeing on epicsol. doh. :/
Add a new field to server descriptions, 'vhost' to allow you to specify a per-server virtual host. All the usual caveats apply.
This is the start of a major project to normalize the behavior of word handling in built in functions. The project involves stipulating that every place that handles a "word list" define what a "word" is and use it consistenly, and to output the same type of "words" that it accepts as input. This leverages /xdebug dword to control optional support for dwords in many built in functions.
D'oh!
Fix some bugs with /window query that kreca found.
* Make $urlencode() rfc3986-ish, converting all non-unreserved chars * Change ServerInfo to use const char's since we don't modify them directly. * Reorganize how ServerInfos are used, into "temporary" and "permanent" types * Convert Server's use of ServerInfo's into safe permanent types. * Add /server -update <refnum> <desc> to change server descs on the fly. * Fix typo in /invite. * Fix 'country' script by wrapping it with xdebug dwords.
* Pass double ptr to remove_bindings_recurse() to fix exit-time memory leak. * Remove /set bad_style, input_aliases, security, (unused) * Remove /set ssl_certfile, ssl_keyfile, and ssl_path (unused) * Add a (ServerInfo) object to (Server), switch to using it. * Remove a bunch of unused thingees in (Server) while i'm here. * Restore /set reverse_status_line to a builtin. oh well.
* Fixes for two memory leaks from nullie * New /on, /ON WINDOW_SERVER, from nullie who needs to write a blurb.
Fix compiler warnings, should not be any functional changes.
* Make /window foo kill not fall back to /window describe, for want of 'foo'. * Add a 'proto' field to server descs (tcp4, tcp6, 4, or 6), see UPDATES.
* New 'builtins' from blackjac, more modern format, /whowas improvements * Refactor the serverinfo stuff * Allow skipping of fields in server descs (see UPDATES)
* Fix finite()/isfinite() madness. * Look for clock_gettime() in -lrt for ubuntu. * Automatic reconnect from nullie. yay! * Change /xecho -v to always output to current window if it's visible. * Fix /on's with arglists, so lower serial nums don't corrupt $*. [rb nullie] * Fix memory leak with $url(en|de)code() [rb nullie] * Change /server - so it calls disconnect() directly * Fix const correctness problems with sha2.c
* Add $serverctl(GET refnum ADDRSLEFT) (see UPDATES)
* Add server states CREATED and DELETED for nullie.
* Add SEDSHA cipher type, which is better than SED, and always available. * Add my_sleep|isreadable|iswritable() funcs to phase out rogue selects()h * Add support for multiple concurrent servers to /encrypt. yay! * Store the length of the Crypt key within the key itself. * This moves us closer to being able to decrypt arbitrary data. * Test all of the cipher types, incl. compat of CAST with ircII. All set!
* Support cast5/blowfish encryption a la ircII. * Fix build for non-ssl users.
* Support AI_ADDRCONFIG in our builtin AI_MASK/getaddrinfo(). * Make set[_non]_blocking extern. * Support NEWIO_SSL_CONNECT as a new_open() type. * Add a new ssl_connect() io callback function for NEWIO_SSL_CONNECT. * New scripts from weirdo: autojoin, autoquery, floodprot, renumber * New version of reconnect script from weirdo. * GC the fixed-alist support (last used by /quote and protocol handler) * Reorg server SSL negotation stuff to be nonblocking. yay! * Comment all sorts of stuff in ssl.c.
* Don't call close_server() for gaps in server list in close_all_servers().
Fix buffer overrun with new server state.
* Lay the foundations for nonblocking ssl connection (not supported yet) * Change SEND_LINE to do SCROLL_FORWARD if we're in scrollback mode * Add support for maildir mailboxes. * Fix crash with 042 numeric.
* Check for <ndbm.h> in configure, don't do DBM if it is absent. * $dbmctl() always no-ops, returns empty string if dbm not available. * Add 'd' to $info(o) if DBM support is included * Add a check for solaris cc, moxy up the CFLAGS for larne. * Fix compile breakage if both tparm() and base64() are missing. doh. * Fail when maximum number of levels have been added. * Note a few places the window refnum is changed.
* 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.
* Nix some func decls in windows.h that don't exist any more * Add message_setall(), lets you save to_window on the message_from stack. * Replace users of message_to() with message_setall(). * Replace direct users of to_window with message_setall(). yay! * /XECHO got rewritten as part of this. See UPDATES * Fix various compiler warnings.
* Include <stddef.h> if we can, for no particular reason... * Nix now unused mangle_line(). yay! * Use (intptr_t) instead of (intmax_t) to treat pointers as integers... * Try to handle failures from the dns helpers with more grace.
* Convert the other users of mangle_line() to new_normalize_string (*gulp!*)
* Add support for dgets buffer type -2 (only return full buffers) * Use buffer type -2 for reading nonblocking dns addrs, fixes probs on solaris.
* Improve /dcc get * Fix warnings
Add humanize_number() and fix compiler warnings. more to follow!
* Add new server status, "ERROR" for nonrecoverable socket errors.
Addendum to the previous commit. The /ison changes were difficult to separate and aren't documented: These are the -e, -end and -max flags, and the fact that -max and -len are per-server variables now.
* When a window is resized, make sure scrollback is bigger than new size. * Add multiple stricmp tables, "ascii" and "rfc1459" * Make all string insensitive compares use "ascii" * Add black's ornamentation on the addset script. * Fix some regression scripts * Fix pf bugs with various scripts. * Add the [$func](args) capability to the new math parser. * Add the === and !== literal equivalence (case sensitive) operators. * Sort of set the case sensitive mapping to use in the 005 handler (hack!) * Fix error recovery of ssl connections.
* Don't do LOCAL_COPY within an infinite loop, leads to stack exahustion. * Support new signal, SIGUSR2 which throws "system_exception". * Teach the block commands about "system_exception" so they can be stopped. * Whack a bunch of unused timers from vars.c. (see UPDATES) * Sync up config.h, vars.h, and vars.c with each other. * Add "domains" to timers, server timers, window timer, general timers * When timers go off, latch back to their domain * Allow timers to self-cancel if their latched item has gone away * Add /timer -general to set a general timer. * Make /timer -win or /timer -serv set a window or serv timer especially.
* By default, <hostname> as server, defaults to port 0 * By default, port 0 changes to irc_port (6667) for a new server * This means any use of <hostname> in a server context picks up 1st <hostname> * The -B command line option (load startup file before connect) is now default.
* Fix up do_server() so anything that happens is wrapped in message_from()s. * Show the server list for /window server instead of an error.
* Put all handling of /set quit_message et al in close_server(). * Fix /quit to pass unspecified quit message as NULL to irc_exit(). * Fix irc_exit() to handle unspec. quit message as NULL to close_all_serves() * Fix close_all_servers() to not change quit message for NULL. * This allows /quit to use (not override) each server's quit message! * This also allows a single %s in /set quit_message to be honored everywhere!
New builtins, very preliminary support for nonblocking dns.
* Add marshalling functions for getaddrinfo() * Use getaddrinfo marshalls + dgets to simulate nonblocking dns lookups. * New newio io type, "NULL" which i'll probably whack later.
New internal function "marshall_getaddrinfo" which re-constitutes the linked list return value of getaddrinfo() into a single buffer which we can thus new_free() later. This will be forming the basis of any async dns lookups, because a full getaddrinfo() return value can be passed as 1 block of data.
* Add /window killable to allow you to make windows unkillable * Nickname rejections are handled through /on new_nickname solely now.
Reorganize how nickname changes are handled, refactoring coming soon!
I apologize to Kev for cluttering up your inbox with all this junk. :d
Ah today ain't my day. Gotta stop coding without caffeine. :/
Third time's the charm!
Re-fix the ircnet stuff I just "fixed" (*cough*).
Fix ircnet unique-id support so if you do /nick <unique-id>, the default nickname (in case of reconnect) is "0" and not your <unique-id>, which would of course fail.
* Fix $windowctl(GET * QUERY_NICK) * Don't do WHO on anonymous channels (channel mode +a) (for ircnet users) * Don't set server's default nickname until we first try to connect.
Add $serverctl(GET * LOCALPORT) [fudd]
Fix $serverctl(REFNUM ...) oooops!
Permit /set -new_server_lastlog_level and /set -old_server_lastlog_level which prevents epic from changing the window's level when you're connected to a server or when a level collision occurs after a /server. Use these with caution, I don't know what might happen!
Stuff for fudd and blackjac.
* Check for arc4random() in configure, don't use compat.c version if possible. * GC "fill_it_out" code which has been deactive for a while. * Fix translation casting error for zlonix * Allow current_package() to return NULL, handle that as special case. * Refactor the startup loading stuff * Move a couple of loads out of basical and into global.
* Take a new arg to new_open() to control whether INFO -- errors are output. * Don't output the "INFO --" things for dcc or execs
* Don't try to figure out disconnected server's port from sockaddr, duh!
* Fix SSL with pthreads -- need to establish SSL before calling SSL_read! * Fix compiling with kqueue, call it --with-multiplex=freebsd-kqueue * Hide SSL capability behind "client_ssl_enabled()", nix all #ifdef HAVE_SSL
Fix SSL with pthreads.
* Add --with-multiplex=[select|poll|kqueue|pthread] to configure
* Check thread-safety of SSL in configure when using pthreads.
* Don't unconditionally skip leading :'s in symbol names.
* When calling functions, handle skipping leading :'s specially.
* Add support for pthread locking for ssl to ssl.c
* Add %{2}+ and %{3}+ status expandos that only show the mode string.
* Use AI_ADDRCONFIG flag to tell getaddrinfo() we only want addrs we can use.
* Refactor the error stuff by eliminating my_strerror() and dgets_errno. * Error messages are now delivered on multiple levels as info is available. * This may get annoying, but it's a lot more accurate now! * Change inet_* functions to return int's since their retval is unused. * Add a new internal "syserr()" function that generates formatted errors. * Syserr's look like say()s but they act like yell()s. (can hook with /on yell) * Keep an counter in the server stuff so we can count off as addrs are used. * So the error message in /ON DCC_LOST is always just "ERROR" now. * Fix various compiler warnings and stuff. * Add $hookctl(GET HOOK <ref> STRING), return /load'able format of ON * Fix some debugging outbound in switch_hostname(), doh! * Roll set_socket_options() into a new Socket() function. * Roll connections to AF_UNIX sockets into the mainline stuff. * Roll nonblocking/connect/nonblocking into Connect(). * Add AF_UNIX support to Getnameinfo() to remove annoying errors. * When doing recovery from EBADF in select, only check fd's we're using * Just puke if configured for kqueue() and kqueue() fails. * Don't puke on default 353 output if the userlist arg is missing. (for ratbox) * Permit doing /window name to change case of window's name.
* Implement a proper built in /INVITE command. See UPDATES * Revert 2.8script change. * Add "subpackage" command, which i'll document later. * Package up 'global', and '2.8script' and 'basical' so they can be /unload'ed. * Don't load "global" if user has their own startup script. * Don't load "global" if the -q option is set, either. * Thus, the "global" script acts as a default "epicrc" for those without one. * THIS IS BACKWARDS INCOMPATABLE. SEE UPDATES FOR IMPORTANT INFORMATION. * Nix the "loading_global" variable, only used by hooks. * Fix /on 005 so it shows the /on 005's and not all numeric hooks. * If Accept() fails, tell the user straight-way so I can debug this. * Fix /window name - so it redraws the status bar.
* Comment out some oper-only things in 2.8script the opers seem to hate. * Update some copyright years, just for laughs.
* Fix accept() with pthreads. Nonblocking + pthreads == Bad. * Throw away all unused addrs when we are registered, to ensure no reconnects.
* Fix the second lamest bug ever. DO NOT DO CONTNIUE WITHIN WHILE (0) DUMMY.
Fix more bugs. yay!
Fix ssl server connections.
* Refactor $sar() and $msar() so they share as much code as possible. * Refactor newio, support select/kqueue/poll (#define's in newio.h) * ... Getting closer to not needing select! * Fix SSL. * Fix a bunch of misc compiler warnings * Remove restrictions on /QUOTE, so there! * Add pthread support to newio for larne. HUZZAH! * I'm sure a zillion things are broken, so it's time to test!
* Add a dgets_buffer() to inject data into dgets() system. * Fix up dgets() so it has read() like semantics. * Fix up dgets() callers to use it like a read() type function. * Turn off /xdebug server_connected hardcoded at startup for now. * Fix up unix_* io functions to use dgets_buffer(). * Fix do_filedesc() to repeatedly call callback until buffer is clean * Move set_socket_options() to network.c, make do_filedesc() global func
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 $symbolctl(pmatch <incorrect> *) crash
* Auto-create server's first altname, make %S and %{1}S use it.
* Don't add mode types 2, 3, or 4 (takes-args) to the channel mode string.
* This makes ircnet's +R not show up on the status bar.
* Fix /dmsg =<ircnet-numeric-nick>, for Q.
* Add $serverctl(GET <refnum> PROTOCOL), returns IRC or IRC-SSL
* Hide ArgListT in alias.h to only those who need it, to save numbers.c * Fix up a lot of compile warnings all over the place. * Some changes to $hookctl() might need feedback from howl... * Fix vhost support so we can do inbound sockets again.
* Refactor window_check_servers() to work with server's current window only. * Roll forward all the rest of changes from epic4 (i think) * Add /ON NEW_NICKNAME, when epic needs a new nickname from you. * Run 'make depend', fix compile errors, fix 'environment' script
* New internal function set_mask_by_winref() allows changing window's level. * Make /xdebug regex_debug outputs privileged yell()s, just for sanity. * Change /set new_server_lastlog_level to take effect on 001 (see UPDATES) * Refactor window_check_servers() to work with server's current window only.
* After connect()ing to a server, save the remote peername * This fixes $serverctl(GET <num> PORT) * This also fixes $servports(), which should work as (not) documented. * Fix for notify_signon default handler, from larne. thanks! * Add $serverctl(GET <num> ADDRFAMILY), returns "ipv4", "ipv6" or "unix" * Allow /hostname <ipv4>/<ipv6>, separately set v4/v6 vhosts! (see UPDATES)
* New /ISON bells and whistles as per UPDATES. * Changes to /reconnect, /server -a, /on server_established and remove_from_comma_list() as per KNOWNBUGS.
* Nix calls to dcc_connected(<fd>, 0) which were always bogus. * Create print_arglist() for printing alias arglists, natch. * Fix crash from /queue -del <name> <num> for <num> = <items> + 1 (rb black) * Show arglist when creating and listing aliases. * Fix memory leaks of buckets when user grabs /on set. * Add a "alternate names" bucket to server data. * Create a whole new api for querying and creating server refnums. * Fix crash with /dump on (/dump all) * Add $serverctl(GET|SET <refnum> ALIAS) get and set server alternate desigs * Add $serverctl(GET|SET <refnum> ALIASES) get and set entire list. * Fix memory leak with /on set
* Numerous new and changed features as per UPDATES. * Better handling of damaged /who x,y responses.
* Nix /save and pray nobody notices. * Implement pmatch_* stuff in alias.c to use the unified symbol table. * Commands, functions, and expandos now 100% integrated. HUZZAH! * Reimplement $get(set|command|function)s() to use the pmatch_* stuff. * So they now pick up changes at runtime. HUZZAH! * Allow built in /set to be conditionally added to the "set bucket" * Don't put user-created /set's in the bucket * Allow user to replace one user-created /sets but not builtin sets. * Allow mangling of ALT_CHAR -- how did this ever get missed? * Fix $currchans() so it works the way the documentation says it does. * Fix some const correctness issues, introduce others. bleh.
Sync up with all the bug fixes from epic4.
* Refactor IrcVariable to not depend on having the varname. * This will lead to multiple hard links to the same /set value in the future. * Nix the 'name' and 'hash' values in IrcVariable, no longer needed. * Make all uses of "realname" use the /set realname variable (rb adm) * Nix the global "realname" variable, use /set realname for all. * Fix bug with free_bucket() * Fix compile warnings in vars.c * Store built in variable xref table in a bucket. * When changing a user-created /set, start calling the user's scriptback * Allow the user's scriptback to call /set to override the user's value. * Tell the user that they created a new /set.
* Userhost updating for NICK messages as per UPDATES. * Delayed ISON requests as per UPDATES.
* 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.
Add $serverctl(GET * STATUS) for CE.
* Move some defines from comands.h to where they belong * Add and remove func decls in header files as necessary. * Add /wait =<fd> which returns when a nonblocking dcc connection finishes * Make all keybinding funcs/decls use the BUILT_IN_KEYBINDING macro. * Make the BUILT_IN_KEYBINDING macro use unsigned chars. * Hide (struct Key) inside keys.c, and use (void *) to hold state. * Make the input line use (unsigned char), not (char), huzzah! * Make the "othername" ($3 in /on dcc_raw "E") the port number. * Avoid a NULL deref with "parse_command" keybinding.
* Move Lastlog definition to lastlog.c, leave stub behind for window.h * Add window_all_channels(), return all windows for channel from names.c * Change boolean vartype for windows and status: int -> short. * Add do_short_boolean(), like do_boolean(), but it takes a short. * Make the default server quit message "Leaving" * Have /window describe show all the channels in a window. * Have /window describe show nicks, channels in flat list, not one per line. * Make sure to use the server's default quit message when closing it. * Create a prototype of atoll() for compat systems.
* Make sure that servers go through SERVER_EOF state on eof! * Track waiting/pending channels using a nicklist per window. * Nix $winbound() and all the other stuff relating to bound channels * Fix bug with binding/initializing the 255 key * Fix bug with TOGGLE_STOP_SCREEN keybinding.
GC the blocking connect() code, epic is now fully nonblocking connect!
Well, at least it compiles again, but I think i still need at least one or two sweeps of the code to make sure I got everything proper.
*********** DONT RUN THIS -- IT'S WORK IN PROGRESS -- DONT RUN THIS *********** * Import epic4 commits 674 through 692, inclusive. * Import epic4 commits 693 through 710, inclusive (epic4-2.0 final) * Change _X and _Y macros to LEVEL and LEVELMASK for linux (sigh) * Add a searchbuf() 8 bit clean byte-finder for future use. * Convert flood checking, ignore checking, lastlog, logfiles to int masks. * Convert message_from to int masks. *********** DONT RUN THIS -- IT'S WORK IN PROGRESS -- DONT RUN THIS ***********
Fix a typo for ssl users.
Merge changes from epic4 commits 674 to 692, inclusive.
* Abstract the reading function out of dgets() via an argument * Add unix_read(), the default reader for dgets() * Add ssl_reader(), a dgets-like reader for SSL connections * Add server_ssl_reader(), a dgets reader for servers using SSL. * I probably broke SSL servers by doing this -- report bugs please!
* Abstract fd handling in newio.[ch] through #defines * Add fd handling with freebsd's kqueue(). Huzzah! (not turned on by default) * Refactor how dgets() works with incomplete SSL reads, slurp up everything * Nix the bletcherous do_server(-1) hack in io(). * Fix a few more bogons in do_server().
* Fix typo in do_server() that caused a blocking read. doh! (rb adm)
* Fix io() to call do_server(-1) to do ssl timeouts. bleh.
* 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!
Don't do anything for /on 465, refactor /server.
* Make /reconnect work on servers that are not already open. * Don't just cavalierly change window's servers. * Prefer close_server(i, NULL); over change_window_server(i, NOSERV); * Allow windows to stay connected to closed servers. * Nix window's "old server", now they're unnecessary. HUZZAH! * Mop up channel stuff that coped with window-old-server. * Break backwards compatability and make /window +<server> reconnect to ser. * Break backwards compatability and make /window -<server> disconnect from serv * Hide a bunch more debugging output behind /xdebug server_connect * Refactor change_window_server(). * Make /window discon the same as /window noserv, total disconnection.
* Be careful what modes we add to modestr in update_channel_mode. * GC some old epic4 macros which we don't use * Fix a typo that b0rked /on server_status * Force output for a server connection to go to its connected window. * Make /server reset server's status, so it can be reconnected to.
* Fix some compiler issues and so forth * Nix the NOTE level. * Move load_ircrc() to irc.c, nix "startup_file" global var. * Always change server state using set_server_status(), because... * Add /ON SERVER_STATUS, $0 is refnum, $1 is old state, $2 is new state * Delete /on widelist, no longer used * Prototype mode string manipulation functions * Reorganize names.h to reflect new realities * Prototype (Get|Free)addrinfo() now that server.c uses them. * Nix /window bind, rebind, unbound; $windowctl(* BIND_CHANNEL *)
* Assimilate notice.c into parse.c. *poof* * Fix some compiler issues and so forth * Nix the NOTE level. * Move load_ircrc() to irc.c, nix "startup_file" global var.
* Allow client_connect() to be nonblocking * Allow Getaddrinfo() and Freeaddrinfo() to be called extern. * Track writable sockets in 'global_max_fd' too. * Keep a list of AI's for server addresses in the server code * When server connection lost before registration, use the next AI * Implement set_server_status(), which controls where server is in lifetime * Nix reconnect(), which is replaced by close_server + set_server_status(). * Nix server_reconnects_to(), we no longer reconnect to servers. * Make /xdebug server_connect the default for this commit at least * Call window_check_servers() every time through io(), because... * Make window_check_servers() look for disconnected servers and restart them. * Add add_mode_to_str() which adds a channel or usermode to a string (sorted) * Make usermodes use add_mode_to_str() * Make channel modes use add_mode_to_str() * Now modes are not stored in bitmasks, not hard-coded at compile time. HUZZAH! * Nix "inactive" field in channels, channels are thrown away at disconnect * Don't allow channels to move between servers, natch. * Nix all the code to handle disconnected channels and such. * Use change_window_server() to move windows to new servers, because... * Make window_check_servers() auto-close windowless servers. * Make change_window_server(<server>, NOSERV) cause a disconnect from <server> * Don't honor /set auto_reconnect, we don't ever reconnect. * Fix printf() error in /on kick default output * Add new server state, SERVER_RECONNECT which means "i can be connected" * So now SERVER_CLOSED means "don't reconnect me" * Allow /server, /window server, and /reconnect to change CLOSED -> RECONNECT * Make server connections nonblocking. * Server connections are now nonrecursive, nonblocking, multi-protocol. HUZZAH! * GC a bunch of server code dealing with reconnection we don't use now. * Don't call window_check_servers() other than io() for sanity reasons. * Make /window server just change server, let w_c_s() bootstrap connection * Remove many window->channel->server sanity checks.
* commit 1013: * Use a "status" variable in server, instead of a plurality of binary flags * Process usermodes as strings only. * Nix 'flags', 'flags2' and 'umodes', 's_takes_arg', and 'eof'. * Change update_user_mode() to take a server refnum. * Nix $serverctl(... UMODES) * Change server_is_registered() so it takes a server name and our nickname. * Add server_is_unregistered() which i'll use in the future. * Hook /on server_lost all the time in close_server() by popular request. * Make $version() always return "2.8" since all servers are 2.8 servers. * Check /set auto_rejoin_connect at disconnect-time, instead of connect-time. * Use a "is_server_active()" function instead of "did_server_rejoin_channels" * Move the guts of got_initial_version_28() into server_is_registered() * Call "server_is_registered()" from 001, which loads ircrc among other things. * Reduce 004 so it only sets the server's version string id. * Nix got_initial_version_28
Make 'empty_string' (const char []). Now we're cooking with gas!