2004-03-08 Joachim Nilsson * NEWS: Cleanup. * TODO: Note on how --debug should imply --verbose. * src/process.c (process): Cleanup and add more logging, all in favour of new logging scheme. * src/main.c (main): New command line option, -d, --debug. In favour of this and the new logging stuff verbose level adjusted accordingly. * src/log.c (write_message): New function for console logs. (write_logfile): Renamed and added log level propagation from macros in include/log.h. * src/http.c (http_open_server): Most of the logging has been redone in favour of major overhaul. (http_pre_login): dito. (http_internet_login): dito. (http_internet_logout): dito. (http_do_login): dito. * src/daemon.c (daemon_thread): Most of the logging has been redone in favour of major overhaul. * src/config.c (config_load): Most of the logging has been redone in favour of major overhaul. * lib/conf/tokens.l: Now use YYDEBUG instead of DEBUG. * lib/conf/parser.y: Now use YYDEBUG instead of DEBUG. * include/log.h (DEBUG): New macro, replaces #ifdef DEBUG. Also, in line with a major overhaul of the logging functionality most of the code in here has been rewritten. * include/config.h: Hand down verbosity... * configure.in: --enable-debug now don't define DEBUG anymore, that is now handled natively by qadsl. Instead define YYDEBUG. 2004-03-04 Joachim Nilsson * TODO: Remove obsolete entries that have become NEWS. * NEWS: Update for upcoming release. * AUTHORS (Debianization): Include yours truly for current releases. * configure.in: Add -D_GNU_SOURCE to CFLAGS so that we activate the full API on GLibC platforms. Otherwise we get missing protos for strdup() and friends. See for more details. * lib/Makefile.am (CLEANFILES): Make sure that "make clean" also cleans out these generated files. * src/daemon.c (daemon_sighandler): Cleanup logs. (daemon_thread): Cleanup logs and add important stage change log. * src/http.c (http_do_login): Cleanup double brain damage induced by duplicated calls to http_internet_login(). (http_internet_login): Always zero terminate the config->get_msg string. Also, test if already logged in and add more LOGs. * debian/control (Description): Bogus format of description fixed. 2004-03-03 Joachim Nilsson * include/settings.h.in: Add features.h to list of headers to look for, we need it. * include/config.h: Add features.h it defines a lot of stuff we really need to eliminate stupid missing declarations from standard include files. * configure.in: Bump version again, 1.3.3 Add features.h to list of headers to look for, we need it. * debian/changelog: Prepare for next release, 1.3.3. * debian/control (Description): Synchronized with .rpm package. * qadsl.spec.in (%decription): Synchronized with .deb package. * src/lock.c: Update copyright and cleanup function comment. * src/config.c: Add copyrights and licensing. * src/process.c: Add copyrights and licensing. And cleanup the "logged in" semantics according to new scheme. * src/main.c: Update copyright and email. (main): Stupid misplaced else ... (main): Implement HAVE_RINDEX * lib/conf/conf.c: Add copyrights and licensing. * lib/conf/parser.y: Add copyrights and licensing. * lib/conf/tokens.l: Add copyrights and licensing. * src/log.c (write_log): Need to increase size of static log buffer. Also, add copyrights and licensing. * include/http.h (http_open_server): No longer global function, thus removed from this file. (PRELOGIN_MSG): Cleanup and use HTTP 0.9 (LOGIN_MSG): Cleanup and use HTTP 0.9 (LOGOUT_MSG): Cleanup and use HTTP 0.9 (http_test_if_logged_out): New static inline function. (http_test_if_logged_in): New static inline function. * src/daemon.c: Update copyright and email addresses. (daemon_thread): All connections should be closed by the handlers in http.c. No need to close() in daemon since it is supposed to be stupid. Also, cleanup of "already logged in?" semantics. * src/http.c: Add copyright and licensing. Also, overhauled the file in search for missing close() calls. A heads up from the Mandrake RPM maintainer, Oden Eriksson . (http_open_server): Close socket if connection fails. Document the (now local) function as well. (http_pre_login): Cleanup verbosity. (http_internet_login): Cleanup and close() the socket on error. (http_internet_logout): Cleanup and close() the socket on error. (http_do_login): Renamed from http_log_login(). Check if we're really logged in when http_internet_login() returns OK. Also, a lot of clean up of the semantics plus useful documentation. :-) 2004-02-22 Joachim Nilsson * lib/getopt.c: New functionality that adds GNU getopt() and getopt_long() support for platforms that do not have it. * lib/getopt1.c: dito. * include/getopt.h: dito. * include/daemon.h (daemon_kill): Add verbsity to prototype. * include/log.h: Define log types. * lib/conf/parser.y (conf_set): Use log() macro instead of fprintf(). * lib/conf/tokens.l: Cleanup. * lib/conf/conf.c (conf_read_file): We only need read permission to evaluate the .conf file. Also, make sure to check if we succeed in opening it, otherwise the parser will not have anything to read from and hang forever waiting for input from a truncated stdin. * src/daemon.c (daemon_thread): Let the verbosity level from the client propagate to the daemon and increase the verbosity of the latter in the logfile. * src/http.c (http_log_login): Keep track of when we are no longer logged in so that we can take note of all state changes in the logfile. * src/lock.c (lock_read): Truncate already existing pid file and make sure it is world readable, the PID is not secret. * src/main.c (main): Add long option support and update usage() function. Exit on NOP operations with a usage() printout. Swap meanings of -v and -V to verbose and version, respectively. To be more like the majority of the other GNU tools. * src/process.c (process): Let verbosity propagate to dameon and report result from SIGHUP sent to an already running daemon. 2004-02-20 Joachim Nilsson * lib/conf/conf.c (conf_read_file): Does not work with yacc, revert while we wait for libconf to become reentrant. (conf_set_value): dito. * lib/conf/parser.y (conf_set): dito. 2004-02-18 Joachim Nilsson * src/http.c: Cleaned up namespace mess. All functions now have the http_ prefix. * include/http.h: dito. * src/process.c (process): Updated to match new namepace of http.c * src/daemon.c (daemon_thread): dito. 2004-02-17 Joachim Nilsson * etc/qadsl.conf (INTERVAL): Reduce default sleep interval from 20 to 5 to alleviate against buggy login servers. * src/config.c: Reduce default sleep interval between logins to reduce possible long periods of being disconnected. * src/process.c (process): Call kill() directly instead of unecessary wrapper functions. * configure.in: Up version number after todays 1.3.2 release, new intermediate version is 1.3.3-pre1. * src/daemon.c (daemon_kill): Remove stupid wrapper fn. * include/config.h: Beginnings of support for HP-UX. * lib/conf/conf.c (conf_read_file): Try using older method of redirectng stdin to make qadsl build properly on, at least, NetBSD. Idea from redirect.c on snippets.org. * configure.in: We want strcasecmp() if not found we use our replacement from -lost. Check for existance of c99 or gnu99 flags to compiler iff compiler==GCC. Also, remove default -O2 that autoconf insists on putting in there. * lib/Makefile.am (libost_a_SOURCES): New library for stuff not on the current platform, lost. Hence the name -lost. * lib/strcasecmp.c (strcasecmp): New file, imported from fetchmail-6.2.4. 2004-02-16 Joachim Nilsson * configure.in: Bump verion number. * lib/conf/parser.y (log): Add neat log functionality that can be turned on with -DDEBUG, --enable-debug. * src/config.c (config_load): Don't continue if conf_read_file() fails. * lib/conf/tokens.l: Clean up mess when values inside "". (log): Add neat log functionality that can be turned on with -DDEBUG, --enable-debug. Also, fix missing stuff for "lexer in lexer" while parsing values included in ""'s. * lib/conf/conf.c (strlndup): Don't overwrite last character of string with NUL. Also, make sure we don't try to copy NULL strings. (conf_set_value): len decremented too much. Make sure to check for sane values of len before decrementing it. Also, we cannot free value if value has been tampered with, so we save value in orig_value and free it instead. (conf_read_file): Remove unnecessary yyin, using stdin instead. Plus minor formatting cleanups. 2004-02-10 Joachim Nilsson * lib/conf/conf.c: Add unistd.h, dup() needs it. * lib/conf/parser.y: Temporarily revert to non-reentrant yylineno behaviour to be able to build on cygwin. 2004-02-09 Joachim Nilsson * lib/conf/conf.c (strlndup): Renamed copy_string() to strlndup(). (strlncpy): New (still unused) function to replace dangerous strcpy(). 2004-01-31 Joachim Nilsson * qadsl.spec.in: Update. * qadsl.lsm.in: Update. * src/config.c: Update aliases of parameter list and re-add "NULL"-termination of list, libconf needed it to not traverse into infinity. * lib/conf/conf.c (conf_find_key): Fix major bug where a parameter_list could be traversed into infinity w/o finding the end of the list, even when the list was terminated. * lib/conf/conf.c: First effort at making libconf reentrant. * lib/conf/parser.y: dito * lib/conf/tokens.lo: dito * etc/qadsl.conf: Cleanup to comply with specifications in src/config.c. Also, fix email address. 2004-01-20 Joachim Nilsson * src/daemon.c (daemon_thread): Major cleanups. Make sure we exit the daemon if we cannot create any lockfile - this to prevent multiple daemons starting up. Check if we're already logged in after pre_login() stage, then we do not need to call log_login(). * src/main.c (main): Fix bogus comment. * src/config.c: LOGIN_STRING_HEADER default to NULL instead of "". fallback_pid_files[] temporarily stored here. Need a better place, not in lock.c though - it is supposed to be agnostic of the file name. * src/http.c (internet_login): login_string_header might be NULL, do not call strlen() with NULL. Do not compose a login string of empty parts it might generate very bisarre strings, e.g., "?one=1&&three=3&four=4". Bogus if() statement checked the wrong pointer, temp instead of login_string. Skip url_encode() for now. Zero-terminate the read message from the server, needed for parsing later to determine if login was successful or not. Just return, leave avalutation of result to caller. (log_login): Skip internet_login() if pre_login() reveals that we're already logged in. * src/http.c (url_encode): strchr(unsave, s[i]) should suffice as the filter to find characters that must be encoded. Otherwise too much is encoded and the resulting string is too long and might not be possible to parse for the server. * src/process.c (process): Cleanup. Everything now done in the same switch-case, it might be better. However, fns like process_login() and process_logout() might be even better. lock_read() and lock_remove() should use whatever main() found out and stored in config->pid_file instead of PID_FILE! * src/lock.c (lock_create): Added fallback_pid_files[] and minor cleanups. The function will alter the @file argument if a fallback is used instead of the given one. (lock_read): dito. A return value >0 is an OK pid. 2004-01-14 Joachim Nilsson * debian: Added Debian package directory. 2004-01-11 Joachim Nilsson * .: Cleanups and final tests for release 1.3.0 This release will be the first with the new code base - to be followed by continous new features. 2003-07-06 Joachim Nilsson * qadsl: initial version.