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.
Wilfried Göesgens [Mon, 3 Dec 2007 22:59:14 +0000 (22:59 +0000)]
* 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 08:23:23 +0000 (08:23 +0000)]
Escape characters being transmitted by the instant messenger in webcit
Art Cancro [Mon, 3 Dec 2007 07:57:09 +0000 (07:57 +0000)]
Site config protocol and UI for XMPP port numbers
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 06:33:25 +0000 (06:33 +0000)]
Initial XMPP STARTTLS code; commented out because it doesn't work
Art Cancro [Mon, 3 Dec 2007 06:11:54 +0000 (06:11 +0000)]
Handle <message> stanzas with no body by clearing out
the buffer, avoiding spurious messages.
Art Cancro [Mon, 3 Dec 2007 05:38:07 +0000 (05:38 +0000)]
Jabber chat is now working in both directions
Art Cancro [Mon, 3 Dec 2007 05:02:16 +0000 (05:02 +0000)]
Receiving Jabber messages now works correctly, with
the sender's JID mapped properly to the screen name.
Art Cancro [Mon, 3 Dec 2007 04:56:31 +0000 (04:56 +0000)]
Instant messages now carry the email address or JID of the
sender. Sorry, there was no way around it.
Art Cancro [Mon, 3 Dec 2007 04:41:02 +0000 (04:41 +0000)]
Unsolicited XMPP presence pushes are now working
properly, including roster updates.
Art Cancro [Mon, 3 Dec 2007 04:29:51 +0000 (04:29 +0000)]
Updated roster push technique
Art Cancro [Mon, 3 Dec 2007 04:10:27 +0000 (04:10 +0000)]
Got the unsolicited roster pushes working.
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.
Art Cancro [Mon, 3 Dec 2007 02:18:36 +0000 (02:18 +0000)]
Supply a more informative error message when an administrator
attempts to create a new user from within Citadel while running
in host auth mode.
Wilfried Göesgens [Sun, 2 Dec 2007 23:15:16 +0000 (23:15 +0000)]
* missing translation.
Art Cancro [Sun, 2 Dec 2007 05:46:40 +0000 (05:46 +0000)]
Unsolicited presence push. Still doesn't seem to work.
Art Cancro [Sat, 1 Dec 2007 18:10:54 +0000 (18:10 +0000)]
more xmpp presence stuff
Dave West [Sat, 1 Dec 2007 15:48:03 +0000 (15:48 +0000)]
Update the ignored stuff for svn. I'm fed up looking at all those .d
files in svn status -u
Dave West [Sat, 1 Dec 2007 15:45:08 +0000 (15:45 +0000)]
A thread based version of the Auto Purger.
This is highly EXPERIMENTAL!!!!!!
Dave West [Sat, 1 Dec 2007 15:36:07 +0000 (15:36 +0000)]
Try to rationalise the mutex lock/unlock sequence. Hunting for an
occasional deadlock.
Wilfried Göesgens [Sat, 1 Dec 2007 12:26:34 +0000 (12:26 +0000)]
* 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.
Wilfried Göesgens [Sat, 1 Dec 2007 11:00:42 +0000 (11:00 +0000)]
* free timezone after using it.
Dave West [Fri, 30 Nov 2007 23:37:04 +0000 (23:37 +0000)]
Removed defunct semaphore S_WORKER_LIST
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.
Art Cancro [Fri, 30 Nov 2007 22:49:38 +0000 (22:49 +0000)]
Login and logout queue events are processed
Dave West [Fri, 30 Nov 2007 22:43:11 +0000 (22:43 +0000)]
Clean up in sysdep_decls.h
Dave West [Fri, 30 Nov 2007 22:33:07 +0000 (22:33 +0000)]
Fixed up a comment.
Dave West [Fri, 30 Nov 2007 22:24:26 +0000 (22:24 +0000)]
Changed the way we create aditional threads. One for every connection is
wastefull. Each worker can usually handle 3-4 connections with ease.
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 22:03:37 +0000 (22:03 +0000)]
Now check for scheduled shutdown in garbage collector.
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.
Art Cancro [Fri, 30 Nov 2007 21:54:58 +0000 (21:54 +0000)]
Define an XMPP queue...
Dave West [Fri, 30 Nov 2007 21:30:01 +0000 (21:30 +0000)]
Removed a spurios CtdlThreadPopName()
Dave West [Fri, 30 Nov 2007 21:24:08 +0000 (21:24 +0000)]
Add prototype for CtdlThreadGetWorkers()
Dave West [Fri, 30 Nov 2007 21:20:14 +0000 (21:20 +0000)]
Now signals will stop the server again.
Dave West [Fri, 30 Nov 2007 20:19:37 +0000 (20:19 +0000)]
Close a window that allowed a new thread to be created even though the
system is shutting down.
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 19:30:09 +0000 (19:30 +0000)]
A mismatch of the worker thread counts is a critical thing. Log it as
such.
Dave West [Fri, 30 Nov 2007 19:27:36 +0000 (19:27 +0000)]
Don't do a CtdlThreadStopAll() within a critical_section, that would
cause deadlock.
Dave West [Fri, 30 Nov 2007 19:18:28 +0000 (19:18 +0000)]
Small optimisation for CtdlThreadSelect(). Now takes a pointer to this
thread.
Dave West [Fri, 30 Nov 2007 19:12:30 +0000 (19:12 +0000)]
ctdl_thread_internal_gc() now follows rule for critical_section
Dave West [Fri, 30 Nov 2007 19:04:16 +0000 (19:04 +0000)]
Calls to ctdl_thread_internal_* meed to be inside a critical_section.
Wilfried Göesgens [Fri, 30 Nov 2007 18:57:44 +0000 (18:57 +0000)]
* include system headers first.
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:59:07 +0000 (17:59 +0000)]
Lock the state change on exiting a thread.
Dave West [Fri, 30 Nov 2007 17:51:44 +0000 (17:51 +0000)]
Added a macro to get a threads structure.
Spead up CtdlThreadCheckStop() by requiring the caller pass in its own
thread structure.
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.
Dave West [Fri, 30 Nov 2007 17:09:13 +0000 (17:09 +0000)]
Minor optimisation to calculation of load averages.
Dave West [Fri, 30 Nov 2007 16:59:08 +0000 (16:59 +0000)]
Add a function try_critical_section()
Just like begin_critical_section but this one returns non zero if the
section is already busy.
Dave West [Fri, 30 Nov 2007 16:55:25 +0000 (16:55 +0000)]
Signals can't call thread functions so don't do CtdlThreadStopAll in the
signal handler.
Art Cancro [Fri, 30 Nov 2007 05:09:00 +0000 (05:09 +0000)]
Strip leading and trailing whitespace from instant messages before sending them to Jabber clients
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 16:44:04 +0000 (16:44 +0000)]
XMPP presence dump of wholist
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 [Wed, 28 Nov 2007 16:30:01 +0000 (16:30 +0000)]
id keyword
Art Cancro [Wed, 28 Nov 2007 16:29:04 +0000 (16:29 +0000)]
svn propset
Art Cancro [Wed, 28 Nov 2007 16:26:21 +0000 (16:26 +0000)]
Deliver a reply to a Jabber 'roster' query.
Art Cancro [Wed, 28 Nov 2007 04:51:40 +0000 (04:51 +0000)]
we have the iq-query-xmlns nonsense all framed up
and ready to deliver some results. now we just have to populate it
with some data.
Art Cancro [Wed, 28 Nov 2007 04:10:52 +0000 (04:10 +0000)]
Minor xml fix to xmpp server
Art Cancro [Tue, 27 Nov 2007 22:43:08 +0000 (22:43 +0000)]
comments change
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.
Art Cancro [Tue, 27 Nov 2007 20:14:45 +0000 (20:14 +0000)]
xmpp sasl hacks
Dave West [Tue, 27 Nov 2007 20:00:11 +0000 (20:00 +0000)]
Added --with-threadlog. Use this if you want the thread table written to
the log.
Fixed CtdlThreadName(char *name) now renames thread to name if name is
set and always returns old name caller frees old name.
Added a couple of macros to change the thread names in some places for
debugging.
Art Cancro [Tue, 27 Nov 2007 18:06:25 +0000 (18:06 +0000)]
Added SASL PLAIN auth to jabber service.
Art Cancro [Tue, 27 Nov 2007 18:03:34 +0000 (18:03 +0000)]
Added SASL PLAIN auth to jabber service.
Art Cancro [Tue, 27 Nov 2007 17:54:19 +0000 (17:54 +0000)]
Checked in my initial work on an XMPP (Jabber) service.
This does not yet work at all. Don't even try to use it.
I'm only checking it in so it gets backed up.
Dave West [Tue, 27 Nov 2007 14:36:30 +0000 (14:36 +0000)]
Ooops, A little buglet with SIGPIPE, my fault.
Dave West [Tue, 27 Nov 2007 13:09:40 +0000 (13:09 +0000)]
Debug code to show thread table is now back in. Thiss will fill your log
file.
Added number of threads to INFO command
Changed calc for load averages, now it is a percentage.
Dave West [Tue, 27 Nov 2007 01:21:13 +0000 (01:21 +0000)]
Now do garbage collection every second.
Change the way load averages are calculated.
Now calculate a load average for worker threads as well as the entire
system.
Display the load averages in the INFO command system then worker.
Remove all the extra debug info from garbage collector.
Dave West [Tue, 27 Nov 2007 00:14:04 +0000 (00:14 +0000)]
Create all worker threads with the name "Worker Thread"
Dave West [Mon, 26 Nov 2007 22:03:59 +0000 (22:03 +0000)]
Threads now have load averages of sorts.
Hopefully this will allow some threads to throttle back at times of high
load (like the indexer).
Dave West [Mon, 26 Nov 2007 20:38:41 +0000 (20:38 +0000)]
Now we have a thread state for blocked. Only works for the select in the
worker thread at the moment.
Dave West [Mon, 26 Nov 2007 19:43:08 +0000 (19:43 +0000)]
Prevent CtdlThreadCancel on garbage collector.
Dave West [Mon, 26 Nov 2007 19:39:52 +0000 (19:39 +0000)]
Now the garbage collection thread is in the thread list too.
Art Cancro [Mon, 26 Nov 2007 04:36:01 +0000 (04:36 +0000)]
Fixed bug 301. /listsub operations do not require a
security nonce because they do not maintain an ongoing session
with the server. Also cleaned this screen up visually.
Dave West [Mon, 26 Nov 2007 01:20:56 +0000 (01:20 +0000)]
Fixed the clean up of Contexts when we exit.
Do we need to clean up some of the contexts pointers too?
serv_calendar.c now cleans up with a CleanupHook.
Dave West [Sun, 25 Nov 2007 22:15:18 +0000 (22:15 +0000)]
Here it is, the new thread interface.
The code to handle threads is in sysdep.c
This new thread interface has caused a change to the way modules are
initialised. A modules init function is now called twice. First time
threading==0, second time threading==1. threading is a parameter passed
to the init function.
You should not create a thread until your init function has been called
with threading==1. See serv_fulltext.c as an example.
All of the modules init functions have been updated for this change.
The old RegisterThread stuff has gone away.
time_to_die has gone as it was used to tell threads to exit, we now use
CtdlThreadCheckStop() instead which return non zero if the thread should
exit.
The server will exit when all threads have stopped.
CtdlThreadCreate() handles creation of threads in a safe manner.
CtdlThreadSleep() is used to do a sleep in a thread.
CtdlThreadStop() is used to stop a thread.
CtdlThreadStopAll() stops all threads and thus causes the server to
exit.
Threads are cleanup when they die by the main server process (every 10
seconds) which originally did nothing useful.
CtdlThreadGC() will force a garbage collection now.
CtdlThreadGetCount() return the number of threads in the system not just
the number of workers.
CtdlThreadSelf() returns a pointer to this threads thread structure.
CtdlThreadName() returns a strdup'd string that is the threads name, you
need to free this. It also allows you to change a threads name.
CtdlThreadCancel() does the same as pthread_cancel except it also
informs our thread system. Don't use this if you can help it.
There are a lot of debug messages at the moment, they will go away once
stability is proven.
Wilfried Göesgens [Thu, 22 Nov 2007 23:43:01 +0000 (23:43 +0000)]
* now the deb-version is right. the debs should work now.
Art Cancro [Wed, 21 Nov 2007 19:13:13 +0000 (19:13 +0000)]
Changed the column headers in the user list to
reflect modern terminology. Last Call is now Last Visit, Calls is now
Logins, and Posts is now Messages.
Art Cancro [Wed, 21 Nov 2007 04:54:19 +0000 (04:54 +0000)]
struct CitContext no longer contains separate module-specific pointers for
things like IMAP state, SMTP state, POP3 state, managesieve state, etc.
These four modules now use a single 'service_specific_data' pointer, which
is cast to whatever data type the module is using. This is possible because
only one is used at a time (a session cannot be POP3 and SMTP simultaneously,
for example). As before, when a module allocates memory and places
a pointer to it in this location, the module's cleanup function
continues to be responsible for freeing it, and as before, it must not
free this pointer under any other circumstances.
Third-party modules which implement new server protocols now have a place
to store session data without modifying the server core. Just follow one
of the existing server protocol modules as an example.
Dave West [Wed, 21 Nov 2007 02:48:48 +0000 (02:48 +0000)]
Begun implimentation of a really good thread control interface.
As it turns out it impliments a lot of what eCrash does to track threads
though I didn't know it at the time. To check it out look in sysdep.c
and search on CtdlThread. That will get you close.
At the moment nothing makes use of this code.
A handy side effect is a thread safe sleep mechanism that will sleep
the current thread untill some other thread sleeps or it times out, needs a
bit more work to make it sleep any thread without waking when another
thread sleeps.
Also fixed a potential memory leak or two in the old thread code.
Wilfried Göesgens [Tue, 20 Nov 2007 23:41:38 +0000 (23:41 +0000)]
* apache proxies and listsub/ don't play well.
Wilfried Göesgens [Tue, 20 Nov 2007 23:07:29 +0000 (23:07 +0000)]
* purge remaining libnetfilter strings
Wilfried Göesgens [Tue, 20 Nov 2007 22:58:13 +0000 (22:58 +0000)]
* fix locale compile support.
Wilfried Göesgens [Tue, 20 Nov 2007 22:35:30 +0000 (22:35 +0000)]
* search absolute for the images on the server.
Dave West [Tue, 20 Nov 2007 20:03:22 +0000 (20:03 +0000)]
Source clean up.
Moved all hook code into serv_extensions.c and serv_extensions.h since
this is more logical
Wilfried Göesgens [Mon, 19 Nov 2007 22:36:39 +0000 (22:36 +0000)]
* add a script that tries to migrate the systems /etc/aliases file if existant.
Wilfried Göesgens [Mon, 19 Nov 2007 19:56:13 +0000 (19:56 +0000)]
* depend to libcitadel.
Wilfried Göesgens [Mon, 19 Nov 2007 19:52:48 +0000 (19:52 +0000)]
* depend to libcitadel
Art Cancro [Mon, 19 Nov 2007 15:52:57 +0000 (15:52 +0000)]
ooops... ascmonths[] was in use in imap_tools.c ... fixed
Art Cancro [Mon, 19 Nov 2007 04:36:04 +0000 (04:36 +0000)]
Removed the 'ascmonths' global declaration from libCitadel.
This should clean up the build on Mac OS.
Art Cancro [Mon, 19 Nov 2007 04:34:42 +0000 (04:34 +0000)]
Removed the 'ascmonths' global declaration from libCitadel.
This should clean up the build on Mac OS.
Wilfried Göesgens [Sun, 18 Nov 2007 23:53:07 +0000 (23:53 +0000)]
* create .pc file, seems to be a good thing to do.
* debian packaging added.
Art Cancro [Sun, 18 Nov 2007 05:10:58 +0000 (05:10 +0000)]
Add 'datarootdir' variable to Makefile.in
We don't use it, but it shuts up the autoconf warning.
Art Cancro [Fri, 16 Nov 2007 17:27:04 +0000 (17:27 +0000)]
Commented out some lprintf() calls that appear in libcitadel.
It is inappropriate to have them here because the caller
may not have an lprintf() function.
Art Cancro [Fri, 16 Nov 2007 17:23:41 +0000 (17:23 +0000)]
Art Cancro [Fri, 16 Nov 2007 17:20:16 +0000 (17:20 +0000)]
Added COPYING and README.txt to libcitadel