32 Commits

Author SHA1 Message Date
Kevin Easton
e51469568e Update command-line help text to explain server descriptions
Makes it clear that a each server can also specify port/password/nick/network if desired.

Reported by Ant.
2018-11-14 13:17:48 +11:00
Kevin Easton
cdf53cbf86 Change switch_help from array of strings to plain string 2017-12-01 23:42:26 +11:00
Kevin Easton
035063abce Add BITCHXRC_NAME to config.h
(instead of hardcoding it in irc.c).  Simplify setting of ircrc_file and bircrc_file.

Use IRCRC_NAME and BITCHXRC_NAME in help strings.
2017-12-01 23:33:13 +11:00
Kevin Easton
973ae0e4da Correctly handle case when a nick comes between a -s flag and a server name on the command line
The -s flag resets after the next server on the command line, but it was also incorrectly resetting
if a nickname was seen as well. This meant that a command line like this failed to use SSL:

BitchX -s -p 9999 gauze irc.choopa.net

Also update the help text to correctly reflect the operation of the -s flag.

Reported by gauze.
2017-12-01 23:05:58 +11:00
Kevin Easton
7a36be1c47 Only declare variable hp in parse_args() when !IPV6
Squashes an unused variable warning.
2017-11-30 00:01:30 +11:00
gdinit
bac141898b Correct spelling of some client messages, comments and function names 2017-10-20 14:57:17 +11:00
Kevin Easton
05633c9bc3 Consistently use SIGNAL_HANDLER() macro to define signal handler functions
With this change, the signal handler signature is defined in only one place.

Also make most signal handler functions static (those that are only referred to in irc.c).
2017-08-22 22:48:06 +10:00
Kevin Easton
492d5658d1 Simplify handling of /DETACH socket path
init_socketpath() was building a sprintf() format string intended to be used by /DETACH to create the socket
file name.  This included the actual socket path, plus a %d for the port, plus the sanitised tty name and
hostname.

Only one caller needed all this though - the /DETACH command - and the other callers (in scr-bx.c) just
wanted to truncate it to the actual socket path.  The format string also wasn't safe - if the home directory
path, hostname or ttyname contained % characters these werent being escaped.

It simplifies things to have init_socketpath() just return the actual socket path, after creating the 'screens'
directory if necessary.  This lets the code in scr-bx.c use it as-is, and removes the need for the global
socket_path variable.  The code to include the sanitised tty name and hostname in the socket file name can
be moved to the create_ipc_socket() function.

There's no need to check access() for the socket path before trying to create it - just call mkdir() regardless,
since it will fail if the path already exists, which is fine.

This commit also adds error handling to the create_ipc_socket() function for the case where creation of the
socket file fails, and switches the chmod() and chown() for the opened file to the more appropriate fchmod()
and fchown().
2017-05-03 00:13:24 +10:00
Kevin Easton
2fa0bf818a Replace uses of HAVE_SSL with HAVE_LIBSSL
autoconf's AC_CHECK_LIB automatically sets HAVE_LIBSSL, whereas HAVE_SSL has to be set manually.

This prepares us to remove some code from configure.
2017-03-17 00:07:38 +11:00
Kevin Easton
a0e8bd5742 Cast pid_t to long for fprintf()
pid_t is defined by POSIX to be a signed integer type, so the %u format is wrong.

Cast to long and print with %ld - it is unlikely that any real-world system has pid_t bigger than long.
2017-02-17 16:50:41 +11:00
Kevin Easton
d464bd91fb Remove unnecessary inclusions of <numbers.h>
Functions display_msg() and check_sync() are only used in numbers.c, so they
can be static.

Remove inclusions of <numbers.h> from .c files that don't need it.
2016-03-24 11:21:09 +11:00
Kevin Easton
c2a2d68d8d Only show version once with -v command line option
Reported by cpet.
2016-02-24 17:23:38 +11:00
Kevin Easton
6dbc712046 Rework and improve the scheduling of the server lag check
Previously the server lag check was run by update_clock() if the number of
seconds since client startup was a multiple of 20 (unless it had already been
done this second).  This meant that if update_clock() was not being called
frequently (eg. if your IRC connection was very quiet), it might go a long
time between lag checks.

This commit adds a /set LAG_CHECK_INTERVAL (defaulting to 30).  For each
server, a lag check ping is scheduled for every LAG_CHECK_INTERVAL seconds
after the connection is finalised/registered.  Setting this value to 0
disables the lag check pings entirely.

The old code set the lag to 'unknown' immediately after sending out a ping,
which meant that it was quite unpredictable how long the lag value would
stay around for.  The new code only sets this once the current lag value
has become stale (ie. a ping reply is overdue based on the current lag
value).  If your lag is staying the same or reducing, you shouldn't see
the [Lag ??] at all.
2015-06-12 15:54:43 +10:00
Kevin Easton
c0c7cdbdcc Rework the calculation of the select timeout in io() to be based on absolute wake time
An absolute wake time is now calculated and updated by set_server_bits(),
TimerTimeout() and tclTimerTimeout().  This is then used to calculate the actual
select() timeout, instead of having those functions calculate a relative timeout
value themselves.  This significantly simplifies those functions, since the
underlying values tend to be recorded as absolute times.

It also allows us to disentangle tclTimeTimeout from TimerTimeout(), and move the
responsibility for calculating the QUEUE_SENDS wake time from TimerTimeout() to
set_server_bits() where it belongs.

The QUEUE_SENDS and CONNECT_DELAY wake up times will also now be correctly
calculated, based on the last sent time and connect time respectively.
2015-06-07 00:03:09 +10:00
Kevin Easton
0f8280ed51 Prevent indefinite wait if CONNECT_DELAY is set to zero
set_server_bits() now returns -1 for "no timeout", so 0 is a legitimate
return value.

io() should only update real_timeout from server_timeout if server_timeout
is not -1 (real_timeout == -1 ends up meaning "wait indefinitely").

Note that if you set CONNECT_DELAY to zero you get a lag check ping sent off
first thing in the server connection, this should be fixed.
2015-05-12 22:39:30 +10:00
Kevin Easton
3b80790a31 Define VERSION in configure, and add git describe output if available.
The client release version is now defined in configure.in rather than
source/irc.c.  The gitversion.sh script is used to automatically add a
suffix to the version number for versions of the client built from git.

Also removed AC_REVISION() from configure.in, because $Revision$ doesn't
make sense with git.
2015-03-16 23:04:43 +11:00
Kevin Easton
aab85f807a Update version number to 1.2.1 in preparation for release.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@537 13b04d17-f746-0410-82c6-800466cd88b0
2014-11-14 10:42:09 +00:00
Kevin Easton
58b5d39fea Remove unnecessary variable proctitlestr.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@462 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-13 11:43:57 +00:00
Tim Cava
78265498b1 Convert sprintf calls to snprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@446 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-11 21:23:51 +00:00
Tim Cava
112b38ac7a Revert the last commit. It accidentally had autogenerated files in it.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@432 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 03:00:24 +00:00
Tim Cava
276fd24258 Use snprintf rather than sprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@431 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 02:41:16 +00:00
Kevin Easton
a6f8021cd9 Fix a couple of compiler warnings in irc.c - two places where the address
of an array was tested (always not-NULL) and one unused variable (first_time
in io()).

The user-visible change here is that the emergency exit QUIT messages 
(eg "User abort with 5 Ctrl-C's") will be correctly relayed to the local 
terminal now.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@321 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-14 14:39:24 +00:00
Kevin Easton
4a25f5462f Simplify code that produces realname from gecos, replace strmcat() with strlcat().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@319 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-14 09:32:33 +00:00
Tim Cava
74f8a720c4 Use strchr, rather than index, which is a legacy function. From caf.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@318 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-14 07:22:32 +00:00
Tim Cava
c0bc9294cd Use strlcpy, rather than strmcpy, in parse_args().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@317 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-14 07:01:30 +00:00
Kevin Easton
d22a4531d8 Update old email addresses in user-visible messages.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@206 13b04d17-f746-0410-82c6-800466cd88b0
2012-06-13 12:34:32 +00:00
Kevin Easton
87f24694b9 Remove unnecessary ns_init() function.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@149 13b04d17-f746-0410-82c6-800466cd88b0
2012-02-10 11:22:14 +00:00
Kevin Easton
d6c105861c Fix auto-away time strangeness when server reconnection happens.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@94 13b04d17-f746-0410-82c6-800466cd88b0
2010-09-05 08:37:04 +00:00
Tim Cava
a72091bb0e Fix the -z command line option and the use of the IRCUSER environment variable.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@93 13b04d17-f746-0410-82c6-800466cd88b0
2010-07-30 09:52:17 +00:00
Kevin Easton
7eac4a00ce Roll version number for BitchX 1.2 series.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@25 13b04d17-f746-0410-82c6-800466cd88b0
2008-04-30 13:52:22 +00:00
Kevin Easton
533c3dbcbf Turn on SVN keyword replacement for $Date$, $Author$, $Revision$, $Id$ for all
*.c and *.h files.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/branches/ircii-pana-1.1@3 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:49:14 +00:00
Kevin Easton
28febcfea9 Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:25:32 +00:00