CVS log for epic4/source/dcc.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 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 two 64-bit pointer errors (one in dcc.c, and one in who.c) * Fix refresh_a_screen() to not pass NULL to recalculate_windows(). (reported by cshepherd, thanks!)
Fix many errors using realpath() and normalize_filename().
Fix brain-o.
Don't normalize filenames given by /dcc send <nick> <filename>, and if access() fails, say it doesn't exist or can't be read.
Fixed a thinko with the last DCC fix.
Pulled the old dcc quoted space resume hijinks out due to bugs, and tried a new approach. I tested that it works for normal files. Perhaps some kind person can test it for spaces.
* 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.
Miscelaneous fixes and features as per UPDATES and KNOWNBUGS.
* 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().
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.
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.
Moderate code layout cleanup in dcc.c Don't arbitrarily restrict DCC handshakes to IPv4. Getting closer to supporting DCC-over-IPv6!
Add nominal support for generating IPV6 dcc handshakes in the handshake generator. Please note that we still don't have any way to actually create an IPv6 DCC connection with which to generate a handshake, so this doesn't mean as much as it might appear.
* Add Getnameinfo(), front end to getnameinfo() takes GNI_INTEGER for DCC use * Fix inet_ntostr() to use Getnameinfo() instead of getnameinfo() directly. * Fix inet_ntostr() to return int for success/failure, not hostname. * Fix the DCC handshake generator to use inet_ntostr(). * Fix callers of inet_ntostr() to handle integer return values.
* Allow $listen() to take a family argument, like $connect(). * Add some V6 macros in ircaux.h, modeled after V4 macros. * Add a "family" member to the dcc structure. Default to AF_INET for now. * Start fetching ports by calling inet_ntostr() instead of peeking directly -- into the sockaddr. This yields protocol independance. * Fix bug where $listen() or /dcc send w/o a virtual host caused NULL deref.
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.
Oh, nothing important, just make $connect() support ipv6. ;-)
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().
OK. So i had some inspiration and decided not to go to bed. Vastly simplify the conversions between sockaddr/host/p-addr to sockaddr/host/p-addr. More simplifications yet to come. IPv6 support is roughly about 50% done now.
Huge major commit #1 in the great IPv6 support addition... Rather than include all of the changes here, read KNOWNBUGS changes.
* Add the rest of the stuff as an extra arg to register_dcc_offer. register_dcc_offer is _such_ a hack. * Add a new data item to the DCC struct, a item-specific callback when the connect()ion is established. This is for forward comaptability. We still do our connect()ions psuedo-blocking but some day we won't. This is always NULL for now. * Create a function dcc_opened() which is called whenever a connect()ion on any dcc is established. This is basically the last half of dcc_open(). * Revamp dcc_open() to use dcc_opened(). * dcc_open() now returns -1 on error and 0 on success. Change all callers to this new return value. * The error value if a connect() on a unix domain socket failed is -1 (system error) not -9 (connection timed out) * Add support for Connect()ing to a unix domain socket. UDS servers work again. All of this pretty much leaves epic in pretty good shape after the great cleanup. Unless something major comes along, we'll test and then i'll roll out epic4-1.1.4 and then we can go forward with ipv6 from there.
Fix rather obvious typo with $listen(). Reported by fudd.
Functionally complete the protocol independance of DCC. There are no more ISA's in server code or dcc. To phrase that differently, every IPv4 assumption in the server code or dcc has been identified and conditionalized. Adding support for ipv6 is now simply a matter of adding the conditionals to make it happen. Now we need to test what we have here and see how badly i've broken things. The only remaining IPv4 customers are /WINDOW CREATE (which is likely to stay ipv4 only for the time being) and $iptolong() and $longtoip() which clearly are IPv4 only concepts.
Move the transition macros into ircaux.h. Migrate the server over into protocol independance. That was pretty painless. If you're reading this with rapt attention, please understand that 'protocol independance' does not mean "multi-protocol support". What it means is that instead of using (struct sockaddr_in)s, we're using (struct sockaddr_storage)s, and we conditionalize all IPv4 specific code to work only on (struct sockaddr_storage)s whose family has been set to AF_INET (ipv4). Once total protocol independance has been acheived, adding support for IPv6 will be a matter of adding conditionals to handle it in the same manner IPv4 is already supported. So the current project i'm working on is the protocol independance of epic. Multi-protocol support comes later.
Make $connect() protocol independant. This requires changing dcc->offer to a (struct sockaddr_storage) and requires changing dcc_open and even register_dcc_offer. Much progress being made on the protocol-independance of DCC. Somehow I doubt IPv6 will ever come to DCC, but it's nice to at least say that we'll be prepared when it comes...
Fixes inspired by first wave of testers 1) Fix casts to inet_anytop() 2) Fix configure to check for socklen_t, default to 'int'.
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!
The last round of changes for tonight. More of the same... I promise! I'll document the user visible parts of this soon! Really! =) I mean it!
Yet more changes! =) -- Collapse "read" and "write" variables in the DCC object to a single variable "socket" which points to our internet peer. Much simpler! -- Nuke the now unused "struct in_addr local_addr;" Huzzah! -- Fix a printf() format bug that caused the ports in dcc handshakes to always come out as 0. -- Convert unecessary uses of gethostbyname() to inet_anyton() to catch the optimization break for dotted-quads. -- Do direct assignments, not memmove()s of (struct in_addr)'s. -- Add future gracious (non-)support for colon-notation IPv6 addresses in DCC handshakes. -- Fix the "dcc handshake sanity checker" to not be quite so lame. -- Fix a bug where some $channel() may return % before some users if their "halfop" status is -1, instead of only when it's 1. Hunted by adm, fix from paladin. -- Add error checking for some calls to inet_aton(). Need more error checking!
Milestone #1 -- /DCC's now honor /HOSTNAME immediately! Maybe I should rephrase this -- /DCC's always honored /hostname immediately, but the dcc handshake would use the IP address of the server connection that we were going to send the handshake by. Since it's possible that you used /HOSTNAME to bind the /DCC to another address, whatever we sent in the handshake was invalid. This change at long last remedies that.
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.
Have 'configure' check for the worthiness of SNDLOWAT setsockopt option so that the linux users stop griping to me that they don't like to see the error message that linux's braindamage causes.
Fix bug with kb/s not showing up in /DCC LIST for /DCC GETs.
Honor dcc->local_port if it is provided (by the user)
* 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.
Fix register_dcc_offer so that when trying to determine if a file exists or not, it honors the /set dcc_store_path setting. This prevents otherwise spurious warnings, and does help the user avoid clobbering a file.
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.
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.
* 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.
Remove the broken and undesirable and much loathed and hated "dcc checksum" misfeature a good bit ahead of schedule. Good riddance.
Initial import into CVS
Initial revision
| CVS Admin |
Powered by ViewCVS 0.9.2 |