CVS log for epic4/include/server.h |
![]() |
Request diff between arbitrary revisions
* Implement "unique id" support for ircnet (042 numeric) * You can /nick 0 or /nick <unique_id> * You can use $servertctl([SET|GET] <refnum> UNIQUE_ID)
Fix some issues with $numlines()
Clean up after the server lists upon exit, for valgrind users.
* 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!
Another merge.
* Move add_user_who, add_user_end from parse.c to numbers.c * Add (set|get)_server_max_cached_chan_size(), max chan size for u@h caching. * Add $serverctl(SET|GET <refnum> MAXCACHESIZE), largest channel we do WHO for. * Move 'whobase' call from /on join to /on 324. * Don't call 'whobase' (userhost caching) if too many users on channel.
* 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.
* $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
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.
Fix all the rest of the compile issues. bleh.
* 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...
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.
* Remove /set suppress_server_motd which didn't really work anyways. * Add function decls for bsd_arc4* to ircaux.c * Always check (window->hold_mode || window->autohold) together! * Unhold_window()s only if both hold_mode and autohold are off! * unhold_window()s instead of doing scrollback_end for robustness. * Attempt to recover from the "output is below bottom of window" bug, whine.
Ach. Here goes nothing. Major commit which does many things, but the most prominent of which is the final integration of the scrollback buffer with the hold buffer. This fixes several annoying "features" and introduces a small truckload of new features which have been requested recently. Please see the KNOWNBUGS or UPDATES file for more info, since I don't want this message to be ridiculously long.
* Added support for CHANMODES, PREFIX and CHANTYPES in the processing of modes. If the server doesn't support these, then hopefuly sane default strings are chosen, and these _don't_ include the wacky extensions that have been added over the years, so conceivably, this could break things like halfops and ban/invite exemptions. * Stored the UMODES field from the 004 numeric in the server data. Can be retrieved with $serverctl(get x umodes). * Altered "/msg @$fd" so that $fd must be a number, otherwise, it will be treated as a privmsg. * Added $xdebug() which returns all single bit flags with + or - added as appropriate. /xdebug $xdebug() is a no-op. * Fixed an /xdebug bug in which - would cause all subsequent flags to be switched off. For bug compatibility, it still works this way, but you can specify + to turn all subsequent values on. * Altered m_sc3cat_s() to call m_sc3cat rather than m_c3cat, which results in a cleaner string. Examination of the uses of this function showed that they all dealt with this bug in some way. * Altered $which() to call path_search() directly, rather than uzfopen(). It may be useful to add a flag to path_search indicating which attributes we are searching for. This could cause problems since the old method would skip over a file if it wasn't readable. * Added clue variables for $unsplit().
* Added 005 framework. The internal interfaces to this are get_server_005() and set_server_005(). The scripting interface is $serverctl([gs]et [ref] 005 [set] [[value]]). Unsetting is done by setting a null value, and $serverctl(..set..) will return 1 for set or 0 for unset. All values are reset upon successful reconnect. * Altered $rand() to be more conservative when drawing on the random data source. It should be faster for lower max-values now. * Altered $splice() somehow. I think it was for the clue variables. It didn't improve the speed due to other problems, but it still works.
* Fix parse_server_info() to properly handle ipv6 p-addrs * Add support for [<ipv6 p-addr>] to parse_server_info(). * Fix an off-by-one error in Getaddrinfo. Bleh. * Fix a malloc() size mistake in Getaddrinfo.
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.
Nuke "local_addr" in server struct in favor of "local_sockname" Convert server to use "connectory" Convert wserv to use "connectory" Nuke connect_by_number() Reorder functions in network.c
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!
* Applied Ay-Ars patch (with a few modifications) which fully melds ssl into the server spec, which is now server:port:pass:nick:group:proto where proto currently is "irc" or "irc-ssl". * Removed -ssl flags from "/window server" and /server. * Ay-Ars patch also includes a new function, $servertype() which returns the proto field by way of extrapolation, (it is not the exact text entered into that field). * Entering a server spec in a /server or "/window server" that currently exists, but which has different additional field values normally alters the current spec to conform to the new spec. This doesn't work with the proto field. This is probably a bug. I am somewhat uncomfortable with all of this. I would like to alter add_to_server_list to be the one true reference for decoding the server spec and simplify the other functions to only breaking it into server, port and "additional". This may be too big a change currently.
Bulk commit:
1) Fix typos in KNOWNBUGS
2) Flesh out the things in UPDATES that need documenting
3) Add target_file_write() to files.[ch] for send_text()'s use.
4) Create "reg.h", to hold protos for reg.c
5) Add some missing protos.
6) If /redirect'ing to 0 or to @<fd>, don't output to the screen.
7) Messages sent to target 0 are dropped (/redirect 0 now actually sends
to target 0, and epic drops it.) You can /query 0 now if you want.
8) Messages sent to @NUMBER get sent to the NUMBER file, where NUMBER is
returned by $open(). For example, to paste stuff to log but not to screen:
@fd = open(FILE w)
query @$fd
<paste some stuff>
query
@close($fd)
or
@fd = open(FILE w)
redirect @$fd lastlog foo
@close($fd)
9) Add a function to reg.c to compile a pattern into a regex -- experimental.
10) Fix some compile warnings regarding ssl.
Applied the SSL patch from ay-ar. Details are in README.SSL. This works well at this point, but there may be teething problems.
* 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.
Implement the "redirect sink", which instead of sending all output to another irc server, drops the output entirely. This is used by /flush (which is now safe to use again) and can be used by the user via /redirect 0 to execute a server query but suppress it's output.
Oh you didn't know? Server groups, try one!
It would help if i commited the header file changes. d'uh!
Commit #47
* /window server resets the "reconnect attempt" counter ala /server
* /for i in <pattern> {...} now reserved, and emits an error.
* "make depend" done again.
* "my_next_expr" revamped, extra argument added
* "next_expr_with_type" like "next_expr" but first char is "type".
* The /for i in (list) and /for i from x to y commands now use the
above cruft.
* This is epic4-0.9.16-10
* "break_args" now uses "next_expr_with_type"
* "do_log" should use localtime(3) and not gmtime(3), duh.
* "clear_reconnect_counts" is now an extern function from server.c
Roll get_connected() into reconnect() and abolish all uses of get_connected(). Things are starting to look good here!
Argh!
Fix some "issues" with compilation.
Stage 2 -- what am i getting into? This is the second stage of the server connection closed coping mechanism. This will be tested, bugs may ensue!
Initial import into CVS
Initial revision
| CVS Admin |
Powered by ViewCVS 0.9.2 |