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.
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 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 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.
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.
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.
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 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.
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.
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 [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 [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 [Thu, 8 Nov 2007 23:05:25 +0000 (23:05 +0000)]
Fixed the problem dave reported yesterday, where a
large calendar hung the webcit renderer while displaying.
This turned out to have nothing to do with the size of the
calendar, but with a specific event that had no newline
at the end and caused the 000 terminator to appear at the
end of a line instead of on its own line. Switched from
MSG0 to MSG4 in webcit to both work around this problem and
save over-the-wire chatter. Dave's work from last night
plus this commit, resolve bug #284.
Art Cancro [Thu, 8 Nov 2007 15:22:01 +0000 (15:22 +0000)]
Added the User-Agent: and Accept: headers to our
HTTP client requests. Some HTTP servers (such as www.digg.com)
simply disconnect without any response if they are not present.
I correct the errors which are found by Firefox Tiny Validator.
- a div tag in excess at the foot of the all pages (there remains one
about it)
- a td tag which must be a th tag in the monthly view of the calendar
I added the name of the current user running in the title of the page. It
appears with the name of the site and that of the navigator in the bar
in top of the window.
Art Cancro [Tue, 6 Nov 2007 22:57:53 +0000 (22:57 +0000)]
Removed a stray </select> tag which appeared
after the Search: input box. This seems to have made the Reply/Move/Print
buttons reappear in IE 7, resolving Bug 262.
Art Cancro [Tue, 6 Nov 2007 22:49:41 +0000 (22:49 +0000)]
Removed an extra <div> and also fixed a <td> tag with
a missing right angle bracket. This fixes the problem with the
address book popup that I mentioned in Bug 262, but it does not
fix the entire bug. We are looking at two different problems
after all.
Dave West [Tue, 6 Nov 2007 19:40:39 +0000 (19:40 +0000)]
Add #include <stdarg.h>
Needed for the prototype of vlprintf, at least on the system I'm trying
to use Easy Install on anyway.
Why did this not show up any where else?
More to the point why did it not show up on my dev system, should be
practically identical to the system I'm trying to use Easy Install on.