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
Art Cancro [Fri, 16 Nov 2007 17:15:22 +0000 (17:15 +0000)]
Move vcard.c into libcitadel.
Art Cancro [Fri, 16 Nov 2007 16:09:22 +0000 (16:09 +0000)]
When opening the Berkeley DB environment, step
through three different dbenv->open() attempts. The first opens the environment
normally. If that fails with DB_RUNRECOVERY, it is attempted again with the
DB_RECOVER flag set. If that fails with DB_RUNRECOVERY, it is attempted once
again with DB_RECOVER_FATAL. If that fails, the program exits.
Art Cancro [Fri, 16 Nov 2007 05:52:26 +0000 (05:52 +0000)]
HUGE PATCH. This moves all of mime_parser.c and all
of tools.c into libcitadel. It compiles cleanly, and seems to work, but I'm sure
I broke *something* so let's give this lots of testing.
Wilfried Göesgens [Thu, 15 Nov 2007 23:27:12 +0000 (23:27 +0000)]
* tiny tool for message retrieval, first draft.
Wilfried Göesgens [Thu, 15 Nov 2007 23:08:48 +0000 (23:08 +0000)]
* this is 7.24
Wilfried Göesgens [Thu, 15 Nov 2007 22:55:33 +0000 (22:55 +0000)]
* msgnum is a long. format it like that.
Art Cancro [Thu, 15 Nov 2007 16:19:24 +0000 (16:19 +0000)]
Updated version number to 7.24
Art Cancro [Thu, 15 Nov 2007 16:15:09 +0000 (16:15 +0000)]
Fixed a bug introduced in r5517 that was causing
incoming network messages to simply be thrown away most of
the time. r5517 replaced a call to /bin/mv with a copy file
loop, but the loop operated in line-by-line text mode.
Network spool contains architecture-independent binary data,
so this was failing.
Art Cancro [Wed, 14 Nov 2007 14:50:51 +0000 (14:50 +0000)]
force_room variable needs to be output using
escputs() not urlescputs() otherwise Bad Things Happen.
Art Cancro [Wed, 14 Nov 2007 05:24:03 +0000 (05:24 +0000)]
Added a 'force_room'
to the enter message form, to ensure that the room the message
gets posted in is the same room the user started entering it in.
Wilfried Göesgens [Tue, 13 Nov 2007 22:21:24 +0000 (22:21 +0000)]
* cleanup with variable substitution. cleaner replacing function and string variables.
Wilfried Göesgens [Tue, 13 Nov 2007 17:43:10 +0000 (17:43 +0000)]
* to much c-coding spoilz bash-sk1lz
Art Cancro [Tue, 13 Nov 2007 17:19:53 +0000 (17:19 +0000)]
Removed '#define CHUNKED_READ' from citadel_ipc.c
It is still broken and should not be defined by default.
Dave West [Tue, 13 Nov 2007 02:37:45 +0000 (02:37 +0000)]
A little bit of speed up in the wordbreaker for full text indexing.
Also fixed a small bug that made some of our index tokens bad.
Maybe this will fix some of the text search problems some people are
seeing.
We also need to alter the indexer to index the message headers as well
as the body, at the moment we only index the body.
Art Cancro [Mon, 12 Nov 2007 17:15:59 +0000 (17:15 +0000)]
Amended the 'Corrupt message' error with more detail
Wilfried Göesgens [Sun, 11 Nov 2007 18:58:39 +0000 (18:58 +0000)]
* buffered read next try; recv might give the solution?
Wilfried Göesgens [Sun, 11 Nov 2007 16:09:45 +0000 (16:09 +0000)]
* do non-blocking accept()
* shut down on HUP instead of TERM; easier to debug.
* kill & free our running sessions on shutdown
Art Cancro [Sun, 11 Nov 2007 05:35:30 +0000 (05:35 +0000)]
Amended the MSGP command to provide a way for the client to
indicate to the server that it prefers to decode Base64 and quoted-printable
on the client side when reading MIME parts with the MSG4 command.
Resolves bug 289.
Art Cancro [Sun, 11 Nov 2007 04:46:40 +0000 (04:46 +0000)]
* moved CtdlDecodeQuotedPrintable() into tools.c
(later we will move most or all of tools.c into libcitadel)
* amended citadel_ipc.c message reading loop. When using MSG4 (nearly
always), parse base64 and quoted-printable encodings, and decode them.
MSG4 does not *yet* send these, instead performing the decoding on
the server side. During experimentation I told the server not to
decode, and this will resolve Bug #289. All that's left to do is to
add something to the protocol so that the client can tell the server
that it wants non-decoded message text. I'll do that tomorrow.
Art Cancro [Sun, 11 Nov 2007 04:17:41 +0000 (04:17 +0000)]
Experimented with 'struct CitContext *CCC = CC;' for performance
Wilfried Göesgens [Sat, 10 Nov 2007 23:12:19 +0000 (23:12 +0000)]
* if -D added, citserver will print out the Directories.
Wilfried Göesgens [Sat, 10 Nov 2007 23:11:32 +0000 (23:11 +0000)]
* this might be the try to free a null-pointer.
Art Cancro [Sat, 10 Nov 2007 05:32:30 +0000 (05:32 +0000)]
When populating the address book popup with the contents of
an address book room (such as the Global Address Book), save the name of the room
we came from and go back there after fetching the address book. Fixes bug #227.
Art Cancro [Fri, 9 Nov 2007 22:57:45 +0000 (22:57 +0000)]
Don't crash on RSS feed items without descriptions
Art Cancro [Fri, 9 Nov 2007 22:50:32 +0000 (22:50 +0000)]
Fix bug which appears when multiple feeds in one room
Art Cancro [Fri, 9 Nov 2007 20:12:20 +0000 (20:12 +0000)]
Added the MIME parser to libcitadel.
Art Cancro [Fri, 9 Nov 2007 20:04:26 +0000 (20:04 +0000)]
Added 'bootstrap' command. It just calls
autoconf, but let's be consistent.
Art Cancro [Fri, 9 Nov 2007 20:03:46 +0000 (20:03 +0000)]
New build system for libcitadel, with autoconf and libtool
Art Cancro [Fri, 9 Nov 2007 19:33:22 +0000 (19:33 +0000)]
Testing some gnu type build stuff
Art Cancro [Fri, 9 Nov 2007 17:50:29 +0000 (17:50 +0000)]
added sample makefile
Art Cancro [Fri, 9 Nov 2007 17:20:49 +0000 (17:20 +0000)]
random foo