Dave West [Sun, 23 Dec 2007 14:56:45 +0000 (14:56 +0000)]
Moved all threading code into threads.c
Slight alteration to worker thread startup code.
Altered the order of the shutdown so that we shutdown the modules and
the ports before closing the database. I'm curious about the remaining
locks in the data base after shutdown.
Still to come.
Wrappers for the pthread calls so that they can return to sysdep.c (the
portability file).
Further speed improvements.
Module to get thread data for user display.
Art Cancro [Wed, 12 Dec 2007 03:58:05 +0000 (03:58 +0000)]
Calendar system now handles invitations and rsvp's
using the MIME type 'application/ics' as well as the conventional
'text/calendar'. As a result, it now smoothly interoperates with
systems such as Google Calendar.
* give the flag to the CtdlDoIHavePermissionToPostInThisRoom in through the parameters of validate_recipients.
dict_tcp flags it CHECK_EXISTANCE;
serv_smtp flags it POST_EXTERNAL / POST_LOGGED_IN depending on user state. (logged in users may post to public rooms if they have write permission)
Art Cancro [Sun, 9 Dec 2007 04:31:24 +0000 (04:31 +0000)]
IMAP server: suppress untagged 'EXISTS' and 'EXPUNGE' responses
if the client just transmitted a command containing a literal.
Buggy IMAP implementations choke on this even though it is legal.
This is an attempt to fix Bug #308.
Dave West [Fri, 7 Dec 2007 15:09:20 +0000 (15:09 +0000)]
Hunting a bug in scheduled threads that caused a segflt. Got it and
squished it. We needed to clear next and prev before linking the
scheduled thread onto the running thread list.
Dave West [Thu, 6 Dec 2007 22:44:34 +0000 (22:44 +0000)]
Added the functions to allow scheduling of a thread to start at some
time in the future.
Fixed a bug in garbage collection that caused a corrupted thread list
when unlinking dead threads.
Fixed a bug in context_cleanup, the ContextList needed to be updated on
each pass since a module may try to iterate the list as a result of the
event triggerred here.
Art Cancro [Thu, 6 Dec 2007 05:11:05 +0000 (05:11 +0000)]
Began (but did not complete) implementation
of XEP-0078 - non-SASL authentication for Jabber sessions.
This is a deprecated protocol but some clients (such as
CenterIM) still seem to use it.
Dave West [Wed, 5 Dec 2007 21:03:04 +0000 (21:03 +0000)]
Prevent the creation of new threads if system load climbs at shutdown
time.
Also turn signals back on for threads. For some reason we occasionally
crash on the shutdown but enabling signals in the threads seems to stop
this????? Also ecrash needs the signals turned on.
Dave West [Wed, 5 Dec 2007 20:17:22 +0000 (20:17 +0000)]
Changed the way we do the TSD area.
Now this code is in sysdep.c
Added an element to the TSD to store a pointer to this threads control
structure. This allows a speed up in CtdlThreadSleep(),
CtdlThreadCheckStop() and the odd one or two other places since this
thread no longer needs to search the list of threads to find its own
control ctructure.
Dave West [Tue, 4 Dec 2007 17:10:32 +0000 (17:10 +0000)]
Changed the way we name threads. Now we use a const char *.
CtdlThreadName now takes a const char * and returns a const char *
It is up to the caller to make sure the name never goes out of scope.
* applied Patrick Colemans patch
* patched CtdlDoIHavePermissionToPostInThisRoom to enable anonymous posting to non-aide-only post rooms
* first starts on bug 209 to get more versatile email interfaces.
Dave West [Mon, 3 Dec 2007 22:00:48 +0000 (22:00 +0000)]
Added an entry point to the modules init stuff.
The new entry point is defined by the macro
CTDL_MODULE_UPGRADE(module_name).
This entry point works in much the same way as the init entry point
except it is called before the init entry point. This entry point is
intended for use as its name implies. The module should do any upgrade
stuff it needs to do before it can initialise.
serv_upgrade.c demonstrates the useage.
Art Cancro [Mon, 3 Dec 2007 07:22:43 +0000 (07:22 +0000)]
Only send presence notifications when the first
concurrent session for a user logs in, or when the last
session logs out. Also handle stealth mode semantics.
Art Cancro [Mon, 3 Dec 2007 02:44:20 +0000 (02:44 +0000)]
* WebCit now clarifies, using a localized message (or at
least it will be localized once the translators catch it) the
error condition which occurs when an administrator attempts to
create a new user from within Citadel while running in host
auth mode.
* Wrapped an ifdef around some calendar code that should be disabled
when libical is not present.
* since we now require a new libical version, remove glitch in availability.
* configure now requires libical-0.30
* webserver shuts down libical, valgrind doesn't mention ical anymore now.
Dave West [Fri, 30 Nov 2007 23:31:56 +0000 (23:31 +0000)]
Removed the PushName and PopName debugging macros that I added. They
cause a boom in the auto purger due to some change in the tsd I think.
Anyway, they've servered their purpose now.
Dave West [Fri, 30 Nov 2007 22:11:40 +0000 (22:11 +0000)]
Now we reduce the number of threads if the load conditions are
low. This way we can be nice to other things that might be running on
the same machine by releasing some resources back to the system.
Dave West [Fri, 30 Nov 2007 21:56:02 +0000 (21:56 +0000)]
Moved the garbage collection and threding init stuff into a seperate
function from main()
Also start the same number of threads that it says in the config.
Dave West [Fri, 30 Nov 2007 19:47:29 +0000 (19:47 +0000)]
Don't queue up all the worker threads waiting for the session table in
dead_session_purge(). If it is locked just get out. If that leaves a
dead session/context or two lying around then no biggie because the next
time through will clean them.
Dave West [Fri, 30 Nov 2007 18:56:48 +0000 (18:56 +0000)]
Fake a lower load average of new threads. When starting threads based on
load this causes a new thread to affect the load more so it gets chance
to start doing things. Otherwise we might start more threads than we
need to.
Dave West [Fri, 30 Nov 2007 17:19:24 +0000 (17:19 +0000)]
To lock or not to lock before signalling a condition?
Some docs imply one should lock.
Some docs say to release all locks before signalling the condition.
Art Cancro [Thu, 29 Nov 2007 23:00:44 +0000 (23:00 +0000)]
Initial code to output any instant messages which
have arrived for the user. The Citadel server's built-in
infrastructure for asynchronous (unsolicited) protocol messages
made this really easy.
Art Cancro [Thu, 29 Nov 2007 15:52:18 +0000 (15:52 +0000)]
Slight change to the way we offer XMPP stream features.
Before authentication, the only feature we offer is SASL, implying to
the client that the only thing it is allowed to do is log in. After
a successful SASL authentication, which causes the XMPP stream to be
restarted, the features we offer are sessions and binding, but not
SASL. This allows clients to initialize in the correct sequence and
guarantees that we will have an email address to use in the JID.
Art Cancro [Tue, 27 Nov 2007 22:40:47 +0000 (22:40 +0000)]
When restarting the XMPP stream after a successful
SASL authentication, don't offer SASL as a stream feature
again. This causes the client to attempt re-authentication
and/or go into an error condition.