CVS log for epic5/source/dcc.c |
![]() |
Request diff between arbitrary revisions
* Roll forward portability changes from epic4-2.10 (larne) * This also includes term.h -> termx.h -- Make sure you rerun configure!
* Change builtins script so it doesn't /xecho -w for who replies. * Fix typos in dcc_ports * New version of tabkey.ce from fudd. * Make /dcc list output go to level OTHER by special request of kreca.
* Create aliases for [url|b64][en|de]code, sedcrypt, and sha256 into builtins. * Comment out builtin [url|b64][en|de]code, sedcrypt, sha256 builtin functions. * Change /xquote -u to use xform() instead of urldecode(). * Change dcc_url[en|de]code to use xform() instead of urldecode(). * Change /on ssl_server_cert to use xform() isntead of urldecode(). * This allows me to comment out old urldcode/base64decode stuff. yay!
* Revert commit 1498 (the dcc stuff) -- it was half baked. * Fix warnings found with --with-warns.
*** I'm only half done here! Some stuff is probably broken! *** -- Just please be patient when telling me what I broke and I'll fix it. -- * Begin a refactoring of dcc to make my life easier * Simplify register_dcc_offer(), removing unnecessary args. * Also, register_dcc_offer() will only take url-encoded filenames now. * Fix up the ctcp handler do_ctcp to urlencode offered filenames. * Change the DCC_FILE* macros to DCC_SEND and DCC_GET to stop confusing me * Add a "offer_filename" variable to dcc's for next round of work * GC some unused code * Break dcc_message_transmit() into dcc_raw_transmit() and dcc_chat_transmit() * Drastically simplify those two functions * Fix up dcc_raw_transmit() so the hostname isn't required * This means /dcc raw <fd> <host> <msg> ignores <host>. yay!
--- This is a bunch of stuff I've been sitting on while I wait for howl to finish what he was doing. --- * Add support for ./configure --localdir * Add support for ./configure --with-iconv=/usr/local * Add support for looking for iconv in configure in various places * Make configure check for nanosleep(). * Add function decls for [sg]et_server_realname() * New version of screen.e * Change "filename" to "local_filename" in dcc's, in prep of further work. * Un-revert a few minor things.
* 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 dccctl(DEFAULT_PORT <string>) [see UPDATES] * Add /on dcc_lost case for cant-bind-port [see UPDATES] * Add 'dcc_ports' script [see UPDATES]
* Change /say (or the empty command) to send to channel first, query second * Add $dccctl(SET|GET ref WANT_PORT) to set the -p flag. * Change tabkey.jm to use /msg -serv/nick instead of /msg serv:nick
* 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
* 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 a new field to server descriptions, 'vhost' to allow you to specify a per-server virtual host. All the usual caveats apply.
Separate hostname from port in a better way so ipv6 hosts don't look all confusing. Requested by larne.
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.
* Fix cross-matching of ctcp-over-dcc with queries. YAY! (nullie) * Fix crash when you received ssl-encrypted msgs and you don't have ssl.
* Fix valgrind bugs that nullie found (yay!) * Fix bug with '' in the new math parser being NULL instead of empty string * Add support for @#chan via notices to show up in #chan's window
* 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!
* Rework configure mojo for perl, ruby, tcl to autogrok compile stuff. * Run make depend again. * Update the DCC "last time" value regularly.
* 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.
* Use "intmax_t" for dcc byte counts, eliminate notion of "packets". * Use INTMAX_FORMAT to format intmax_t's in printf formats. * Change %D status bar expando to look like "0.1Kb of 2.3Mb" (no packets) * Choke on dcc send offers that don't have file sizes. * Make a feeble attempt to handle 32-bit rollover on dcc get's > 2gb. * Use "intmax_t" for the new math parser, 64 bit int's ahoy! * Use INTMAX_FORMAT to format intmax_t's in new math parser.
* Add /window flush_scrollback, see UPDATES
Round 1 of an attempt to support 64 bit ints without breaking the build for systems with only 32 bit ints (ie, vms). I will phase in support for c99's "intmax_t" and hacks for backwards compatability "soon".
* Improve /dcc get * Fix warnings
Fix /dcc get and remove some debugging info.
Add humanize_number() and fix compiler warnings. more to follow!
Convert some more dcc commands.
Begin the work of "normalizing" the argument handling in /dcc.
GC a bunch of stuff no longer in use.
* Make /xdebug new_math the default, you can /xdebug old_math to go back. * Make /xdebug new_math and /xdebug -new_math no-ops. * Don't do %#p in printf formats, since it has no effect. (%p is better).
Re-fix the bogon for fudd. doh.
Fix bogon for fudd.
I just know this I am going to rue this day... * Add $dccctl(UPDATES_STATUS [0|1]), returns old value * Add $dccctl([SET|GET] <refnum> UPDATES_STATUS [0|1]). * Allow /on ^dcc_activity * # to suppress status bar redrawing.
* Take a new arg to new_open() to control whether INFO -- errors are output. * Don't output the "INFO --" things for dcc or execs
* Round one of blackjac's 'builtins' script. * Comment out a ton of now-scripted sets. Will GC it later.
Fixes from darwin that they "forgot" to submit upstream.
* Change "ERROR --" to "INFO --" to not alarm people as much. * Change a few other warnings to not be so alarming. * Change new_realloc() to not move ptr if it is big enough to hold new size. * Fix all the status_* sub-formats to not have any hardcoded size limits.
Add some debug for tracking lost dcc fd's, no big whoop.
* Fix compile error for #define UNAME_HACK * Fix crash when you do $open(/file/doesnt/exist R) * Add an /on 338 default handler. * Fix integer underflow with log file refnums * Rename STATUS_USER0 to STATUS_USER for backwards compat. oops! * Whack BRACE_LOAD_HACK, it's been unsupported for a while. PF loader rules! * Don't allow /botmode if #define NO_BOTS * Fix DCC connections instantly "timing out"? (Check on this) * Whack FLOATING_POINT_SUPPORT and depend only on /set floating_point_math
* 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.
Fix more bugs.
* 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
* Minor changes to dcc loss processing and the commandqueues script. * Applied Howls shebang patch.
* Fix dcc compile error with --without-ipv6 * Add $windowctl(GET ref TOPLINE num) and $windowctl(GET ref TOPLINES)
* 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.
Changed one trigger of the DCC_LOST hook for files to include the filename as in other calls to the same hook.
* Fix (maybe?) a NULL deref with prepare_display() that hsoc tripped across. * Revert all the regex stuff for /on's -- the idea needs a lot more thoguht. * Convert do_hook()'s algorithm so it's safe to delete /on's from within /on's
* 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.
GC a bunch of useless cruft and stuff.
GC the blocking connect() code, epic is now fully nonblocking connect!
Fix nonblocking connects with /dcc resume.
* Make dcc connections ($connect, /dcc get, /dcc chat) nonblocking * /DCC RESUME is totaly broken by this. Will fix later, maybe ;-) * Add $startupfile(), which returns the epicrc/ircrc file that was loaded * Offer unknown ctcp requests through /on ctcp_request before /on ctcp. * Fix /window level none and other such breakages (adm)
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 ***********
Merge changes from epic4 commits 674 to 692, inclusive.
* 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!
* 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.
Make 'empty_string' (const char []). Now we're cooking with gas!
EPIC5-0.0.1! Huzzah!
Make message_from() work off of a stack; use panics to guard against unmatched message_from()s, and other wackiness.
* 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
* Fix DCC events so that they occur in the context of "no server" (FROMSERV)
rather than the "current server" (NOSERV). This can fix or completely break
certain intermittent scripting problems.
* Fixed {f,}q1cmd in commandqueues so that it works properly in the "no server"
context.
More compiler nits fixed. Nothing worth fretting over.
* Fix raw listen DCCs not obey /SET DCC_TIMEOUT. * Added outputting of long long ints to new math parser.
* Fix /window query, it was a victim of larneproofing. Ooops! (Bugref 6) * Hook in $windowctl(), just for fun for now. * Enclose a few more dcc outputs in the target nick context.
* 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 sanity checking to avoid cross-family dcc problems, where we bind() a listening socket in one family and send out a dcc handshake for another family. Oops! Noticed by rain.
Add /on dcc_activity, a hook for scripters to create a %D-workalike.
* 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.
Make sure message_from() gets called properly before a /dcc chat message.
Nominally allow someone to do: /dcc rename <nick> <file> <absolute path> for example: /dcc rename hop alias.c /usr/home/jnelson/foo/alias.c which acts as a "per-dcc" store path. Normally files are stored in your /set dcc_store_path unless you /dcc rename them to another absolute path. I do not know if I broke anything doing this. Let me know if you see anything odd.
* 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!
Commit 581 * Fix /dcc chat nick -p 4444 * Return empty string if you do $aliasctl(pmatch <bogus> <whatever>) * Update some copyright notices.
Avoid panic if you try to /dcc when not connected to a server.
* 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.
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().
Cut over m_sprintf() to malloc_sprintf().
* Add $dccctl([GET|SET] <refnum> OFFERADDR), the address in the handshake. Larne requested this.
COMMIT 522 Fix bug reported by hsoc.
COMMIT 521
* Fix casts to update_transfer_buffer, so status info is more correct.
* Fix really lame bug that i'm responsible for (/eval echo }{)
* Work around infinite recursion in update_all_windows().
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.
* Fixed two language related leaks. * Added flags for dccctl as in, $dccctl(get [ref] FLAGS).
* 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!
* /set dcc_store_path problem fixed. * $dccctl(get [ref] XXX) where XXX is heldtime or holdtime. * Misc new one liners in script/data_array. These aren't documented in UPDATES and KNOWNBUGS.
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.
* DCC chat fixes as per KNOWNBUGS. * $stat() fixed for tildes. * Misc tabkey.ce cleanups.
* 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.
Hook up /dcc send nick -6 [filename] (ipv6-dcc-send)
Another merge.
Fix a bug with /dcc chat nick -6
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.
Add totaly-experiemental code for ipv6-based dcc. In theory, this should work if you do /dcc chat nick -6 But I haven't tested this and i haven't got any way *to* test it. So if someone tests this and it works, let me know. Or if it doesn't work.
* 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.
* Add extra slop for logically attributed denormalized display strings * Const-ify a few Timevals, just for good measure. * Don't hardcode use of AF_INET in dcc.c, rather use a global variable for it. * Use "global_family" var to pass hint what socket fam to use. AF_INET for now. * Add extra sanity check just in case window->screen goes NULL in status redraw * Fix several benign compile-time issues. * Reword a few previous entries to fit onto one line.
* $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
* CTCP-over-DCC fix. There are some things that confuse me about the inner
workings here, so I'm not sure if this fix was done properly, but I did
a few tests including a DCC send over a SED encrypted DCC and everything
seems to tick over well.
* Unix socket configure tests as per KNOWNBUGS.
* /set flood_ignore defaulted to off.
* Tuned commandqueues.
* The 324 hook is now called for joins as well.
* %{1}D status setting as per UPDATES.
* DCC hold mode as per UPDATES.
* "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.
Commit 443 * Uniformly use 32 bit file sizes in dcc. That's the way it has to be. * Split process_incoming_chat into modular functions. It's an experiment. * Remove the old, #if 0'd dcc_getfile_resume. * Remove the second, redundant warning from /window refnum(_or_swap). * Make the ArgList portion of server messages const. All const! Huzzah! * Roll /names, /list, and /mode numeric handlers into numbers.c * Roll "funny" global variables into server-specific variables * Nuke funny.c and funny.h -- huzzah! * /on window_kill provides two args now, $0 is refnum, $1 is name/refnum. * Rename "numeric_banner" to "banner" * Rename "parse_notice" to "p_notice" * In /xecho, rename 'banner' local var to 'want_banner'. * Revamp p_notice to look like and act like p_privmsg as much as possible. * Finish the rest of the larnifications. Done with phase 1. Huzzah!
Commit 436 This commit is deceptive because it is huge in scope but can be explained pretty simply. * Const correctness improvements. * Invert the meaning of 'new_check_flooding' to return TRUE if flooding. * Revamp funny.c, /list, /names, /mode reply handling. * Remove unused joined_nick, public_nick * Change got_initial_version_28() arguments singly and not an array * Change signature of protocol handling to take "command" as an argument * The above change cascades to a lot of other changes. * Allow the /msg'ing of @W<refnum> to msg a window's refnum. * First round of larnification (Protection against unexpected server data) * This involved substantial rewrites of parse.c, and numbers.c * Now "fake" stuff goes through /on odd_server_stuff. * Fix /on invite so it takes 3 arguments, not 2.
* 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.
* Cleaned /dcc get and /dcc resume up a little.
* Merged them so they basically have the same "feel".
* /dcc resume no longer has the "-e passwd" flag, which shouldn't
matter much, because the underlying functionality was never present.
* Neither will automatically bail out on error anymore. If you have a
(local) error, fix the problem and try the dcc command again. I
haven't touched the network end of this yet. Later maybe.
* "/dcc resume *" will only attempt to resume the first waiting
dcc whereas get will attempt to open all waiting dccs.
* resume will bail to get if there is no file to resume.
* Fixed the bug mentioned in my last commit (dcc send breakage).
* Fixed a problem in which dccs failed when dcc_store_path was set. * _Didn't_ fix some other general dcc wonkiness. * DCC sometimes failing to end on completion. * File size always seems to be 129MB.
* 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().