Art Cancro [Tue, 17 Nov 2009 17:20:49 +0000 (17:20 +0000)]
* If patch fails, send rejects to /dev/null instead of cluttering /tmp with them.
* Report pclose() failures in serv_wiki.c because they probably indicate that a diff or patch command failed.
Dave West [Mon, 16 Nov 2009 23:08:23 +0000 (23:08 +0000)]
configure will now detect the Boehm-Demers-Weiser garbage collection library
We don't actually use it yet but we will when I add the libsee javascript
engine that recomends it.
We will probably need to add the Boehm-Demers-Weiser library to easyinstall
since it seems only debian based distros have it as a package.
Art Cancro [Sun, 15 Nov 2009 04:41:43 +0000 (04:41 +0000)]
* Added a new category 'fallback smart host'. These are smart hosts that are used only when direct delivery fails. It's just the thing for those sites that have a smart host available but prefer not to use it.
Art Cancro [Sat, 14 Nov 2009 05:16:59 +0000 (05:16 +0000)]
* Switched the SMTP Client back to a simple timer-event hook with a static variable lock. I couldn't figure out why davew's locking system didn't work. The code looks solid, but for some reason, after the first time it hits that 'already running' thread, once that first thread exits it never starts again.
Art Cancro [Fri, 13 Nov 2009 21:33:16 +0000 (21:33 +0000)]
* Trying to figure out why the SMTP Send queue is stuck on Uncensored. I corrected one edge case where it was possible for the thread to exit without unlocking, but I don't think we were hitting that case.
Art Cancro [Fri, 13 Nov 2009 04:12:25 +0000 (04:12 +0000)]
* Renamed the 'wikipage' variable to 'page' in the enter message loop to make it identical to its corresponding variable in the read message loop. This allows the page name to be displayed in the room banner during editing.
Art Cancro [Wed, 11 Nov 2009 17:58:35 +0000 (17:58 +0000)]
* Fixed a bug that was causing the initial visit to a Wiki room to fetch the page list instead of the home page.
* Wiki page lists, including search results, are now lists of links to those pages.
* fix exit point in Ctdl_GetUtf8SequenceLength; condition was wrong
* fix StrHtmlEcmaEscAppend; its utf-8 sequence mechanism was deffective
* fix StrBuf_Utf8StrCut; it needs to count glyphs and bytes in different steps here
Dave West [Tue, 10 Nov 2009 21:19:32 +0000 (21:19 +0000)]
Added a FIXME tag.
This module is REALY horrible to the system.
It carries out IO whilst it still has the context list locked.
That alone should merit disabling this module.
Dave West [Tue, 10 Nov 2009 21:07:22 +0000 (21:07 +0000)]
Grabbed a chunk of code out of citserver.c cmd_term() and used it to create
a new function
CtdlTerminateOtherSession()
Placed this function in context.c since it manipulates the contexts.
Exposed this function to the API
Noticed we don't seem to have a client that uses the TERM command.
Dave West [Tue, 10 Nov 2009 19:39:19 +0000 (19:39 +0000)]
Moved BumpNewMailCounter() into context.c because it manipulates contexts.
Exposed it to the API as CtdlBumpNewMailCounter() and deprected the old name.
Dave West [Tue, 10 Nov 2009 19:27:46 +0000 (19:27 +0000)]
Grabbed another chunk of code out of user_ops.c, purge_user()
This chunk checked if a user was logged in by testing the user numbers
It is now a function and exposed to the API as
int CtdlIsUserLoggedInByNum(int num)
Also marked the code with a FIXME since it is unsafe, a user could log in
after the test but before the delete and realy mess things up.
Dave West [Tue, 10 Nov 2009 19:06:33 +0000 (19:06 +0000)]
Grabbed that previously noted bad code from rename_user that walked
the context list without locking. Used it to create a function
int CtdlIsUserLoggedIn (char *username)
and exposed it to the API
Oh yes and I fixed it to walk the list safely.
Art Cancro [Tue, 10 Nov 2009 03:58:32 +0000 (03:58 +0000)]
* Added a new message field '1' which may be set by BeforeSave hooks. The presence of this field excludes the message from being included in the full text index.
* Set this field on wiki history pages.
Dave West [Sun, 8 Nov 2009 22:48:01 +0000 (22:48 +0000)]
Exposed CtdlLocateMessageByEuid in ctdl_module.h and deprecated
locate_message_by_euid in euidindex.h
Another step towards the documented coding style.
Dave West [Sun, 8 Nov 2009 19:07:25 +0000 (19:07 +0000)]
Moved the prototypes of CtdlLoginExistingUser and CtdlTryPassword into
ctdl_module.h.
They constitute part of the API for modules and we shouldn't need to
include user_ops.h in modules.
* microshits RFC Violator will just show the tinnef part of a message you reply to, so you'll get phonecalls why you send 'em back their mail. -> ignore tinnefs while replying to mails
Dave West [Sat, 7 Nov 2009 23:05:14 +0000 (23:05 +0000)]
Changed smtp sending to use a thread.
This change is the result of circumstances seen on Uncensored.
A bad host for a mailing list address was taking 4 minutes to time out.
This caused a general problem for Citadel because the EVT_TIMER event that
drive SMTP queue running was then tied up and unable to process SIEVE and
other stuff. Indeed the whole housekeeping stuff got blocked.
Basically it hilighted that we should NOT be doing IO during anything
trigered by housekeeping.
This change does nothing to improve the situation with the bad host but
it will allow housekeeping to work properly even if SMTP gets stuck.
Description of change.
======================
The outbound SMTP queue was originally processed durin an EVT_TIMER event.
This has been changed so that the event creates a thread to process the
queue and then returns.
To prevent the problem where more than one thread might be created to process
the queue a mutex is tested before the thread is created.
If the mutex is locked then no thread is created because there already is one.
If the mutex is unlocked then we lock it and create the thread.
The last operation of the thread is to unlock the mutex.
Art Cancro [Thu, 5 Nov 2009 18:00:00 +0000 (18:00 +0000)]
* When performing a network poll of another Citadel node, connecting to a node other than the one we were expecting is now an error condition that causes processing to immediately stop.
Dave West [Tue, 3 Nov 2009 12:34:30 +0000 (12:34 +0000)]
Add some comments to rename_user indicating why the code is bad.
It traverses an unlocked context list and it leaves a big hole for
the actual operation to do something unexpected.
Art Cancro [Mon, 2 Nov 2009 17:21:33 +0000 (17:21 +0000)]
* Completed the code to revert a wiki page to a previous version with just one click. Combined with the previous commit, the code paths for 'view' and 'revert' operations are now unified in both citserver and webcit.
* Re-enabled the ability to create Wiki rooms. Our wiki module is now functionally complete in a barebones sort of way, and the on-disk format is finalized. I will probably add some more bells and whistles (such as 'compare versions') before the final release.
Dave West [Mon, 2 Nov 2009 13:15:52 +0000 (13:15 +0000)]
Added a new command line option to citserver "-s" takes a numerical parameter.
When this is specified with a number greater than 0 the server will start
almost as normal except it will not start any workers or module related
threads.
Instead it will create the specified number of simulation threads and time
how long it takes for them to be created, create a context, delete the
context and get cleaned up. A message is written to the log stating how long
it took and then the server will exit normally.
This is to help tune the client connection code and thread creation stuff.
Dave West [Sun, 1 Nov 2009 18:09:14 +0000 (18:09 +0000)]
Fixed the bug that prevented DOWN from working properly.
Also broke the context handling routines out of sysdep.c and other places
and put them in context.c / .h
This has been done to make it easier to improve the speed with which we
create / destroy contexts and threads.
Dave West [Sat, 31 Oct 2009 15:29:37 +0000 (15:29 +0000)]
Fixed a bug in the threading code that would prevent new threads starting.
It was possible for threads that are running (not idle) to still be
marked as Blocked (idle).
Also Identified another problem that could prevent threads from starting.
If all existing worker threads were given a task during the same GC tick
then the system load average would go to 100% and prevent new threads.
This was due to a bad method of calculating the load average. We always
wanted the machine load average to limit the creation of new threads
so that the machine didn't become overloaded. Now we get the machine load
and use that to limit new threads. We also log a WARNING in this event.
Art Cancro [Fri, 30 Oct 2009 19:45:08 +0000 (19:45 +0000)]
* Noticed something that was technically correct but confusing: when viewing a wiki history, each line displayed the date and author of the diff, which is NOT the same thing as the date and author of the page you would get if you reverted to that version. Configured some off-by-one logic in the display code to compensate for this. As an added bonus, the last line, which simply displayed an empty message, has been replaced by a new first line, which displays the date and author of the current version.
Art Cancro [Fri, 30 Oct 2009 04:32:42 +0000 (04:32 +0000)]
* Performing a 'fetch' operation on an old revision of a wiki page now stuffs the reverted version into a room called '9999999999.WikiWaybackMachine'. Due to the invalid namespace, the DAP will clean up after us later.
Art Cancro [Tue, 27 Oct 2009 15:40:27 +0000 (15:40 +0000)]
* Added the code to let display_wiki_page_backend() know when it's expected to fetch a specific revision of a wiki page. Stopped cold dead when I realized that it's going to be practically impossible to supply read_message() with anything other than a message number.
Dave West [Sun, 25 Oct 2009 22:05:03 +0000 (22:05 +0000)]
A little more with the API coding style.
Also added following functions
CtdlGetFloorByName Gets floor by name. Return -1 if not found.
CtdlGetFloorByNameLock As above but locks the floors.
CtdlGetAvailableFloor Returns number of first unused floor.
These functions make use of the floor cache for performance.
The idea is if you want to create a floor you first check that the name
is available with CtdlGetFloorByNameLock
If the name is available you get -1 back and you then do CtdlGetAvailableFloor
Now you have a floor number to use so you can CtdlGetFloor and fill in the
structure information before doing CtdlPutFloorLock
* check for the PAM lib in every case, since if we detect the functions we need to link it
* check for user modules before referencing them in the VDIR build