From 658bfd183905576ed5f4dbe57a2ee82711b6ac93 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:42 +0200 Subject: tagging ychat-0.7.9.0 --- CHANGES | 26 --- CVS/Entries | 10 ++ CVS/Entries.Log | 7 + CVS/Repository | 1 + CVS/Root | 1 + Makefile | 2 - NEWS | 18 +- README | 376 ++++++++++++++++++++++++++++++++++++--- RELEASES | 68 +++---- SNAPSHOT | 1 + TODO | 74 ++++---- VERSION | 1 + bin/CVS/Entries | 1 + bin/CVS/Repository | 1 + bin/CVS/Root | 1 + docs/CVS/Entries | 2 + docs/CVS/Repository | 1 + docs/CVS/Root | 1 + etc/CVS/Entries | 2 + etc/CVS/Repository | 1 + etc/CVS/Root | 1 + etc/ychat.conf | 16 +- html/CVS/Entries | 20 +++ html/CVS/Entries.Log | 1 + html/CVS/Repository | 1 + html/CVS/Root | 1 + html/images/CVS/Entries | 8 + html/images/CVS/Repository | 1 + html/images/CVS/Root | 1 + log/CVS/Entries | 2 + log/CVS/Entries.Log | 1 + log/CVS/Repository | 1 + log/CVS/Root | 1 + log/rooms/CVS/Entries | 2 + log/rooms/CVS/Repository | 1 + log/rooms/CVS/Root | 1 + scripts/CVS/Entries | 11 ++ scripts/CVS/Entries.Log | 1 + scripts/CVS/Repository | 1 + scripts/CVS/Root | 1 + scripts/makeyhttpd.pl | 3 +- scripts/modules/CVS/Entries | 2 + scripts/modules/CVS/Repository | 1 + scripts/modules/CVS/Root | 1 + src/CVS/Entries | 23 +++ src/CVS/Entries.Log | 14 ++ src/CVS/Repository | 1 + src/CVS/Root | 1 + src/chat/CVS/Entries | 17 ++ src/chat/CVS/Repository | 1 + src/chat/CVS/Root | 1 + src/chat/base.h | 4 - src/chat/base.tmpl | 30 ---- src/chat/chat.cpp | 8 +- src/chat/chat.h | 1 - src/chat/gcol.cpp | 2 - src/chat/room.cpp | 10 -- src/chat/room.h | 2 - src/chat/sman.cpp | 20 +-- src/chat/sman.h | 3 +- src/chat/user.cpp | 41 ++--- src/chat/user.h | 8 +- src/cli/CVS/Entries | 3 + src/cli/CVS/Repository | 1 + src/cli/CVS/Root | 1 + src/cli/cli.cpp | 29 --- src/cli/cli.h | 8 +- src/conf/CVS/Entries | 3 + src/conf/CVS/Repository | 1 + src/conf/CVS/Root | 1 + src/conf/conf.cpp | 9 +- src/configure | 10 +- src/contrib/CVS/Entries | 2 + src/contrib/CVS/Entries.Log | 2 + src/contrib/CVS/Repository | 1 + src/contrib/CVS/Root | 1 + src/contrib/crypt/CVS/Entries | 5 + src/contrib/crypt/CVS/Repository | 1 + src/contrib/crypt/CVS/Root | 1 + src/contrib/xml/CVS/Entries | 6 + src/contrib/xml/CVS/Repository | 1 + src/contrib/xml/CVS/Root | 1 + src/data/CVS/Entries | 10 ++ src/data/CVS/Repository | 1 + src/data/CVS/Root | 1 + src/glob.h | 68 +++---- src/html.cpp | 3 +- src/irc/CVS/Entries | 1 + src/irc/CVS/Repository | 1 + src/irc/CVS/Root | 1 + src/main.cpp | 4 +- src/maps/CVS/Entries | 9 + src/maps/CVS/Repository | 1 + src/maps/CVS/Root | 1 + src/maps/shashmap.h | 9 +- src/maps/shashmap.tmpl | 14 -- src/memb/CVS/Entries | 5 + src/memb/CVS/Repository | 1 + src/memb/CVS/Root | 1 + src/memb/memb.h | 74 +------- src/memb/memb.tmpl | 91 +--------- src/memb/tupel.h | 26 --- src/memb/tupel.tmpl | 38 +--- src/modl.h | 2 +- src/mods/CVS/Entries | 3 + src/mods/CVS/Entries.Log | 3 + src/mods/CVS/Repository | 1 + src/mods/CVS/Root | 1 + src/mods/commands/CVS/Entries | 32 ++++ src/mods/commands/CVS/Repository | 1 + src/mods/commands/CVS/Root | 1 + src/mods/commands/Makefile | 48 +++++ src/mods/commands/Makefile.in | 2 +- src/mods/html/CVS/Entries | 9 + src/mods/html/CVS/Repository | 1 + src/mods/html/CVS/Root | 1 + src/mods/html/Makefile | 25 +++ src/mods/html/Makefile.in | 4 +- src/mods/irc/CVS/Entries | 1 + src/mods/irc/CVS/Repository | 1 + src/mods/irc/CVS/Root | 1 + src/msgs.h | 14 +- src/ncur/CVS/Entries | 5 + src/ncur/CVS/Repository | 1 + src/ncur/CVS/Root | 1 + src/reqp.cpp | 50 +++--- src/reqp.h | 7 +- src/sock/CVS/Entries | 3 + src/sock/CVS/Repository | 1 + src/sock/CVS/Root | 1 + src/sock/sock.cpp | 321 +++++++-------------------------- src/sock/sock.h | 38 ++-- src/stats.cpp | 167 ++++++++--------- src/stats.h | 23 +-- src/thrd/CVS/Entries | 5 + src/thrd/CVS/Repository | 1 + src/thrd/CVS/Root | 1 + src/thrd/pool.cpp | 9 +- src/thrd/pool.h | 7 +- src/time/CVS/Entries | 5 + src/time/CVS/Repository | 1 + src/time/CVS/Root | 1 + src/tool/CVS/Entries | 5 + src/tool/CVS/Repository | 1 + src/tool/CVS/Root | 1 + src/wrap.cpp | 70 +++----- src/wrap.h | 14 +- 147 files changed, 1142 insertions(+), 1057 deletions(-) create mode 100644 CVS/Entries create mode 100644 CVS/Entries.Log create mode 100644 CVS/Repository create mode 100644 CVS/Root create mode 100644 SNAPSHOT create mode 100644 VERSION create mode 100644 bin/CVS/Entries create mode 100644 bin/CVS/Repository create mode 100644 bin/CVS/Root create mode 100644 docs/CVS/Entries create mode 100644 docs/CVS/Repository create mode 100644 docs/CVS/Root create mode 100644 etc/CVS/Entries create mode 100644 etc/CVS/Repository create mode 100644 etc/CVS/Root create mode 100644 html/CVS/Entries create mode 100644 html/CVS/Entries.Log create mode 100644 html/CVS/Repository create mode 100644 html/CVS/Root create mode 100644 html/images/CVS/Entries create mode 100644 html/images/CVS/Repository create mode 100644 html/images/CVS/Root create mode 100644 log/CVS/Entries create mode 100644 log/CVS/Entries.Log create mode 100644 log/CVS/Repository create mode 100644 log/CVS/Root create mode 100644 log/rooms/CVS/Entries create mode 100644 log/rooms/CVS/Repository create mode 100644 log/rooms/CVS/Root create mode 100644 scripts/CVS/Entries create mode 100644 scripts/CVS/Entries.Log create mode 100644 scripts/CVS/Repository create mode 100644 scripts/CVS/Root create mode 100644 scripts/modules/CVS/Entries create mode 100644 scripts/modules/CVS/Repository create mode 100644 scripts/modules/CVS/Root create mode 100644 src/CVS/Entries create mode 100644 src/CVS/Entries.Log create mode 100644 src/CVS/Repository create mode 100644 src/CVS/Root create mode 100644 src/chat/CVS/Entries create mode 100644 src/chat/CVS/Repository create mode 100644 src/chat/CVS/Root create mode 100644 src/cli/CVS/Entries create mode 100644 src/cli/CVS/Repository create mode 100644 src/cli/CVS/Root create mode 100644 src/conf/CVS/Entries create mode 100644 src/conf/CVS/Repository create mode 100644 src/conf/CVS/Root create mode 100644 src/contrib/CVS/Entries create mode 100644 src/contrib/CVS/Entries.Log create mode 100644 src/contrib/CVS/Repository create mode 100644 src/contrib/CVS/Root create mode 100644 src/contrib/crypt/CVS/Entries create mode 100644 src/contrib/crypt/CVS/Repository create mode 100644 src/contrib/crypt/CVS/Root create mode 100644 src/contrib/xml/CVS/Entries create mode 100644 src/contrib/xml/CVS/Repository create mode 100644 src/contrib/xml/CVS/Root create mode 100644 src/data/CVS/Entries create mode 100644 src/data/CVS/Repository create mode 100644 src/data/CVS/Root create mode 100644 src/irc/CVS/Entries create mode 100644 src/irc/CVS/Repository create mode 100644 src/irc/CVS/Root create mode 100644 src/maps/CVS/Entries create mode 100644 src/maps/CVS/Repository create mode 100644 src/maps/CVS/Root create mode 100644 src/memb/CVS/Entries create mode 100644 src/memb/CVS/Repository create mode 100644 src/memb/CVS/Root create mode 100644 src/mods/CVS/Entries create mode 100644 src/mods/CVS/Entries.Log create mode 100644 src/mods/CVS/Repository create mode 100644 src/mods/CVS/Root create mode 100644 src/mods/commands/CVS/Entries create mode 100644 src/mods/commands/CVS/Repository create mode 100644 src/mods/commands/CVS/Root create mode 100644 src/mods/commands/Makefile create mode 100644 src/mods/html/CVS/Entries create mode 100644 src/mods/html/CVS/Repository create mode 100644 src/mods/html/CVS/Root create mode 100644 src/mods/html/Makefile create mode 100644 src/mods/irc/CVS/Entries create mode 100644 src/mods/irc/CVS/Repository create mode 100644 src/mods/irc/CVS/Root create mode 100644 src/ncur/CVS/Entries create mode 100644 src/ncur/CVS/Repository create mode 100644 src/ncur/CVS/Root create mode 100644 src/sock/CVS/Entries create mode 100644 src/sock/CVS/Repository create mode 100644 src/sock/CVS/Root create mode 100644 src/thrd/CVS/Entries create mode 100644 src/thrd/CVS/Repository create mode 100644 src/thrd/CVS/Root create mode 100644 src/time/CVS/Entries create mode 100644 src/time/CVS/Repository create mode 100644 src/time/CVS/Root create mode 100644 src/tool/CVS/Entries create mode 100644 src/tool/CVS/Repository create mode 100644 src/tool/CVS/Root diff --git a/CHANGES b/CHANGES index 62b0389..6fdf12e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,29 +1,3 @@ --Changes from 0.7.9.3-STABLERELEASE to 0.7.9.4-STABLERELEASE - -$ Removed the TODO list. All major feature changes will be in the CURRENT -$ branch. -$ Added the SHORTDESC file -$ Changed Copyright to "EXA Digital Solutions GbR" - --Changes from 0.7.9.2-RELEASE to 0.7.9.3-STABLERELEASE - -$ The 0.7 branch is now STABLE. -$ Modified the Makefiles, so that they produce valid output while using -$ the -j flag of gmake. -$ Fixed a mini bug in the src/configure script. -$ Backported some security related HTTP patches from the 0.8-CURRENT branch. - --Changes from 0.7.9.1-RELEASE to 0.7.9.2-RELEASE - -$ Added monitor/dump, and the dump command to the CLI. -$ Fixed a bug in the session manager. -$ Added gmake dist do the README. -$ Added the charset to the HTTP-header. - --Changes from 0.7.9-RELEASE to 0.7.9.1-RELEASE - -$ Fixed etc/ychat.conf (Its now valid XML) -$ Fixed some typos. -$ Added the scripts/makedist.sh script, which can be invoked by gmake dist. -$ yhttpd.org has been renamed to yChat.org. The yhttpd.org SLD will be -$ canceled! The yhttpd.org Homepage will remain on yChat.org! - -Changes from 0.7.8-RELEASE to 0.7.9-RELEASE - $ In the system messages will be the user printed which has requested the specified module. diff --git a/CVS/Entries b/CVS/Entries new file mode 100644 index 0000000..5c1d2f7 --- /dev/null +++ b/CVS/Entries @@ -0,0 +1,10 @@ +/CHANGES/1.37/Thu Mar 10 22:01:54 2005// +/COPYING/1.6/Sun Jun 27 06:32:26 2004// +/INSTALL/1.7/Fri Jul 9 22:33:20 2004// +/Makefile/1.36/Sun Mar 6 23:40:15 2005// +/NEWS/1.44/Thu Mar 10 22:01:54 2005// +/README/1.120/Thu Mar 10 22:01:54 2005// +/RELEASES/1.17/Mon Mar 7 22:41:12 2005// +/TODO/1.75/Sat Mar 5 00:15:23 2005// +/configure/1.34/Fri Mar 4 21:00:44 2005// +D diff --git a/CVS/Entries.Log b/CVS/Entries.Log new file mode 100644 index 0000000..ebf29e1 --- /dev/null +++ b/CVS/Entries.Log @@ -0,0 +1,7 @@ +A D/bin//// +A D/docs//// +A D/etc//// +A D/html//// +A D/log//// +A D/scripts//// +A D/src//// diff --git a/CVS/Repository b/CVS/Repository new file mode 100644 index 0000000..7c108c7 --- /dev/null +++ b/CVS/Repository @@ -0,0 +1 @@ +ychat diff --git a/CVS/Root b/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/Makefile b/Makefile index b3c5ca8..3194650 100755 --- a/Makefile +++ b/Makefile @@ -84,5 +84,3 @@ debug: @gdb bin/ychat ychat.core confdebug: ./configure -g3 -ggdb -dist: - @./scripts/makedist.sh diff --git a/NEWS b/NEWS index 36459e3..87f9e19 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,20 @@ -::(06.11.04)::Released yChat and yhttpd 0.7.1-RELEASE. Added ${MAKE} to the config file because some Linux distros dont use the "gmake" command for GNU make but just "make"! Modified the configure script to generate a make.version file. Removed some typos from the ychat.conf. Fixed the auto away message. This one will be posted in the room as public rather than only private to the auto-away-user.Fixed some documentation stuff for yhttpd because yhttpd does not need MySQL at all. Added the chat.maxlength.word option. +::(10.03.05)::Released yChat 0.7.9. The logging capability has been improved. All chat command requests will be logged. The ncurses interface has been improved. Some code has been cleaned up. +::(07.03.05)::Released yChat 0.5.4. This is a STABLERELEASE. The HTTP parsing methods have been backported from yChat 0.7.8. Also some minor bugfixes were made.This is the first STABLERELEASE of yChat ever. +::(05.03.05)::Released yChat 0.7.8. This release includes an IP cache for more speed. An UNIX signal catcher class has been added. SIGUSR1 and SIGUSR2 now clean the template cache or reload all dynamic modules. Added "Allow" to the HTTPD header. Also, lots of Bugfixes and minor improvements were made. Changed the 0.5 branch into STABLE. The 0.5.4-STABLERELEASE will follow next week. The ychat-stable CVS branch has been opened, which now points to ychat-0.5. +::(02.03.05)::Released yChat 0.5.3. This is a LEGACYRELEASE. It includes a stats generation script located in the scripts/ directory which can be called by gmake stats. Also all the sources have been moved to ./src. Some minor bugfixes are included also. +::(27.02.05)::Released yChat 0.5.2. This is a LEGACYRELEASE. That means, that this version is not official supported. The 0.5.2 version might be interesting by developers who want to have a clean base structure of an existing C++ based chat system. The 0.5.2 version does not have any features besides logging in and single room chatting. Multi rooms can be added easily. +::(24.02.05)::Released yChat 0.7.7.1. This release only includes a yChat startup bugfix. +::(17.02.05)::Released yChat 0.7.6. This release now uses the hash_map class from the SGI STL extension which is more stable then the old Hash Map used by yChat. +::(14.02.05)::Released yChat 0.7.5. The garbage collector will now run once a hour. The dynamic thread pool has been improved. Removed thre equiv-http-refresh meta tag from the online list. Added a minor bugfix in the /topic command. Implemented an HTML based list of all logged in users and the /users command which does the same. +::(13.02.05)::Released yChat 0.7.4.1 This new version includes a major bugfix made in the new dynamic thread pool which has been introdouced in 0.7.4. The bug resulted in a thread pool dead lock.. Tagged yChat 0.7.5-CURRENT into CVS. +::(12.02.05)::Released yChat 0.7.4. This release includes a code cleanup and a dynamic increasing thread pool. Also, some other thread pool and session engine improvements were made. The Makefiles got more organized and the HTTPD header has got a Content-length line. The Content-type text/plain is now also supported. The command line interface has got the ! (bang) operator. So you can run programs of your shell through yChat. The HTML interface has got a scrolling checkbox to de/activate the scrolling of the chat stream. Last but not least some bugfixes were made. +::(09.02.05)::Tagged yChat 0.7.4-PRERELEASE into CVS. The RELEASE will follow this week. +::(08.01.05)::We passed the build number 3000! 3000 times yChat has been compiled during the developing process since there are build numbers! Also the first steps have been made porting yChat/yhttpd to the Windows platform using Cygwin (yChat 0.7.4-CURRENT Build 3040 CYGWIN_NT-5.1 1.5.12 (0.116/4/2) i686). It runs without having installed Cygwin and having an 1MB cygwin1.dll file instead. There are still some issues (like dynamic modules [which means, that there are no chat commands and no color choser etc], command line interface, ncurses interface, database support) which do not yet run on Cygwin. But those issues will be resolved the next weeks. An alpha (experimental) binary yChat/Win32 release might be done also. +::(04.01.05)::First we wish all of you a happy new year. Second we have to announce that yhttpd 0.7-CURRENT now also has tested on an OpenBSD/i386 MP 3.6 box with success. Also yChat 0.7.4-CURRENT is now available from CVS. +::(29.12.04)::Released yChat 0.7.3-RELEASE. New features: Added the /all command (Global system message), added FreeBSD 5.3-RELEASE support, added chat.enableguest option. Renamed the /getstatus command into /about. Fixed some bugs. +::(09.11.04)::Released yChat 0.7.2-RELEASE. New features: /morph. Added the new standard html template design. Bugfixes: /away prints a . instead of a : if no away reason is given. /ko message was wrong. Displayed not room name of the user to be kicked out. /invisible command displayed wrong private messages. /getstatus had no help text. /msg and /s should now print the system time if printalwaystime == true. Added a blank to the /uptime message. /topic now prints the topic in the user's color. +- Fixed some typos. +::(06.11.04)::Released yChat and yhttpd 0.7.1-RELEASE. Added ${MAKE} to the Make file because some Linux distros dont use the "gmake" command for GNU make but just "make"! Modified the configure script to generate a make.version file. Removed some typos from the ychat.conf. Fixed the auto away message. This one will be posted in the room as public rather than only private to the auto-away-user. Fixed some documentation stuff for yhttpd because yhttpd does not need MySQL at all. Added the chat.maxlength.word option. ::(02.11.04)::We now provided a yhttpd-0.7.tar.bz2 file for download which is a source code package of the HTTP kernel of yChat. This one can be used as a stand alone web server. Also a yhttpd branch will be created for yhttpd as well. :) We also started to work on the 0.7.x-CURRENT versions which will become some day 0.8-RELEASE. ::(01.11.04)::We now provided a ychat-0.7.tar.bz2 file for download which is a source code package of the release we made yesterday. It also contains some fixes since then. You can download it on this site under Sourcecode -> Source packages -> CPP-yChat. :) ::(31.10.04)::After a long yChat 0.7-CURRENT developing phase we are proud to anounce yChat 0.7-RELEASE. By now, there may not any 0.7 release source packages for download available but you can fetch the release from the current cvs instead until source packages are available. This release has the biggest change log ever in yChat history. Here are some highlights: Included color switcher user interface, smart garbage collection engine, real MySQL support, nick registration + password protection, completly rewritten configure and Makefile scripts, perl script for source code stats, system_log and room_log, logout button, string replace for smileys e.g., additional CLI mode in parallel to the ncurses mode for the admin interface, memory watching, HTTP POST request handling in addition to POST request handling, CGI support, md5-summing of session ids to make reverse engineering of sessions harder, yhttpd generation script out of the yChat source tree, XML based configuration file, and lots of new configuration options which we can't list all here. yChat 0.7-RELEASE is known to compile and work correctly with GNU G++ 3.1, 3.2, 3.3 and 3.4. This announcement will be as well on Freshmeat.net on monday. diff --git a/README b/README index e49c7bb..75498f2 100755 --- a/README +++ b/README @@ -1,8 +1,7 @@ -yChat; Homepage: www.yChat.org; Version 0.7.9.4-RELEASE +yChat; Homepage: www.yChat.org; Version 0.7.9-RELEASE Copyright (C) 2003 Paul C. Buetow, Volker Richter -Copyright (C) 2004 Paul C. Buetow -Copyright (C) 2005 EXA Digital Solutions GbR +Copyright (C) 2004, 2005 Paul C. Buetow ----------------------------------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -37,7 +36,7 @@ YCHAT TABLE OF CONTENTS: 1.7.0 WRITING BUG REPORTS 1.8.0 CONTACT 1.9.0 YHTTPD CODE BASE GENERATION //<< -2.0.0 CREDITS +2.0.0 LICENSE 0.0.0 ABOUT RELEASES @@ -54,7 +53,7 @@ apache. yhttpd is a subset of the chat. It can be generated using the srcipts/yhttpdbase.pl script in the chat's source tree. - The ycurses - -ycurses is a easy to use and small C++ wrapper of the C ncurses API. +ycurses is a easy to use and small C++ wrapper of the C ncurses API. The There are different branches: @@ -268,7 +267,7 @@ homepage which is located at http://www.yChat.org. yChat can be downloaded as a source package or through CVS. The packages are located at http://www.yChat.org -> Sourcecode -> -Packages or go to http://pub.buetow.org/yChat/yChat . +Packages or go to http://pub.buetow.org/yChat/CPP-yChat . For CVS download type: @@ -319,7 +318,6 @@ or gmake config): gmake confdebug (runs ./configure with enabling debugging) gmake config (runs yChat configurator) gmake debug (runs gdb on ./ychat.core) - gmake dist (creates a .tar.bz2 ball) gmake gpl (shows the GNU General Public License) gmake help (shows all available ychat gmake targets) gmake mail (sends a mail to the yChat developers containing build opts.) @@ -465,7 +463,7 @@ src/msgs.h - Defines some server side messages How to submit a good bug report? -Send them to mail at yChat dot org. +Send them to Bug@yChat.org. First you should give the following information: - yChat version, if CVS (or devel. tarball) then which day? @@ -511,7 +509,7 @@ If you dont get such a gdb output, you need to recompile the yChat using debuggig symbols. You can do it this way: cd ychat -gmake clean confdebug all run +gmake confdebug all run 1.8 CONTACT: @@ -519,10 +517,10 @@ You may contact us through the following addresses: - Homepage The yChat homepage is located at http://www.yChat.org - The EXA Digital Solutions homepage is located at http://www.exa-ds.com - E-Mail - Paul C. Buetow: Buetow at yChat point org ( core developer ) + Paul C. Buetow: Snooper at yChat point org ( core developer ) + Volker Richter: Rover at yChat dot org ( core developer ) Mail at yChat dot org ( reaches everybody of yChat ) - ICQ @@ -531,24 +529,350 @@ You may contact us through the following addresses: - IRC #Ychat and #Coding at irc.german-elite.net -- EXA Digital Solutions GbR - Laubenstr. 16b - D-44866 Bochum - Germany - //<<* 1.9.0 YHTTPD CODE BASE GENERATION See docs/yhttpd.txt //*>> -2.0.0 CREDITS - -Thanks to the following persons. Without them yChat would not be like today: - -- Volker Richter of EXA Digital Solutions GbR - (http://www.exa-ds.com) for adding initial MySQL support and lots of more - code. - -- Joshia Teitelbaum of CryptpMail.org for adding - lots of security patches in the HTTP header handling. +2.0.0 LICENSE + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/RELEASES b/RELEASES index b7fbdb2..1d5895a 100644 --- a/RELEASES +++ b/RELEASES @@ -1,43 +1,33 @@ Release table -Release date Release name and version Release focus +Release date Branch Release focus -Planing: yChat 0.9.0-RELEASE New current branch -Planing: yhttpd 0.8-RELEASE Features -Planing: yChat 0.8.4-STABLERELEASE New stable branch -Planing: yChat 0.8.3-RELEASE New functionality +Planing: yXML 0.1-RELEASE_________ Initial release +Planing: yhttpd 0.7.2-RELEASE_____ Features +Planing: yChat 0.7.9-RELEASE______ N/A -Nov 21st 05: yChat 0.7.9.5-STABLERELEASE Maintenance -Aug 04th 05: yChat 0.8.2-RELEASE Minor enhancements -May 26th 05: yChat 0.7.9.4-STABLERELEASE Minor bugfixes -Jun 21st 05: yChat 0.8.1-RELEASE Major features -May 25th 05: yChat 0.8.0-RELEASE Major features -May 08th 05: yChat 0.7.9.3-STABLERELEASE Security bugfixes -Apr 11th 05: yChat 0.5.5-STABLERELEASE Minor security fixes -Apr 10th 05: yChat 0.7.9.2-RELEASE Major security fixes -Apr 07th 05: yChat 0.7.9.1-RELEASE Minor bugfixes -Mar 11th 05: yChat 0.7.9-RELEASE -Mar 08th 05: yChat 0.5.4-STABLERELEASE -Mar 05th 05: yChat 0.7.8-RELEASE -Mar 02th 05: yChat 0.5.3-LEGACYRELEASE -Feb 27th 05: yChat 0.5.2-LEGACYRELEASE -Feb 24th 05: yChat 0.7.7.1-RELEASE Major bugfixes -Feb 21th 05: yChat 0.7.7-RELEASE -Feb 18th 05: yChat 0.7.6-RELEASE -Feb 15th 05: yChat 0.7.5-RELEASE -Feb 14th 05: yChat 0.7.4.1-RELEASE Major bugfixes -Feb 12th 05: yChat 0.7.4-RELEASE -Feb 10th 05: yChat 0.7.4-PRERELEASE -Dec 29th 04: yChat 0.7.3-RELEASE -Nov 09th 04: yChat 0.7.2-RELEASE -Nov 06th 04: yhttpd 0.7.1-RELEASE -Nov 06th 04: yChat 0.7.1-RELEASE -Nov 01st 04: yhttpd 0.7-RELEASE Initial release -Oct 31st 04: yChat 0.7-RELEASE -Jan 03rd 04: yChat 0.5.1-RELEASE -Sep 15th 03: yChat 0.6-RELEASE -Sep 15th 03: yChat 0.5.0-RELEASE -Apr 26th 03: yChat 0.4-RELEASE -Mar 30th 03: yChat 0.3-RELEASE -Mar 24th 03: yChat 0.2-RELEASE -Mar 20th 03: yChat 0.1-RELEASE Initial release +Mar 08th 05: yChat 0.5.4-STABLERELEASE Minor improvements +Mar 05th 05 yChat 0.7.8-RELEASE______ Features +Mar 02th 05 yChat 0.5.3-LEGACYRELEASE Minor improvements +Feb 27th 05 yChat 0.5.2-LEGACYRELEASE Bugfixes, code cleanup +Feb 24th 05 yChat 0.7.7.1-RELEASE____ Bugfix +Feb 21th 05 yChat 0.7.7-RELEASE______ Code cleanup +Feb 18th 05 yChat 0.7.6-RELEASE______ Improvements +Feb 15th 05 yChat 0.7.5-RELEASE______ Features, bugfixes +Feb 14th 05 yChat 0.7.4.1-RELEASE____ Bugfix +Feb 12th 05 yChat 0.7.4-RELEASE______ Bugfixes, improvements, feat. +Feb 10th 05 yChat 0.7.4-PRERELEASE___ Bugfixes, improvements, feat. +Dec 29th 04 yChat 0.7.3-RELEASE______ Bugfixes, features +Nov 09th 04 yChat 0.7.2-RELEASE______ Bugfixes, features +Nov 06th 04 yhttpd 0.7.1-RELEASE_____ Bugfixes +Nov 06th 04 yChat 0.7.1-RELEASE______ Bugfixes +Nov 01st 04 yhttpd 0.7-RELEASE_______ Initial release +Oct 31st 04 yChat 0.7-RELEASE________ Cleanup, features +Jan 03rd 04 yChat 0.5.1-RELEASE______ Cleanup, bugfixes +Sep 15th 03 yChat 0.6-RELEASE________ Cleanup, features +Sep 15th 03 yChat 0.5.0-RELEASE______ Features +Apr 26th 03 yChat 0.4-RELEASE________ Features +Mar 30th 03 yChat 0.3-RELEASE________ Features +Mar 24th 03 yChat 0.2-RELEASE________ Bugfixes +Mar 20th 03 yChat 0.1-RELEASE________ Initial release + diff --git a/SNAPSHOT b/SNAPSHOT new file mode 100644 index 0000000..f780508 --- /dev/null +++ b/SNAPSHOT @@ -0,0 +1 @@ +Thu Mar 10 23:59:06 CET 2005 diff --git a/TODO b/TODO index 5c3176a..009aa00 100644 --- a/TODO +++ b/TODO @@ -1,41 +1,37 @@ -To do for next RELEASE: -- Flood protection -- Make CLI accessible through a chat command /cli -- Fixing logging bug (do not log any timestamps if there are no messages) -- Remove sess.cpp, use sman.cpp only. +- Must do's for next RELEASE - +$ Add thread pool decreasing -To do in general: -- Remove user.cpp member variables as possible and replace them with hash maps - for (integer,mutex) and (string,mutex) pairs. Maybe use s.t. like this: - p_user->val("name"); to get the users name and p_user->val("name","val"); to - reset his name. Maybe use templates to get different types besides strings: - p_user->val("hits"); -- Add socket timeouts -- Improve some HTTPD-Stuff -- Add traffic stats -- Write changes of the configuration back into XML if wished. -- Add scroll pause button to input.html -- Add some chat commands -- Make more values of the conf object dynamic (on the fly changable by the CLI) -- Make the thread pool size dynamic -- Remove inline methods -- New dynamic command permission method - The admin should allow/deny commands for each user seperately -- Add PostgreSQL support -- Add SQLite support -- Add SSL sockets with OpenSSL -- Add user profiles -- Add action form to input.html -- FreeBSD ports tree inclusion -- Several HTML styles, each user can use his favourite style -- Chat moderator option -- Possibility sending Mails through external SMTP server - (for password reminder etc) -- Advanced chat statistics -- Add IRC support -- Add ICQ support -- Add MPI support (load balancing) -- Forum -- Compatibility to Opera, Links, Konqueror and Safari -- Add browser side caching for gfx files support +- Might do's for next RELEASE - +$ dir : public vector +$ Disable /help command for commands wich are not accessible for the +$ specific user. +$ Flood protection +$ Add /nick, /beam, /su +$ Add / to whisper to the last person to whom the user has been whispered the last time. +- To do in general for some later RELEASE - +$ Use libevent +$ Not found sites should get a 404 error site! +$ Implement dynamic timer +$ Implement ncurse object browser +$ Implement yXML subproject +$ Implement ODBC support +$ Implement login counter. +$ Implement msg post counter. +$ Implement online time counter. +$ Implement hall of fame rankings of the counters above. Also add a msg/minute hall of fame. +$ Implement traffic stats +$ Implement more chat commands +$ Implement new dynamic command permission method +$ Implement SSL sockets with OpenSSL +$ Implement user profiles +$ Implement action form to input.html +$ Implement IRC support +$ Implement possibility sending Mails through external SMTP server (for password reminder etc) +$ Implement chat moderator option +$ Implement several HTML styles, each user can use his favourite style +$ Implement compatibility to Opera, Links, Konqueror and Safari +$ Implement browser side caching for gfx files support +$ Implement a http:// url detection and make a link out of it! +$ Remove user.cpp member variables as possible and replace them with hash maps +$ Write changes of the configuration back into XML if wished. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..7d257a3 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +yChat 0.7.9-RELEASE Build 3624 diff --git a/bin/CVS/Entries b/bin/CVS/Entries new file mode 100644 index 0000000..1784810 --- /dev/null +++ b/bin/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/bin/CVS/Repository b/bin/CVS/Repository new file mode 100644 index 0000000..8deb769 --- /dev/null +++ b/bin/CVS/Repository @@ -0,0 +1 @@ +ychat/bin diff --git a/bin/CVS/Root b/bin/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/bin/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/docs/CVS/Entries b/docs/CVS/Entries new file mode 100644 index 0000000..3bb528a --- /dev/null +++ b/docs/CVS/Entries @@ -0,0 +1,2 @@ +/yhttpd.txt/1.1/Sun Feb 13 07:57:19 2005// +D diff --git a/docs/CVS/Repository b/docs/CVS/Repository new file mode 100644 index 0000000..5b894aa --- /dev/null +++ b/docs/CVS/Repository @@ -0,0 +1 @@ +ychat/docs diff --git a/docs/CVS/Root b/docs/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/docs/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/etc/CVS/Entries b/etc/CVS/Entries new file mode 100644 index 0000000..308e5dd --- /dev/null +++ b/etc/CVS/Entries @@ -0,0 +1,2 @@ +/ychat.conf/1.47/Sat Mar 5 11:53:19 2005// +D diff --git a/etc/CVS/Repository b/etc/CVS/Repository new file mode 100644 index 0000000..912e435 --- /dev/null +++ b/etc/CVS/Repository @@ -0,0 +1 @@ +ychat/etc diff --git a/etc/CVS/Root b/etc/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/etc/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/etc/ychat.conf b/etc/ychat.conf index 0bdb3c1..3a9f788 100644 --- a/etc/ychat.conf +++ b/etc/ychat.conf @@ -1,5 +1,4 @@ - - + @@ -687,4 +686,3 @@ - diff --git a/html/CVS/Entries b/html/CVS/Entries new file mode 100644 index 0000000..19aa725 --- /dev/null +++ b/html/CVS/Entries @@ -0,0 +1,20 @@ +/admin.html/1.3/Sun Nov 7 02:24:57 2004// +/blank.html/1.1.1.1/Fri Jan 2 03:15:10 2004// +/colors.html/1.8/Sun Nov 7 02:24:57 2004// +/demo.html/1.4/Sun Nov 7 02:24:57 2004// +/favicon.ico/1.1.1.1/Fri Jan 2 03:15:10 2004// +/frameset.html/1.5/Sun Nov 7 02:24:57 2004// +/help.html/1.8/Mon Feb 14 20:09:50 2005// +/index.html/1.11/Sun Nov 7 02:37:57 2004// +/input.html/1.12/Mon Feb 14 18:01:22 2005// +/loggedin.html/1.1/Mon Feb 14 18:01:22 2005// +/notfound.html/1.2/Sat Mar 20 21:58:14 2004// +/online.html/1.7/Wed Feb 23 05:08:04 2005// +/options.html/1.6/Sun Nov 7 02:24:57 2004// +/register.html/1.10/Sun Nov 7 02:37:57 2004// +/robots.txt/1.1.1.1/Fri Jan 2 03:15:10 2004// +/stream.html/1.6/Sat Feb 19 11:08:50 2005// +/style.css/1.4/Sat Feb 19 11:08:50 2005// +/test.cgi/1.2/Sat Sep 25 04:12:43 2004// +/urlredirect.html/1.1/Sun Nov 7 00:33:14 2004// +D diff --git a/html/CVS/Entries.Log b/html/CVS/Entries.Log new file mode 100644 index 0000000..375967b --- /dev/null +++ b/html/CVS/Entries.Log @@ -0,0 +1 @@ +A D/images//// diff --git a/html/CVS/Repository b/html/CVS/Repository new file mode 100644 index 0000000..3648237 --- /dev/null +++ b/html/CVS/Repository @@ -0,0 +1 @@ +ychat/html diff --git a/html/CVS/Root b/html/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/html/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/html/images/CVS/Entries b/html/images/CVS/Entries new file mode 100644 index 0000000..d1a70e1 --- /dev/null +++ b/html/images/CVS/Entries @@ -0,0 +1,8 @@ +/away.gif/1.1.1.1/Fri Jan 2 03:15:10 2004// +/blank.gif/1.1.1.1/Fri Jan 2 03:15:10 2004// +/guest.png/1.1.1.1/Fri Jan 2 03:15:10 2004// +/ircuser.png/1.1/Fri Feb 27 15:00:34 2004// +/rang0.png/1.1.1.1/Fri Jan 2 03:15:10 2004// +/rang1.png/1.1.1.1/Fri Jan 2 03:15:10 2004// +/rang2.png/1.1.1.1/Fri Jan 2 03:15:10 2004// +D diff --git a/html/images/CVS/Repository b/html/images/CVS/Repository new file mode 100644 index 0000000..0559f67 --- /dev/null +++ b/html/images/CVS/Repository @@ -0,0 +1 @@ +ychat/html/images diff --git a/html/images/CVS/Root b/html/images/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/html/images/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/log/CVS/Entries b/log/CVS/Entries new file mode 100644 index 0000000..fc0a98f --- /dev/null +++ b/log/CVS/Entries @@ -0,0 +1,2 @@ +/.keepme/1.1.1.1/Fri Jan 2 03:15:10 2004// +D diff --git a/log/CVS/Entries.Log b/log/CVS/Entries.Log new file mode 100644 index 0000000..61896b1 --- /dev/null +++ b/log/CVS/Entries.Log @@ -0,0 +1 @@ +A D/rooms//// diff --git a/log/CVS/Repository b/log/CVS/Repository new file mode 100644 index 0000000..da99bfc --- /dev/null +++ b/log/CVS/Repository @@ -0,0 +1 @@ +ychat/log diff --git a/log/CVS/Root b/log/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/log/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/log/rooms/CVS/Entries b/log/rooms/CVS/Entries new file mode 100644 index 0000000..fc0a98f --- /dev/null +++ b/log/rooms/CVS/Entries @@ -0,0 +1,2 @@ +/.keepme/1.1.1.1/Fri Jan 2 03:15:10 2004// +D diff --git a/log/rooms/CVS/Repository b/log/rooms/CVS/Repository new file mode 100644 index 0000000..47e5409 --- /dev/null +++ b/log/rooms/CVS/Repository @@ -0,0 +1 @@ +ychat/log/rooms diff --git a/log/rooms/CVS/Root b/log/rooms/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/log/rooms/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/scripts/CVS/Entries b/scripts/CVS/Entries new file mode 100644 index 0000000..ac6ad99 --- /dev/null +++ b/scripts/CVS/Entries @@ -0,0 +1,11 @@ +/README/1.1/Tue Jun 29 23:38:15 2004// +/astyle.sh/1.2/Mon Feb 21 01:55:49 2005// +/buildnr.pl/1.4/Sun Feb 6 16:38:36 2005// +/checkperl.sh/1.1/Sat Feb 26 23:09:19 2005// +/config.pl/1.1/Sat Feb 26 21:14:55 2005// +/makeyhttpd.pl/1.15/Tue Mar 1 14:10:39 2005// +/screen.sh/1.1/Fri Mar 5 05:53:12 2004// +/setglobvals.pl/1.1.1.1/Fri Jan 2 03:15:10 2004// +/stats.pl/1.9/Mon Mar 7 22:32:34 2005// +/version.sh/1.2/Wed Feb 9 22:49:14 2005// +D diff --git a/scripts/CVS/Entries.Log b/scripts/CVS/Entries.Log new file mode 100644 index 0000000..786743d --- /dev/null +++ b/scripts/CVS/Entries.Log @@ -0,0 +1 @@ +A D/modules//// diff --git a/scripts/CVS/Repository b/scripts/CVS/Repository new file mode 100644 index 0000000..1ae4888 --- /dev/null +++ b/scripts/CVS/Repository @@ -0,0 +1 @@ +ychat/scripts diff --git a/scripts/CVS/Root b/scripts/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/scripts/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/scripts/makeyhttpd.pl b/scripts/makeyhttpd.pl index 7dd0345..6adcc96 100644 --- a/scripts/makeyhttpd.pl +++ b/scripts/makeyhttpd.pl @@ -40,7 +40,6 @@ my %substituate = ( 'yChat' => 'yhttpd', 'YCHAT' => 'YHTTPD', 'CHAT' => 'HTTPD', - 'yhttpd.org' => 'yChat.org', '//>>' => '' ); @@ -157,7 +156,7 @@ sub remove_marked_lines { sub edit_yhttpd_conf { my @old = fopen("etc/yhttpd.conf"); - my @new = @old[0..1]; + my @new = shift @old; my $flag = 0; for (@old) diff --git a/scripts/modules/CVS/Entries b/scripts/modules/CVS/Entries new file mode 100644 index 0000000..1490d42 --- /dev/null +++ b/scripts/modules/CVS/Entries @@ -0,0 +1,2 @@ +/file.pm/1.3/Tue Sep 7 17:00:25 2004// +D diff --git a/scripts/modules/CVS/Repository b/scripts/modules/CVS/Repository new file mode 100644 index 0000000..ac40d52 --- /dev/null +++ b/scripts/modules/CVS/Repository @@ -0,0 +1 @@ +ychat/scripts/modules diff --git a/scripts/modules/CVS/Root b/scripts/modules/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/scripts/modules/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/CVS/Entries b/src/CVS/Entries new file mode 100644 index 0000000..9f8fee6 --- /dev/null +++ b/src/CVS/Entries @@ -0,0 +1,23 @@ +/Makefile.in/1.22/Tue Sep 7 17:14:39 2004// +/configure/1.39/Sun Mar 6 20:44:47 2005// +/glob.h/1.74/Wed Mar 9 21:09:31 2005// +/html.cpp/1.23/Wed Feb 23 20:23:31 2005// +/html.h/1.11/Wed Feb 23 03:12:05 2005// +/incl.h/1.7/Wed Feb 23 03:12:05 2005// +/logd.cpp/1.15/Sun Feb 27 06:28:53 2005// +/logd.h/1.11/Wed Feb 23 03:12:05 2005// +/main.cpp/1.38/Sun Mar 6 20:44:47 2005// +/modl.cpp/1.19/Sun Mar 6 20:44:47 2005// +/modl.h/1.11/Sun Mar 6 20:44:47 2005// +/msgs.h/1.207/Thu Mar 10 22:01:54 2005// +/name.cpp/1.8/Mon Feb 21 01:55:49 2005// +/name.h/1.6/Mon Feb 21 01:55:49 2005// +/reqp.cpp/1.42/Sun Mar 6 20:44:47 2005// +/reqp.h/1.15/Wed Feb 23 03:12:05 2005// +/sign.cpp/1.3/Mon Mar 7 00:24:57 2005// +/sign.h/1.1/Fri Mar 4 02:41:30 2005// +/stats.cpp/1.10/Mon Feb 21 01:55:49 2005// +/stats.h/1.7/Mon Feb 21 01:55:49 2005// +/wrap.cpp/1.18/Sun Mar 6 20:44:47 2005// +/wrap.h/1.25/Sun Mar 6 20:44:47 2005// +D diff --git a/src/CVS/Entries.Log b/src/CVS/Entries.Log new file mode 100644 index 0000000..7d9d881 --- /dev/null +++ b/src/CVS/Entries.Log @@ -0,0 +1,14 @@ +A D/chat//// +A D/cli//// +A D/conf//// +A D/contrib//// +A D/data//// +A D/irc//// +A D/maps//// +A D/memb//// +A D/mods//// +A D/ncur//// +A D/sock//// +A D/thrd//// +A D/time//// +A D/tool//// diff --git a/src/CVS/Repository b/src/CVS/Repository new file mode 100644 index 0000000..47f3b3c --- /dev/null +++ b/src/CVS/Repository @@ -0,0 +1 @@ +ychat/src diff --git a/src/CVS/Root b/src/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/chat/CVS/Entries b/src/chat/CVS/Entries new file mode 100644 index 0000000..1eaa9f0 --- /dev/null +++ b/src/chat/CVS/Entries @@ -0,0 +1,17 @@ +/base.h/1.8/Mon Feb 21 01:55:49 2005// +/base.tmpl/1.6/Mon Feb 21 01:55:49 2005// +/chat.cpp/1.20/Fri Feb 25 00:15:38 2005// +/chat.h/1.12/Wed Feb 23 03:12:05 2005// +/gcol.cpp/1.7/Mon Feb 21 01:55:49 2005// +/gcol.h/1.5/Mon Feb 21 01:55:49 2005// +/perm.cpp/1.10/Mon Feb 21 01:55:49 2005// +/perm.h/1.8/Mon Feb 21 01:55:49 2005// +/room.cpp/1.11/Fri Mar 4 00:34:29 2005// +/room.h/1.8/Fri Mar 4 00:34:29 2005// +/sess.cpp/1.6/Mon Feb 21 01:55:49 2005// +/sess.h/1.6/Mon Feb 21 01:55:49 2005// +/sman.cpp/1.11/Mon Feb 21 01:55:49 2005// +/sman.h/1.6/Mon Feb 21 01:55:49 2005// +/user.cpp/1.18/Sun Mar 6 20:44:47 2005// +/user.h/1.11/Mon Feb 21 01:55:49 2005// +D diff --git a/src/chat/CVS/Repository b/src/chat/CVS/Repository new file mode 100644 index 0000000..6215e07 --- /dev/null +++ b/src/chat/CVS/Repository @@ -0,0 +1 @@ +ychat/src/chat diff --git a/src/chat/CVS/Root b/src/chat/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/chat/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/chat/base.h b/src/chat/base.h index b995c5c..9da4304 100755 --- a/src/chat/base.h +++ b/src/chat/base.h @@ -9,9 +9,6 @@ template class base : public nhashmap { -protected: - void dumpit(); - public: base(); ~base(); @@ -25,7 +22,6 @@ public: } virtual type* get_elem( string s_name, bool &b_found ); // get a element. - virtual type* get_elem( string s_name ); virtual void add_elem( type* p_type ); // add a element. // chat::msg_post sends to all users of the system a message. diff --git a/src/chat/base.tmpl b/src/chat/base.tmpl index 5b0fceb..0be21aa 100755 --- a/src/chat/base.tmpl +++ b/src/chat/base.tmpl @@ -21,14 +21,6 @@ base::get_elem( string s_name, bool &b_found ) return p_type; } -template -type* -base::get_elem( string s_name) -{ - bool b; - return get_elem(s_name, b); -} - template void base::add_elem( type* p_type ) @@ -36,26 +28,4 @@ base::add_elem( type* p_type ) nhashmap::add_elem(p_type, p_type->get_lowercase_name()); } -template -void -base::dumpit() -{ - dumpable::add("[base]"); - vector* p_vec = nhashmap::get_key_vector(); - - vector::iterator iter; - for (iter = p_vec->begin(); iter != p_vec->end(); ++iter) - { - dumpable::add(*iter); - type* p_elem = get_elem(*iter); - if (p_elem) - { - dumpable::next_no_newline(); - dumpable::add(p_elem->dump(dumpable::get_level())); - } - } - - delete p_vec; -} - #endif diff --git a/src/chat/chat.cpp b/src/chat/chat.cpp index e4cbaac..0839261 100755 --- a/src/chat/chat.cpp +++ b/src/chat/chat.cpp @@ -165,6 +165,7 @@ chat::login( map &map_params ) else { sess* p_sess = wrap::SMAN->create_session(); + //p_sess->set_value( string("nick"), (void *) new string(s_user) ); p_sess->set_user(p_user); map_params["tmpid"] = p_sess->get_tmpid(); p_user->set_tmpid( map_params["tmpid"] ); @@ -360,11 +361,4 @@ chat::string_replacer(string *p_msg) } } -void -chat::dumpit() -{ - dumpable::add("[chat]"); - base::dumpit(); -} - #endif diff --git a/src/chat/chat.h b/src/chat/chat.h index bb087d5..47645c3 100755 --- a/src/chat/chat.h +++ b/src/chat/chat.h @@ -23,7 +23,6 @@ class chat : public base, public perm private: map map_replace_strings; vector vec_replace_keys; - void dumpit(); public: virtual room* get_room( string s_name ) diff --git a/src/chat/gcol.cpp b/src/chat/gcol.cpp index d4c9416..7df111d 100755 --- a/src/chat/gcol.cpp +++ b/src/chat/gcol.cpp @@ -44,8 +44,6 @@ gcol::add_user_to_garbage( user* p_user ) p_user->s_mess_delete(); p_map_users->add_elem( p_user, tool::to_lower(p_user->get_name()) ); wrap::system_message( GARUSER + p_user->get_name() ); - p_user->destroy_session(); - #ifdef NCURSES print_garbage(); diff --git a/src/chat/room.cpp b/src/chat/room.cpp index 0e28c84..b927d40 100755 --- a/src/chat/room.cpp +++ b/src/chat/room.cpp @@ -101,14 +101,4 @@ room::set_name( string s_name ) #endif } -void -room::dumpit() -{ - dumpable::add("[room]"); - dumpable::add("Name: "+get_name()); - dumpable::add("Topic: "+get_topic()); - base::dumpit(); -} - - #endif diff --git a/src/chat/room.h b/src/chat/room.h index 4c5fac6..06b0a9a 100755 --- a/src/chat/room.h +++ b/src/chat/room.h @@ -23,8 +23,6 @@ private: logd* p_logd; #endif - - void dumpit(); public: room( string s_name ); diff --git a/src/chat/sman.cpp b/src/chat/sman.cpp index 530aa17..d80d421 100755 --- a/src/chat/sman.cpp +++ b/src/chat/sman.cpp @@ -21,33 +21,23 @@ sman::~sman() string sman::generate_id( int i_len ) { - string s_valid = wrap::CONF->get_elem("chat.session.validchars"); + string valid_chars = wrap::CONF->get_elem("chat.session.validchars"); string s_ret = ""; srand(time(0)+tool::string2int(wrap::CONF->get_elem("chat.session.kloakkey"))); int i_char; - for (int i = 0; i < i_len; i++) { - i_char = rand() % s_valid.length(); - s_ret += s_valid[i_char]; + i_char = rand() % 64; + s_ret += valid_chars[i_char]; } if ( wrap::CONF->get_elem("chat.session.md5hash") == "true" ) { string s_salt = wrap::CONF->get_elem("chat.session.md5salt"); - string s_hash(md5::MD5Crypt(s_ret.c_str(), s_salt.c_str())); - s_ret.append(s_hash.substr(s_ret.find(s_salt) + s_salt.length() + 3)); - } - - // Prove, if the TempID already exists - sess* p_sess = get_elem(s_ret); - - if (p_sess) - { - wrap::system_message(SESSEXI); - return generate_id(i_len); + s_ret = string(md5::MD5Crypt(s_ret.c_str(), s_salt.c_str())); + return s_ret.substr(s_ret.find(s_salt) + s_salt.length() + 3); } return s_ret; diff --git a/src/chat/sman.h b/src/chat/sman.h index 13fc45a..992fc64 100755 --- a/src/chat/sman.h +++ b/src/chat/sman.h @@ -7,11 +7,10 @@ #include "sess.h" #include "../maps/shashmap.h" -#include "../monitor/dump.h" using namespace std; -class sman : public shashmap +class sman : private shashmap { private: string generate_id( int i_len ); diff --git a/src/chat/user.cpp b/src/chat/user.cpp index bac8b7e..d46f853 100755 --- a/src/chat/user.cpp +++ b/src/chat/user.cpp @@ -73,27 +73,23 @@ user::initialize() void user::clean() { - destroy_session(); - set_fake( false ); - set_invisible( false ); - set_away( false, "" ); -} - -void -user::destroy_session() -{ - if ( !get_has_sess() ) - return; + // If this user has a session + if ( get_has_sess() ) + { #ifdef DATABASE - // Store all changed data into the mysql table if this user is registered: - if ( b_is_reg ) - wrap::DATA->update_user_data( get_name(), "savechangednick", map_changed_data ); + // Store all changed data into the mysql table if this user is registered: + if ( b_is_reg ) + wrap::DATA->update_user_data( get_name(), "savechangednick", map_changed_data ); #endif - set_has_sess(false); - wrap::SMAN->destroy_session(get_tmpid()); - set_tmpid(""); + wrap::SMAN->destroy_session( get_tmpid() ); + // wrap::system_message( SESSION + tool::int2string( wrap::SMAN->get_session_count() ) ); + } + + set_fake( false ); + set_invisible( false ); + set_away( false, "" ); } string @@ -581,15 +577,4 @@ void user::reconf() {} -void -user::dumpit() -{ - dumpable::add("[user]"); - dumpable::add("Name: " + get_name() + - "; Room: " + get_room()->get_name() + - "; Status: " + tool::int2string(get_status())); - dumpable::add("TempID: " + get_tmpid()); -} - - #endif diff --git a/src/chat/user.h b/src/chat/user.h index 4632e07..443eef6 100755 --- a/src/chat/user.h +++ b/src/chat/user.h @@ -5,13 +5,13 @@ #include "../name.h" #include "../time/timo.h" -#include "../monitor/dump.h" +//#include "../memb/memb.h" class room; using namespace std; -class user : public name, public timo, public dumpable +class user : public name, public timo//, public memb { private: @@ -56,8 +56,7 @@ private: pthread_mutex_t mut_map_changed_data; void initialize(); - void set_changed_data( string s_varname, string s_value ); - void dumpit(); + void set_changed_data( string s_varname, string s_value ); public: pthread_cond_t cond_message; @@ -68,7 +67,6 @@ public: ~user(); void clean(); - void destroy_session(); // gets specific data of this user und stores it in // (*p_map)["nick"]. this method will be used diff --git a/src/cli/CVS/Entries b/src/cli/CVS/Entries new file mode 100644 index 0000000..10c9656 --- /dev/null +++ b/src/cli/CVS/Entries @@ -0,0 +1,3 @@ +/cli.cpp/1.28/Mon Feb 28 18:03:02 2005// +/cli.h/1.13/Mon Feb 21 02:14:23 2005// +D diff --git a/src/cli/CVS/Repository b/src/cli/CVS/Repository new file mode 100644 index 0000000..4d44c85 --- /dev/null +++ b/src/cli/CVS/Repository @@ -0,0 +1 @@ +ychat/src/cli diff --git a/src/cli/CVS/Root b/src/cli/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/cli/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index cc0f5e5..96a0010 100755 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -37,8 +37,6 @@ cli::parse_input( string s_input ) cout << CLIPRMO << " (d)ebug - Starts debug routine (cli.cpp)" << endl; #endif - cout << CLIPRMO << " (du)mp [part] - Prints out a dump of the data structure" << endl; - cout << CLIPRMO << " (Run without part to list all possibilities)" << endl; cout << CLIPRMO << " (e)cho VAR - Prints out configuration value of VAR" << endl; cout << CLIPRMO << " Wildcards can be used too, example: echo http*" << endl; #ifdef NCURSES @@ -80,11 +78,6 @@ cli::parse_input( string s_input ) cout << CLIPRMI; } #endif - else if ( s_input.compare("du") == 0 || s_input.compare("dump") == 0 ) - { - dump d(vectorize(s_param)); - cout << CLIPRMI; - } else if( s_input.compare("echo") == 0 || s_input.compare("e") == 0 ) { string s_val; @@ -141,7 +134,6 @@ cli::parse_input( string s_input ) { cout << CLIPRMO; wrap::MODL->reload_modules(); - cout << MODRELO << endl; cout << CLIPRMI; } //*>> @@ -215,7 +207,6 @@ cli::parse_input( string s_input ) { cout << CLIPRMO; wrap::MODL->unload_modules(); - cout << MODUNLO << endl; cout << CLIPRMI; } //*>> @@ -294,26 +285,6 @@ cli::print_rusage() delete p_rusage; } -vector -cli::vectorize(string s_param) -{ - vector vec_ret; - unsigned i_pos; - - for (i_pos = s_param.find(" "); - i_pos != string::npos; - i_pos = s_param.find(" ")) - { - vec_ret.push_back(s_param.substr(0, i_pos)); - s_param = s_param.substr(i_pos+1); - } - - if (!s_param.empty()) - vec_ret.push_back(s_param); - - return vec_ret; -} - #ifdef DEBUG void cli::debug_routine() diff --git a/src/cli/cli.h b/src/cli/cli.h index 7d51e3f..23e1d1c 100755 --- a/src/cli/cli.h +++ b/src/cli/cli.h @@ -22,8 +22,6 @@ #include "../thrd/thro.h" #endif -#include "../monitor/dump.h" - using namespace std; #ifndef NCURSES @@ -34,9 +32,8 @@ class cli { #endif private: - int parse_input(string s_input); - vector vectorize(string s_param); - + int parse_input(string s_input); + public: cli( ); ~cli( ); @@ -55,6 +52,7 @@ void start(void* p_void); void start(); #endif + }; #endif diff --git a/src/conf/CVS/Entries b/src/conf/CVS/Entries new file mode 100644 index 0000000..cfb51ed --- /dev/null +++ b/src/conf/CVS/Entries @@ -0,0 +1,3 @@ +/conf.cpp/1.14/Sun Feb 27 06:28:53 2005// +/conf.h/1.11/Sun Feb 27 06:28:53 2005// +D diff --git a/src/conf/CVS/Repository b/src/conf/CVS/Repository new file mode 100644 index 0000000..28454e5 --- /dev/null +++ b/src/conf/CVS/Repository @@ -0,0 +1 @@ +ychat/src/conf diff --git a/src/conf/CVS/Root b/src/conf/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/conf/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/conf/conf.cpp b/src/conf/conf.cpp index 38c29c4..2e5893b 100755 --- a/src/conf/conf.cpp +++ b/src/conf/conf.cpp @@ -36,7 +36,6 @@ conf::conf( string s_conf, map* p_start_params ) : name::name( s_ cout << CFILEFA << endl; exit(1); } - else { cout << CFILEOK << "..." << endl; @@ -77,18 +76,12 @@ conf::parse_xml(TiXmlNode* p_node, vector* p_vec) { //cout << p_vec->size() << ": (Value:" << p_child->Value() << ") (Type:" << p_child->Type() << ")" << endl; - if ( strcmp(p_child->Value(),"config") == 0 ) - { - parse_xml(p_child, p_vec); - } - - else if ( strcmp(p_child->Value(),"category") == 0 ) + if ( strcmp(p_child->Value(),"category") == 0 ) { p_vec->push_back(p_child->ToElement()->Attribute("name")); parse_xml(p_child, p_vec); p_vec->pop_back(); } - else if ( strcmp(p_child->Value(),"option") == 0 ) { string s_option_name = ""; diff --git a/src/configure b/src/configure index 125890c..973e85a 100755 --- a/src/configure +++ b/src/configure @@ -70,7 +70,7 @@ perl -e ' remove_from_array("libmysqlclient.so",\@libs); } - if ( /\/\/#define NCURSES/ ) + elsif ( /\/\/#define NCURSES/ ) { remove_from_array("ncurses.h",\@headers); remove_from_array("libncurses.so",\@libs); @@ -158,21 +158,19 @@ perl -e ' print Fout "\t\@if ! test -d `dirname ../obj/$ofile`; then mkdir -p `dirname ../obj/$ofile`; fi\n"; my $class = $ofile; $class =~ s/\.o//; - - my $text; if ( $class =~ /contrib\/.+/ ) { my $dirname = `dirname $class`; - $text = "\t\@echo -n \"Contributed class $class \"\n"; + print Fout "\t\@echo -n \"Compiling contributed class $class \"\n"; } else { - $text = "\t\@echo -n \"Base class $class \"\n"; + print Fout "\t\@echo -n \"Compiling base class $class \"\n"; } print Fout "\t\@\$(CC) \$(CFLAGS) \$(INCLUDES) $args -c -o ../obj/$ofile $cppfile\n"; - print Fout $text."\t\@du -hc ../obj/$ofile | tail -n 1 | sed s/total// | sed \"s/ //g\"\n"; + print Fout "\t\@du -hc ../obj/$ofile | tail -n 1 | sed s/total// | sed \"s/ //g\"\n"; } close Fout; diff --git a/src/contrib/CVS/Entries b/src/contrib/CVS/Entries new file mode 100644 index 0000000..06e533f --- /dev/null +++ b/src/contrib/CVS/Entries @@ -0,0 +1,2 @@ +/README/1.2/Thu Sep 2 18:41:04 2004// +D diff --git a/src/contrib/CVS/Entries.Log b/src/contrib/CVS/Entries.Log new file mode 100644 index 0000000..ed82d0a --- /dev/null +++ b/src/contrib/CVS/Entries.Log @@ -0,0 +1,2 @@ +A D/crypt//// +A D/xml//// diff --git a/src/contrib/CVS/Repository b/src/contrib/CVS/Repository new file mode 100644 index 0000000..72ffe25 --- /dev/null +++ b/src/contrib/CVS/Repository @@ -0,0 +1 @@ +ychat/src/contrib diff --git a/src/contrib/CVS/Root b/src/contrib/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/contrib/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/contrib/crypt/CVS/Entries b/src/contrib/crypt/CVS/Entries new file mode 100644 index 0000000..78ab490 --- /dev/null +++ b/src/contrib/crypt/CVS/Entries @@ -0,0 +1,5 @@ +/how/1.1/Tue Aug 31 17:50:55 2004// +/md5.cpp/1.4/Mon Feb 21 01:55:49 2005// +/md5.h/1.4/Mon Feb 21 01:55:49 2005// +/md5crypt.cpp/1.4/Mon Feb 21 01:55:49 2005// +D diff --git a/src/contrib/crypt/CVS/Repository b/src/contrib/crypt/CVS/Repository new file mode 100644 index 0000000..d0db555 --- /dev/null +++ b/src/contrib/crypt/CVS/Repository @@ -0,0 +1 @@ +ychat/src/contrib/crypt diff --git a/src/contrib/crypt/CVS/Root b/src/contrib/crypt/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/contrib/crypt/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/contrib/xml/CVS/Entries b/src/contrib/xml/CVS/Entries new file mode 100644 index 0000000..baf8483 --- /dev/null +++ b/src/contrib/xml/CVS/Entries @@ -0,0 +1,6 @@ +/README/1.1/Tue Sep 7 17:28:34 2004// +/tinyxml.cpp/1.4/Mon Feb 21 01:55:49 2005// +/tinyxml.h/1.5/Mon Feb 21 01:55:49 2005// +/tinyxmlerror.cpp/1.4/Mon Feb 21 01:55:49 2005// +/tinyxmlparser.cpp/1.4/Mon Feb 21 01:55:49 2005// +D diff --git a/src/contrib/xml/CVS/Repository b/src/contrib/xml/CVS/Repository new file mode 100644 index 0000000..e2aeffc --- /dev/null +++ b/src/contrib/xml/CVS/Repository @@ -0,0 +1 @@ +ychat/src/contrib/xml diff --git a/src/contrib/xml/CVS/Root b/src/contrib/xml/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/contrib/xml/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/data/CVS/Entries b/src/data/CVS/Entries new file mode 100644 index 0000000..1c04c12 --- /dev/null +++ b/src/data/CVS/Entries @@ -0,0 +1,10 @@ +/README/1.1/Sun Apr 11 05:17:03 2004// +/con.cpp/1.9/Mon Feb 21 01:55:49 2005// +/con.h/1.7/Mon Feb 21 01:55:49 2005// +/con_base.cpp/1.7/Fri Jan 7 21:17:53 2005// +/con_base.h/1.8/Mon Feb 21 01:55:49 2005// +/data.cpp/1.13/Fri Feb 25 00:52:24 2005// +/data.h/1.10/Fri Feb 25 00:52:24 2005// +/data_base.cpp/1.15/Sun Mar 6 20:44:47 2005// +/data_base.h/1.12/Sun Mar 6 20:44:47 2005// +D diff --git a/src/data/CVS/Repository b/src/data/CVS/Repository new file mode 100644 index 0000000..430304a --- /dev/null +++ b/src/data/CVS/Repository @@ -0,0 +1 @@ +ychat/src/data diff --git a/src/data/CVS/Root b/src/data/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/data/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/glob.h b/src/glob.h index a0d980a..7d64126 100755 --- a/src/glob.h +++ b/src/glob.h @@ -1,11 +1,11 @@ /* Notice: - + All #defines which start with an CONFIG can be edited through gmake config in the main directory! */ -#include "maps/hashmap.h" +#include "maps/hashmap.h" // global variables. #ifndef GLOB_H @@ -18,15 +18,15 @@ //<<* /* FIRST THE YCHAT ONLY OPTIONS */ -/* - CONFIG - +/* - CONFIG - Should yChat get compiled with database support? Currently MyS- QL only is a supported database. */ //#define DATABASE #ifdef DATABASE -#define USE_MYSQL -/* - CONFIG - +#define USE_MYSQL +/* - CONFIG - Should all database queries printed out at the admin interface? (This option wont take action if database support has not been chosen) @@ -54,12 +54,12 @@ */ #define CONFILE "ychat.conf" -/* - DISABLED - +/* - DISABLED - Enable debugging options. */ //#define DEBUG -/* - DISABLED - +/* - DISABLED - If you want to enable EXPERIMENTAL features, then set this val- ue to true. Else use false which is recommended! All experimen- al features are marked inside of the running yChat! @@ -68,7 +68,7 @@ /* - CONFIG - Should yChat get compiled with logging support? -*/ +*/ #define LOGGING /* - CONFIG - @@ -80,33 +80,23 @@ */ #define MAXPORT 65535 -/* Specifies the max amount of lines to read from a HTTP request - header -*/ -#define MAXLINES 30 - -/* Specifies the max length of a lines to read from a HTTP request - header -*/ -#define MAXLENGTH 1024 - /* - CONFIG - Should yChat get compiled with ncurses support? -*/ +*/ #define NCURSES -/* - CONFIG - +/* - CONFIG - Please specify the maximum length of a HTTP post request. */ #define POSTBUF 512 -/* - CONFIG - +/* - CONFIG - Please specify the size of a temporary buffer. (Will be used f- or different tasks) */ #define READBUF 2048 -/* - CONFIG - +/* - CONFIG - Please specify the maximum length of a line read from a socket or a file. ( config-file, html-template ) */ @@ -133,7 +123,7 @@ */ //#define CTCSEGV -/* - CONFIG - +/* - CONFIG - Please chose if you want to use verbose server outputs or not. The verbose messages will appear in the ncurses menu if ncurses is enabled or in the server-window if yChat has been compiled @@ -149,42 +139,42 @@ // The following values define the positions of the data stats in the NCURSES interface. #ifdef NCURSES #define NCUR_SERVER_HEADER_X 21 -#define NCUR_SERVER_HEADER_Y 2 +#define NCUR_SERVER_HEADER_Y 2 #define NCUR_PORT_X 22 #define NCUR_PORT_Y 2 #define NCUR_HITS_X 23 #define NCUR_HITS_Y 2 #define NCUR_POOL_HEADER_X 21 -#define NCUR_POOL_HEADER_Y 16 +#define NCUR_POOL_HEADER_Y 16 #define NCUR_POOL_WAIT_X 22 -#define NCUR_POOL_WAIT_Y 16 +#define NCUR_POOL_WAIT_Y 16 #define NCUR_POOL_RUNNING_X 23 -#define NCUR_POOL_RUNNING_Y 16 +#define NCUR_POOL_RUNNING_Y 16 #define NCUR_DATA_HEADER_X 21 -#define NCUR_DATA_HEADER_Y 35 +#define NCUR_DATA_HEADER_Y 35 #define NCUR_GARBAGE_X 22 #define NCUR_GARBAGE_Y 35 -#define NCUR_CON_QUEUE_X 23 +#define NCUR_CON_QUEUE_X 23 #define NCUR_CON_QUEUE_Y 35 #define NCUR_CHAT_HEADER_X 21 #define NCUR_CHAT_HEADER_Y 52 #define NCUR_NUM_ROOMS_X 22 -#define NCUR_NUM_ROOMS_Y 52 +#define NCUR_NUM_ROOMS_Y 52 #define NCUR_SESSION_X 23 -#define NCUR_SESSION_Y 52 +#define NCUR_SESSION_Y 52 #define NCUR_CACHED_HEADER_X 21 -#define NCUR_CACHED_HEADER_Y 68 +#define NCUR_CACHED_HEADER_Y 68 #define NCUR_CACHED_DOCS_X 22 -#define NCUR_CACHED_DOCS_Y 68 -#define NCUR_CACHED_MODS_X 23 -#define NCUR_CACHED_MODS_Y 68 +#define NCUR_CACHED_DOCS_Y 68 +#define NCUR_CACHED_MODS_X 23 +#define NCUR_CACHED_MODS_Y 68 #define NCUR_MENU_CHAR_X 0 -#define NCUR_MENU_CHAR_Y 33 +#define NCUR_MENU_CHAR_Y 33 #define NCUR_UPTIME_X 0 #define NCUR_UPTIME_Y 44 #define NCUR_TIME_X 0 @@ -202,13 +192,13 @@ typedef int function( void *v_arg ); struct container { - void* elem[4]; + void* elem[4]; }; struct dynmod { - function *the_func ; - void *the_module; + function *the_func ; + void *the_module; }; typedef enum method_ { diff --git a/src/html.cpp b/src/html.cpp index 3f47867..4160f60 100755 --- a/src/html.cpp +++ b/src/html.cpp @@ -43,11 +43,12 @@ html::parse( map &map_params ) if ( ! if_templ ) { wrap::system_message( OFFFOUND + s_path ); - if(map_params["request"] == wrap::CONF->get_elem( "httpd.html.notfound" )) + if(map_params["request"]== wrap::CONF->get_elem( "httpd.html.notfound" )) return ""; map_params["request"] = wrap::CONF->get_elem( "httpd.html.notfound" ); return parse( map_params ); + } char c_buf; diff --git a/src/irc/CVS/Entries b/src/irc/CVS/Entries new file mode 100644 index 0000000..1784810 --- /dev/null +++ b/src/irc/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/src/irc/CVS/Repository b/src/irc/CVS/Repository new file mode 100644 index 0000000..5585e3c --- /dev/null +++ b/src/irc/CVS/Repository @@ -0,0 +1 @@ +ychat/src/irc diff --git a/src/irc/CVS/Root b/src/irc/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/irc/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/main.cpp b/src/main.cpp index 2bfe28c..6d0434f 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,7 @@ /* * yChat; Contact: www.yChat.org; Mail@yChat.org * Copyright (C) 2003 Paul C. Buetow, Volker Richter - * Copyright (C) 2004 Paul C. Buetow - * Copyright (C) 2005 EXA Digital Solutions GbR + * Copyright (C) 2004, 2005 Paul C. Buetow * ----------------------------------------------------------------- * * This program is free software; you can redistribute it and/or @@ -89,6 +88,7 @@ main(int argc, char* argv[]) wrap::init_wrapper(parse_argc(argc, argv)); + //<<* // Initialize database connection queue #ifdef DATABASE diff --git a/src/maps/CVS/Entries b/src/maps/CVS/Entries new file mode 100644 index 0000000..991bf8b --- /dev/null +++ b/src/maps/CVS/Entries @@ -0,0 +1,9 @@ +/hashmap.h/1.12/Fri Mar 4 21:00:44 2005// +/hashmap.tmpl/1.6/Fri Mar 4 21:00:44 2005// +/mtools.h/1.7/Mon Feb 21 01:55:49 2005// +/mtools.tmpl/1.6/Mon Feb 21 01:55:49 2005// +/nhashmap.h/1.5/Fri Mar 4 21:00:44 2005// +/nhashmap.tmpl/1.4/Fri Mar 4 21:00:44 2005// +/shashmap.h/1.8/Fri Mar 4 21:00:44 2005// +/shashmap.tmpl/1.6/Fri Mar 4 21:00:45 2005// +D diff --git a/src/maps/CVS/Repository b/src/maps/CVS/Repository new file mode 100644 index 0000000..b7c8ecb --- /dev/null +++ b/src/maps/CVS/Repository @@ -0,0 +1 @@ +ychat/src/maps diff --git a/src/maps/CVS/Root b/src/maps/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/maps/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/maps/shashmap.h b/src/maps/shashmap.h index 99dd7c8..6152ba2 100644 --- a/src/maps/shashmap.h +++ b/src/maps/shashmap.h @@ -4,8 +4,6 @@ #include #include "hashmap.h" -#include "../monitor/dump.h" - using namespace std; template @@ -15,15 +13,11 @@ template class hash_type = size_hash, class alloc_type = compare_allocator > -class shashmap : protected hashmap, - public dumpable +class shashmap : protected hashmap { private: pthread_mutex_t mut_shashmap; -protected: - virtual void dumpit(); - public: explicit shashmap(); ~shashmap(); @@ -42,7 +36,6 @@ public: virtual inline vector* get_key_vector(); virtual inline void run_func( void (*func)(obj_type) ); virtual inline void run_func( void (*func)(obj_type, void*), void* v_arg ); - }; #include "shashmap.tmpl" diff --git a/src/maps/shashmap.tmpl b/src/maps/shashmap.tmpl index c864d28..4559284 100644 --- a/src/maps/shashmap.tmpl +++ b/src/maps/shashmap.tmpl @@ -139,17 +139,3 @@ shashmap::run_func( void (*func)(obj hashmap::run_func(func, v_arg); pthread_mutex_unlock( &mut_shashmap ); } - -template -void -shashmap::dumpit() -{ - dumpable::add("[shashmap]"); - vector* p_vec = get_key_vector(); - - typename vector::iterator iter; - for (iter = p_vec->begin(); iter != p_vec->end(); ++iter) - dumpable::add(*iter); - - delete p_vec; -} diff --git a/src/memb/CVS/Entries b/src/memb/CVS/Entries new file mode 100644 index 0000000..ba3a2e5 --- /dev/null +++ b/src/memb/CVS/Entries @@ -0,0 +1,5 @@ +/memb.h/1.2/Mon Feb 21 01:55:49 2005// +/memb.tmpl/1.2/Mon Feb 21 01:55:49 2005// +/tupel.h/1.2/Mon Feb 21 01:55:49 2005// +/tupel.tmpl/1.2/Mon Feb 21 01:55:49 2005// +D diff --git a/src/memb/CVS/Repository b/src/memb/CVS/Repository new file mode 100644 index 0000000..cf42388 --- /dev/null +++ b/src/memb/CVS/Repository @@ -0,0 +1 @@ +ychat/src/memb diff --git a/src/memb/CVS/Root b/src/memb/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/memb/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/memb/memb.h b/src/memb/memb.h index 1997750..9c398ec 100644 --- a/src/memb/memb.h +++ b/src/memb/memb.h @@ -1,33 +1,8 @@ -/*:* - *: File: ./src/memb/memb.h - *: - *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT - *: - *: Copyright (C) 2003 Paul C. Buetow, Volker Richter - *: Copyright (C) 2004 Paul C. Buetow - *: Copyright (C) 2005 EXA Digital Solutions GbR - *: - *: This program is free software; you can redistribute it and/or - *: modify it under the terms of the GNU General Public License - *: as published by the Free Software Foundation; either version 2 - *: of the License, or (at your option) any later version. - *: - *: This program is distributed in the hope that it will be useful, - *: but WITHOUT ANY WARRANTY; without even the implied warranty of - *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - *: GNU General Public License for more details. - *: - *: You should have received a copy of the GNU General Public License - *: along with this program; if not, write to the Free Software - *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *:*/ - #ifndef MEMB_H #define MEMB_H #include "../incl.h" -#include "../wrap.h" -#include "../maps/hashmap.h" +#include "../maps/nhashmap.h" #include "tupel.h" using namespace std; @@ -36,58 +11,13 @@ template class memb { private: - hashmap< mutexed_tupel* > map_elems; + nhashmap< mutexed_tupel* > map_elems; public: - memb() - {} - memb(vector &vec_fields); - void initialize(vector &vec_fields); inline obj_type get_elem(string s_key); inline void set_elem(obj_type t_obj, string s_key); -}; - -struct memb_string : protected memb -{ - memb_string() - {} - memb_string(vector &vec_fields) : memb(vec_fields) - {} - void init_strings(vector vec_fields) - { - initialize(vec_fields); - } - inline string get_string(string s_key); - inline void set_string(string s_obj, string s_key); -}; -struct memb_int : protected memb -{ - memb_int() - {} - void init_ints(vector vec_fields) - { - initialize(vec_fields); - } - inline int get_int(string s_key); - inline void set_int(int i_obj, string s_key); }; -struct memb_bool : protected memb -{ - memb_bool() - {} - void init_bools(vector vec_fields) - { - initialize(vec_fields); - } - inline bool get_bool(string s_key); - inline void set_bool(bool b_obj, string s_key); -}; - -class memb_base : public memb_string, public memb_int, public memb_bool - {} -; - #include "memb.tmpl" #endif diff --git a/src/memb/memb.tmpl b/src/memb/memb.tmpl index 37eb2ab..0b4da0e 100644 --- a/src/memb/memb.tmpl +++ b/src/memb/memb.tmpl @@ -1,44 +1,3 @@ -/*:* - *: File: ./src/memb/memb.tmpl - *: - *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT - *: - *: Copyright (C) 2003 Paul C. Buetow, Volker Richter - *: Copyright (C) 2004 Paul C. Buetow - *: Copyright (C) 2005 EXA Digital Solutions GbR - *: - *: This program is free software; you can redistribute it and/or - *: modify it under the terms of the GNU General Public License - *: as published by the Free Software Foundation; either version 2 - *: of the License, or (at your option) any later version. - *: - *: This program is distributed in the hope that it will be useful, - *: but WITHOUT ANY WARRANTY; without even the implied warranty of - *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - *: GNU General Public License for more details. - *: - *: You should have received a copy of the GNU General Public License - *: along with this program; if not, write to the Free Software - *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *:*/ - - -template -memb::memb(vector &vec_fields) -{ - initialize(vec_fields); -} - -template -void -memb::initialize(vector &vec_fields) -{ - obj_type t_default; - vector::iterator iter; - for (iter = vec_fields.begin(); iter != vec_fields.end(); ++iter) - map_elems[*iter] = new mutexed_tupel(t_default); -} - template obj_type memb::get_elem(string s_key) @@ -47,58 +6,12 @@ memb::get_elem(string s_key) if ( p_tupel ) return p_tupel->get_elem(); - obj_type t_ret; - return t_ret; + return obj_type(); } template void memb::set_elem(obj_type t_obj, string s_key) { - mutexed_tupel *p_tupel = map_elems.get_elem(s_key); - if ( p_tupel ) - { - p_tupel->set_elem(t_obj); - return; - } - - //wrap::system_message(MEMBERE+string("("+s_key+")")); + // mutexed_tupel *p_tupel = map_elems } - -string -memb_string::get_string(string s_key) -{ - return get_elem(s_key); -} - -void -memb_string::set_string(string s_obj, string s_key) -{ - set_elem(s_obj, s_key); -} - -int -memb_int::get_int(string s_key) -{ - return get_elem(s_key); -} - -void -memb_int::set_int(int i_obj, string s_key) -{ - set_elem(i_obj, s_key); -} - -bool -memb_bool::get_bool(string s_key) -{ - return get_elem(s_key); -} - -void -memb_bool::set_bool(bool b_obj, string s_key) -{ - set_elem(b_obj, s_key); -} - - diff --git a/src/memb/tupel.h b/src/memb/tupel.h index f4cc288..bb1939e 100644 --- a/src/memb/tupel.h +++ b/src/memb/tupel.h @@ -1,27 +1,3 @@ -/*:* - *: File: ./src/memb/tupel.h - *: - *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT - *: - *: Copyright (C) 2003 Paul C. Buetow, Volker Richter - *: Copyright (C) 2004 Paul C. Buetow - *: Copyright (C) 2005 EXA Digital Solutions GbR - *: - *: This program is free software; you can redistribute it and/or - *: modify it under the terms of the GNU General Public License - *: as published by the Free Software Foundation; either version 2 - *: of the License, or (at your option) any later version. - *: - *: This program is distributed in the hope that it will be useful, - *: but WITHOUT ANY WARRANTY; without even the implied warranty of - *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - *: GNU General Public License for more details. - *: - *: You should have received a copy of the GNU General Public License - *: along with this program; if not, write to the Free Software - *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *:*/ - #ifndef TUPEL_H #define TUPEL_H @@ -37,9 +13,7 @@ class tupel private: pthread_mutex_t mut_tupel; obj_type t_obj; - public: - tupel(); tupel(obj_type t_obj); ~tupel(); diff --git a/src/memb/tupel.tmpl b/src/memb/tupel.tmpl index acc8c40..bdde516 100644 --- a/src/memb/tupel.tmpl +++ b/src/memb/tupel.tmpl @@ -1,53 +1,29 @@ -/*:* - *: File: ./src/memb/tupel.tmpl - *: - *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT - *: - *: Copyright (C) 2003 Paul C. Buetow, Volker Richter - *: Copyright (C) 2004 Paul C. Buetow - *: Copyright (C) 2005 EXA Digital Solutions GbR - *: - *: This program is free software; you can redistribute it and/or - *: modify it under the terms of the GNU General Public License - *: as published by the Free Software Foundation; either version 2 - *: of the License, or (at your option) any later version. - *: - *: This program is distributed in the hope that it will be useful, - *: but WITHOUT ANY WARRANTY; without even the implied warranty of - *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - *: GNU General Public License for more details. - *: - *: You should have received a copy of the GNU General Public License - *: along with this program; if not, write to the Free Software - *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *:*/ - template tupel::tupel() { - pthread_mutex_init(&mut_tupel, NULL); + pthread_mutex_init( &mut_tupel, NULL ); } template tupel::tupel(obj_type t_obj) { this->t_obj = t_obj; - pthread_mutex_init(&mut_tupel, NULL); + pthread_mutex_init( &mut_tupel, NULL ); } template tupel::~tupel() { - pthread_mutex_destroy(&mut_tupel); + pthread_mutex_destroy( &mut_tupel ); } template obj_type tupel::get_elem() { - pthread_mutex_lock(&mut_tupel); + pthread_mutex_lock( &mut_tupel ); obj_type t_ret = t_obj; - pthread_mutex_unlock(&mut_tupel); + pthread_mutex_unlock( &mut_tupel ); return t_ret; } @@ -55,7 +31,7 @@ template void tupel::set_elem(obj_type t_obj) { - pthread_mutex_lock(&mut_tupel); + pthread_mutex_lock( &mut_tupel ); this->t_obj = t_obj; - pthread_mutex_unlock(&mut_tupel); + pthread_mutex_unlock( &mut_tupel ); } diff --git a/src/modl.h b/src/modl.h index 73abd58..16dbdf3 100755 --- a/src/modl.h +++ b/src/modl.h @@ -7,7 +7,7 @@ using namespace std; -class modl : public shashmap +class modl : private shashmap { private: static void dlclose_( dynmod* mod ); diff --git a/src/mods/CVS/Entries b/src/mods/CVS/Entries new file mode 100644 index 0000000..7567a1c --- /dev/null +++ b/src/mods/CVS/Entries @@ -0,0 +1,3 @@ +/Makefile/1.4/Tue Jan 4 13:51:00 2005// +/configure/1.7/Thu Jul 8 14:39:03 2004// +D diff --git a/src/mods/CVS/Entries.Log b/src/mods/CVS/Entries.Log new file mode 100644 index 0000000..e9f894a --- /dev/null +++ b/src/mods/CVS/Entries.Log @@ -0,0 +1,3 @@ +A D/commands//// +A D/html//// +A D/irc//// diff --git a/src/mods/CVS/Repository b/src/mods/CVS/Repository new file mode 100644 index 0000000..d3c2e91 --- /dev/null +++ b/src/mods/CVS/Repository @@ -0,0 +1 @@ +ychat/src/mods diff --git a/src/mods/CVS/Root b/src/mods/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/mods/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/mods/commands/CVS/Entries b/src/mods/commands/CVS/Entries new file mode 100644 index 0000000..0e0d041 --- /dev/null +++ b/src/mods/commands/CVS/Entries @@ -0,0 +1,32 @@ +/Makefile/1.31/Sun Mar 6 20:44:47 2005// +/Makefile.in/1.8/Sun Mar 6 20:44:47 2005// +/yc_about.cpp/1.2/Mon Feb 21 01:55:49 2005// +/yc_all.cpp/1.2/Mon Feb 21 01:55:49 2005// +/yc_away.cpp/1.9/Mon Feb 21 01:55:49 2005// +/yc_col.cpp/1.10/Mon Feb 21 01:55:49 2005// +/yc_compopt.cpp/1.4/Mon Feb 21 01:55:49 2005// +/yc_exec.cpp/1.10/Mon Feb 21 01:55:49 2005// +/yc_fake.cpp/1.12/Mon Feb 21 01:55:49 2005// +/yc_getroom.cpp/1.7/Mon Feb 21 01:55:49 2005// +/yc_getrusage.cpp/1.9/Mon Feb 21 01:55:49 2005// +/yc_help.cpp/1.5/Mon Feb 21 01:55:49 2005// +/yc_invisible.cpp/1.10/Mon Feb 21 01:55:49 2005// +/yc_j.cpp/1.10/Mon Feb 21 01:55:50 2005// +/yc_ko.cpp/1.8/Mon Feb 21 01:55:50 2005// +/yc_m.cpp/1.8/Mon Feb 21 01:55:50 2005// +/yc_md5.cpp/1.8/Mon Feb 21 01:55:50 2005// +/yc_me.cpp/1.8/Mon Feb 21 01:55:50 2005// +/yc_morph.cpp/1.4/Mon Feb 21 01:55:50 2005// +/yc_msg.cpp/1.10/Mon Feb 21 01:55:50 2005// +/yc_q.cpp/1.9/Mon Feb 21 01:55:50 2005// +/yc_reload.cpp/1.8/Mon Feb 21 01:55:50 2005// +/yc_ren.cpp/1.8/Mon Feb 21 01:55:50 2005// +/yc_s.cpp/1.9/Mon Feb 21 01:55:50 2005// +/yc_set.cpp/1.8/Mon Feb 21 01:55:50 2005// +/yc_template.cpp/1.8/Mon Feb 21 01:55:50 2005// +/yc_time.cpp/1.7/Mon Feb 21 01:55:50 2005// +/yc_topic.cpp/1.11/Mon Feb 21 01:55:50 2005// +/yc_uptime.cpp/1.7/Mon Feb 21 01:55:50 2005// +/yc_users.cpp/1.2/Mon Feb 21 01:55:50 2005// +/yc_version.cpp/1.10/Mon Feb 21 01:55:50 2005// +D diff --git a/src/mods/commands/CVS/Repository b/src/mods/commands/CVS/Repository new file mode 100644 index 0000000..567651e --- /dev/null +++ b/src/mods/commands/CVS/Repository @@ -0,0 +1 @@ +ychat/src/mods/commands diff --git a/src/mods/commands/CVS/Root b/src/mods/commands/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/mods/commands/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/mods/commands/Makefile b/src/mods/commands/Makefile new file mode 100644 index 0000000..977b548 --- /dev/null +++ b/src/mods/commands/Makefile @@ -0,0 +1,48 @@ +SRCS=yc_about.cpp yc_all.cpp yc_away.cpp yc_col.cpp yc_compopt.cpp yc_exec.cpp yc_fake.cpp yc_getroom.cpp yc_getrusage.cpp yc_help.cpp yc_invisible.cpp yc_j.cpp yc_ko.cpp yc_m.cpp yc_md5.cpp yc_me.cpp yc_morph.cpp yc_msg.cpp yc_q.cpp yc_reload.cpp yc_ren.cpp yc_s.cpp yc_set.cpp yc_template.cpp yc_time.cpp yc_topic.cpp yc_uptime.cpp yc_users.cpp yc_version.cpp +MODS=$(addprefix ../../../mods/commands/, $(SRCS:.cpp=.so)) +CC=g++ +INCLUDES=`cat ../../includes.add` +CFLAGS=`cat ../cflags.add` +all: mods +$(MODS): + @echo -n "Compiling command module `basename $@ | sed s/\.so// | sed s/yc_//` " + @if ! test -d `dirname $@`; then mkdir -p `dirname $@`; fi + @$(CC) $(CFLAGS) $(INCLUDES) -shared -s -o $@ `echo $(notdir $@) | sed s/.so/.cpp/` + @du -hc $@ | tail -n 1 | sed s/total// | sed "s/ //g" +infotext: + @echo Compiling command modules +mods: infotext $(MODS) + @echo "Num of command modules: " + @ls ../../../mods/commands/*.so | wc -l +clean: + @echo Cleaning command modules + @if test -d ../../../mods/commands; then rm -Rf ../../../mods/commands; fi +../../../mods/commands/yc_about.so: yc_about.cpp +../../../mods/commands/yc_all.so: yc_all.cpp +../../../mods/commands/yc_away.so: yc_away.cpp +../../../mods/commands/yc_col.so: yc_col.cpp +../../../mods/commands/yc_compopt.so: yc_compopt.cpp +../../../mods/commands/yc_exec.so: yc_exec.cpp +../../../mods/commands/yc_fake.so: yc_fake.cpp +../../../mods/commands/yc_getroom.so: yc_getroom.cpp +../../../mods/commands/yc_getrusage.so: yc_getrusage.cpp +../../../mods/commands/yc_help.so: yc_help.cpp +../../../mods/commands/yc_invisible.so: yc_invisible.cpp +../../../mods/commands/yc_j.so: yc_j.cpp +../../../mods/commands/yc_ko.so: yc_ko.cpp +../../../mods/commands/yc_m.so: yc_m.cpp +../../../mods/commands/yc_md5.so: yc_md5.cpp +../../../mods/commands/yc_me.so: yc_me.cpp +../../../mods/commands/yc_morph.so: yc_morph.cpp +../../../mods/commands/yc_msg.so: yc_msg.cpp +../../../mods/commands/yc_q.so: yc_q.cpp +../../../mods/commands/yc_reload.so: yc_reload.cpp +../../../mods/commands/yc_ren.so: yc_ren.cpp +../../../mods/commands/yc_s.so: yc_s.cpp +../../../mods/commands/yc_set.so: yc_set.cpp +../../../mods/commands/yc_template.so: yc_template.cpp +../../../mods/commands/yc_time.so: yc_time.cpp +../../../mods/commands/yc_topic.so: yc_topic.cpp +../../../mods/commands/yc_uptime.so: yc_uptime.cpp +../../../mods/commands/yc_users.so: yc_users.cpp +../../../mods/commands/yc_version.so: yc_version.cpp diff --git a/src/mods/commands/Makefile.in b/src/mods/commands/Makefile.in index 42884b6..7ca8455 100755 --- a/src/mods/commands/Makefile.in +++ b/src/mods/commands/Makefile.in @@ -4,9 +4,9 @@ INCLUDES=`cat ../../includes.add` CFLAGS=`cat ../cflags.add` all: mods $(MODS): + @echo -n "Compiling command module `basename $@ | sed s/\.so// | sed s/yc_//` " @if ! test -d `dirname $@`; then mkdir -p `dirname $@`; fi @$(CC) $(CFLAGS) $(INCLUDES) -shared -s -o $@ `echo $(notdir $@) | sed s/.so/.cpp/` - @echo -n "Command module `basename $@ | sed s/\.so// | sed s/yc_//` " @du -hc $@ | tail -n 1 | sed s/total// | sed "s/ //g" infotext: @echo Compiling command modules diff --git a/src/mods/html/CVS/Entries b/src/mods/html/CVS/Entries new file mode 100644 index 0000000..c3b5155 --- /dev/null +++ b/src/mods/html/CVS/Entries @@ -0,0 +1,9 @@ +/Makefile/1.27/Sun Mar 6 20:44:47 2005// +/Makefile.in/1.9/Sun Mar 6 20:44:47 2005// +/yc_admin.cpp/1.8/Fri Feb 25 00:52:24 2005// +/yc_colors.cpp/1.10/Fri Feb 25 00:52:24 2005// +/yc_help.cpp/1.13/Fri Feb 25 00:52:24 2005// +/yc_loggedin.cpp/1.4/Fri Feb 25 00:52:24 2005// +/yc_options.cpp/1.10/Fri Feb 25 00:52:24 2005// +/yc_register.cpp/1.13/Fri Feb 25 00:52:24 2005// +D diff --git a/src/mods/html/CVS/Repository b/src/mods/html/CVS/Repository new file mode 100644 index 0000000..bb3b6b7 --- /dev/null +++ b/src/mods/html/CVS/Repository @@ -0,0 +1 @@ +ychat/src/mods/html diff --git a/src/mods/html/CVS/Root b/src/mods/html/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/mods/html/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/mods/html/Makefile b/src/mods/html/Makefile new file mode 100644 index 0000000..7c3b970 --- /dev/null +++ b/src/mods/html/Makefile @@ -0,0 +1,25 @@ +SRCS=yc_admin.cpp yc_colors.cpp yc_help.cpp yc_loggedin.cpp yc_options.cpp yc_register.cpp +MODS=$(addprefix ../../../mods/html/, $(SRCS:.cpp=.so)) +CC=g++ +INCLUDES=`cat ../../includes.add` +CFLAGS=`cat ../cflags.add` +all: mods +$(MODS): + @echo -n "Compiling html module `basename $@ | sed s/\.so// | sed s/yc_//` " + @if ! test -d `dirname $@`; then mkdir -p `dirname $@`; fi + @$(CC) $(CFLAGS) $(INCLUDES) -shared -s -o $@ `echo $(notdir $@) | sed s/.so/.cpp/` + @du -hc $@ | tail -n 1 | sed s/total// | sed "s/ //g" +infotext: + @echo Compiling html modules +mods: infotext $(MODS) + @echo "Num of html modules: " + @ls ../../../mods/html/*.so | wc -l +clean: + @echo Cleaning html modules + @if test -d ../../../mods/html; then rm -Rf ../../../mods/html; fi +../../../mods/html/yc_admin.so: yc_admin.cpp +../../../mods/html/yc_colors.so: yc_colors.cpp +../../../mods/html/yc_help.so: yc_help.cpp +../../../mods/html/yc_loggedin.so: yc_loggedin.cpp +../../../mods/html/yc_options.so: yc_options.cpp +../../../mods/html/yc_register.so: yc_register.cpp diff --git a/src/mods/html/Makefile.in b/src/mods/html/Makefile.in index 4b7c728..b65c9e6 100755 --- a/src/mods/html/Makefile.in +++ b/src/mods/html/Makefile.in @@ -4,12 +4,12 @@ INCLUDES=`cat ../../includes.add` CFLAGS=`cat ../cflags.add` all: mods $(MODS): + @echo -n "Compiling html module `basename $@ | sed s/\.so// | sed s/yc_//` " @if ! test -d `dirname $@`; then mkdir -p `dirname $@`; fi @$(CC) $(CFLAGS) $(INCLUDES) -shared -s -o $@ `echo $(notdir $@) | sed s/.so/.cpp/` - @echo -n "HTML module `basename $@ | sed s/\.so// | sed s/yc_//` " @du -hc $@ | tail -n 1 | sed s/total// | sed "s/ //g" infotext: - @echo Compiling HTML modules + @echo Compiling html modules mods: infotext $(MODS) @echo "Num of html modules: " @ls ../../../mods/html/*.so | wc -l diff --git a/src/mods/irc/CVS/Entries b/src/mods/irc/CVS/Entries new file mode 100644 index 0000000..1784810 --- /dev/null +++ b/src/mods/irc/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/src/mods/irc/CVS/Repository b/src/mods/irc/CVS/Repository new file mode 100644 index 0000000..f48a470 --- /dev/null +++ b/src/mods/irc/CVS/Repository @@ -0,0 +1 @@ +ychat/src/mods/irc diff --git a/src/mods/irc/CVS/Root b/src/mods/irc/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/mods/irc/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/msgs.h b/src/msgs.h index c4f7a71..04cfa5c 100755 --- a/src/msgs.h +++ b/src/msgs.h @@ -86,15 +86,12 @@ #define SESSION "Session: Count " #define SESSDMP "Session: Dump of session" #define SESSERR "Session: Could not find session " -#define SESSEXI "Session: New TempID already exists, recalc." #define SHELLER "Shell: Could not execute command" #define SHELLEX "Shell: Executing the following command:" #define SIGSIGV "Signal: SIGV received!" #define STATUPR "Stats: Updated rusage history" #define STATRSS "Stats: Max resident set size " #define REUROOM "Garbage: Reusing room object " -#define SOCKER1 "Sock: Can't create socket, aborting" -#define SOCKUNS "Sock: Starting hypertext transport [HTTP]" #define SOCKCLN "Sock: Initializing a client socket at " #define SOCKCON "Sock: Connecting to " #define SOCKCRT "Sock: Created socket on " @@ -115,14 +112,14 @@ #define XMLREAD "XML: Reading " #define XMLERR "XML Error: " #define XMLER1 "XML Error: Unable to load file " -#define VERSION "0.7.9.4" +#define VERSION "0.7.9" #define BRANCH "RELEASE" -#define BUILDNR 3807 -#define UNAME "FreeBSD 5.4-RELEASE i386" +#define BUILDNR 3624 +#define UNAME "FreeBSD 5.3-RELEASE-p5 i386" #define COMPOPT "Using built-in specs.; Configured with: FreeBSD/i386 system compiler; Thread model: posix; gcc version 3.4.2 [FreeBSD] 20040728; 3.4; g++" #define YCUSAGE "Usage: ./ychat {h|v}|{o confkey confvalue}\n" -#define HEADER1 "HTTP/1.1 200 OK\r\n" +#define HEADER1 "HTTP/1.0 200 OK\r\n" #define HEADER2 "Server: yChat/" VERSION "-" BRANCH "\r\n" #define HEADER3 "Cache-control: no-cache\r\n" #define HEADER4 "Pragma: no-cache\r\n" @@ -130,7 +127,6 @@ #define HEADER6 "Connection: keep-alive\r\n" #define HEADER7 "Content-Length: "; #define HEADER8 "Content-Type: "; -#define HEADER8b "; charset=ISO-8859-1\r\n"; -#define HEADER9 "Allow: GET\r\n"; +#define HEADER9 "Allow: GET\n"; #endif diff --git a/src/ncur/CVS/Entries b/src/ncur/CVS/Entries new file mode 100644 index 0000000..b757331 --- /dev/null +++ b/src/ncur/CVS/Entries @@ -0,0 +1,5 @@ +/menu.cpp/1.8/Mon Feb 21 01:55:50 2005// +/menu.h/1.6/Mon Feb 21 01:55:50 2005// +/ncur.cpp/1.26/Wed Mar 9 21:09:32 2005// +/ncur.h/1.11/Sun Mar 6 20:44:47 2005// +D diff --git a/src/ncur/CVS/Repository b/src/ncur/CVS/Repository new file mode 100644 index 0000000..694be25 --- /dev/null +++ b/src/ncur/CVS/Repository @@ -0,0 +1 @@ +ychat/src/ncur diff --git a/src/ncur/CVS/Root b/src/ncur/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/ncur/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/reqp.cpp b/src/reqp.cpp index 9b5da0b..cbd2705 100755 --- a/src/reqp.cpp +++ b/src/reqp.cpp @@ -13,7 +13,6 @@ const string reqp::s_http = HEADER; const string reqp::s_http_stream = STREAM; const string reqp::s_http_colength = HEADER7; const string reqp::s_http_cotype = HEADER8; -const string reqp::s_http_cotype_add = HEADER8b; reqp::reqp( ) {} @@ -44,7 +43,7 @@ reqp::get_request_parameters( string s_parameters, map& map_param } string -reqp::get_url( string s_req, map &map_params, int& i_postpayloadoffset ) +reqp::get_url( int &i_sock, string s_req, map &map_params ) { unsigned i_pos, i_pos2; string s_vars( "" ); @@ -89,20 +88,31 @@ reqp::get_url( string s_req, map &map_params, int& i_postpayload { if ( (i_pos2 = s_req.find("HTTP")) != string::npos ) { - if (i_pos2 > 13) + if ( 13 < i_pos2 ) { s_ret = url_decode( s_req.substr(6,i_pos2-7) ); - //wrap::system_message(s_req); - //wrap::system_message(string("data offset=") + tool::int2string(i_postpayloadoffset)); - i_pos = s_req.find("event=",i_postpayloadoffset ); - if(i_pos != string::npos) + int i_len = s_ret.length(); + int i_len2 = s_req.length()-1; + + s_req = s_req.substr( i_len < i_len2 ? i_len : i_len2 ); + + if ( (i_pos = s_req.find("event=")) == string::npos) { - get_request_parameters( url_decode( s_req.substr(i_pos) ), map_params); + char c_req[POSTBUF]; + i_len = read(i_sock, c_req, POSTBUF); + s_req = c_req; + s_req = s_req.substr(0, i_len); + + if ( (i_pos = s_req.find("event=")) != string::npos ) + get_request_parameters( url_decode( s_req.substr(i_pos) ), map_params ); + } + else + { + get_request_parameters( url_decode( s_req.substr(i_pos) ), map_params ); } } } - } #ifdef VERBOSE @@ -121,7 +131,7 @@ reqp::get_url( string s_req, map &map_params, int& i_postpayload } string -reqp::get_content_type(string &s_file) +reqp::get_content_type( string s_file ) { string s_ext(tool::get_extension( s_file )); @@ -223,12 +233,11 @@ reqp::get_from_header( string s_req, string s_hdr ) } string -reqp::parse( socketcontainer *p_sock, string s_req, map &map_params, int &i_postpayloadoffset ) +reqp::parse( int &i_sock, string s_req, map &map_params ) { - // store all request informations in map_params. store the url in // map_params["request"]. - get_url( s_req, map_params, i_postpayloadoffset ); + get_url( i_sock, s_req, map_params ); parse_headers( s_req, map_params ); string s_event( map_params["event"] ); @@ -264,7 +273,7 @@ reqp::parse( socketcontainer *p_sock, string s_req, map &map_para } else { - wrap::system_message(SESSERR); + wrap::system_message(SESSERR); return s_rep; } @@ -292,7 +301,7 @@ reqp::parse( socketcontainer *p_sock, string s_req, map &map_para { string s_msg ( wrap::HTML->parse( map_params ) ); p_user->msg_post( &s_msg); - wrap::SOCK->chat_stream( p_sock, p_user, map_params ); + wrap::SOCK->chat_stream( i_sock, p_user, map_params ); } // if a request for the online list of the active room. @@ -329,9 +338,8 @@ reqp::parse( socketcontainer *p_sock, string s_req, map &map_para if ( s_event.compare("stream") == 0 ) s_resp.append( s_http_stream ); - s_resp.append( s_http_colength + tool::int2string(s_rep.size()) + "\r\n" + - s_http_cotype + map_params["content-type"] + - s_http_cotype_add + "\r\n" ); + s_resp.append( s_http_colength + tool::int2string(s_rep.size()) + "\n" + + s_http_cotype + map_params["content-type"] + "\r\n\r\n" ); s_resp.append(s_rep); @@ -365,10 +373,10 @@ string reqp::remove_dots( string s_ret ) { // remove ".." from the request. - unsigned i_pos; + unsigned pos; - if ( (i_pos = s_ret.find( ".." )) != string::npos ) - return remove_dots(s_ret.substr(0, i_pos)); + if( (pos = s_ret.find( ".." )) != string::npos) + return s_ret.substr(0, pos); return s_ret; } diff --git a/src/reqp.h b/src/reqp.h index 5a378fa..4c322cd 100755 --- a/src/reqp.h +++ b/src/reqp.h @@ -13,12 +13,11 @@ private: static const string s_http_stream; static const string s_http_colength; static const string s_http_cotype; - static const string s_http_cotype_add; // returns the request url from thr client's http request header // until the first "?" and stores all request parameter values // ( behind "?" ) into map_params. - string get_url( string s_req, map &map_params, int& i_postpayloadoffset ); + string get_url( int &i_sock, string s_req, map &map_params ); // returns a specific value of the client's http request header. // ( s.t. like the User-Agent, Referer etc... ). string get_from_header( string s_req, string s_hdr ); @@ -33,9 +32,9 @@ private: public: reqp( ); - string parse( socketcontainer* p_sock, string s_req, map &map_params, int &i_postpayloadoffset ); + string parse( int &i_sock, string s_req, map &map_params ); string url_decode ( string s_url ); - string get_content_type( string& s_file ); + string get_content_type( string s_file ); void parse_headers( string s_req, map &map_params ); }; diff --git a/src/sock/CVS/Entries b/src/sock/CVS/Entries new file mode 100644 index 0000000..8431283 --- /dev/null +++ b/src/sock/CVS/Entries @@ -0,0 +1,3 @@ +/sock.cpp/1.29/Sat Mar 5 12:43:37 2005// +/sock.h/1.14/Sun Feb 27 06:28:53 2005// +D diff --git a/src/sock/CVS/Repository b/src/sock/CVS/Repository new file mode 100644 index 0000000..bbe6e49 --- /dev/null +++ b/src/sock/CVS/Repository @@ -0,0 +1 @@ +ychat/src/sock diff --git a/src/sock/CVS/Root b/src/sock/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/sock/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/sock/sock.cpp b/src/sock/sock.cpp index 8f66268..42daf24 100755 --- a/src/sock/sock.cpp +++ b/src/sock/sock.cpp @@ -5,8 +5,9 @@ #include #include #include - #include "sock.h" +#include "../chat/chat.h" +#include "../chat/user.h" using namespace std; @@ -19,40 +20,21 @@ sock::sock() this->log_daemon = new logd( wrap::CONF->get_elem( "httpd.logging.accessfile" ), - wrap::CONF->get_elem( "httpd.logging.access_lines" ) ); + wrap::CONF->get_elem( "httpd.logging.accesslines" ) ); #endif } -int -sock::_send(socketcontainer *p_sock, const char *sz, int len) -{ - - return send( p_sock->i_sock, sz, len, 0 ); -} - -int -sock::_read(socketcontainer *p_sock, char *sz, int len) -{ - - return read( p_sock->i_sock, sz, len ); -} - -int -sock::_close(socketcontainer *p_sock) -{ - shutdown( p_sock->i_sock, 2 ); - close ( p_sock->i_sock ); - delete p_sock; -} +sock::~sock() +{} //<<* void -sock::chat_stream( socketcontainer *p_sock, user *p_user, map &map_params ) +sock::chat_stream( int i_sock, user *p_user, map &map_params ) { string s_msg( "\n" ); for ( int i = 0; i < PUSHSTR; i++ ) - _send(p_sock,s_msg.c_str(), s_msg.size()); + send( i_sock, s_msg.c_str(), s_msg.size(), 0 ); pthread_mutex_t mutex; pthread_mutex_init( &mutex, NULL ); @@ -62,7 +44,7 @@ sock::chat_stream( socketcontainer *p_sock, user *p_user, map &ma { s_msg = p_user->get_mess( ); - if ( 0 > _send( p_sock, s_msg.c_str(), s_msg.size() ) ) + if ( 0 > send( i_sock, s_msg.c_str(), s_msg.size(), 0 ) ) { p_user->set_online( false ); break; @@ -78,7 +60,7 @@ sock::chat_stream( socketcontainer *p_sock, user *p_user, map &ma s_msg = p_user->get_mess( ); if ( ! s_msg.empty() ) - _send( p_sock, s_msg.c_str(), s_msg.size()); + send( i_sock, s_msg.c_str(), s_msg.size(), 0 ); // remove the user from its room. string s_user( p_user->get_name() ); @@ -105,7 +87,7 @@ sock::chat_stream( socketcontainer *p_sock, user *p_user, map &ma //*>> int -sock::_make_server_socket( int i_port ) +sock::make_server_socket( int i_port ) { size_t i_sock; struct sockaddr_in name; @@ -121,7 +103,7 @@ sock::_make_server_socket( int i_port ) wrap::system_message( SOCKERR ); - return _make_server_socket( i_port ); + return make_server_socket( i_port ); } // give the server socket a name. @@ -143,200 +125,26 @@ sock::_make_server_socket( int i_port ) wrap::system_message( string(SOCKERR) + tool::int2string(i_port) ); // Rerun recursive. - return _make_server_socket( i_port ); + return make_server_socket( i_port ); } wrap::system_message( SOCKCRT + string("localhost:") + tool::int2string(i_port) ); - i_server_port = i_port; - i_server_sock = i_sock; - - return i_sock; -} - -string -sock::read_http_line(socketcontainer *p_sock) -{ - string s_line; - int i_total = 0; - int i_read = 0; - char ch; - - do - { - i_read = _read(p_sock, &ch, sizeof(ch)); - - if(i_read <= 0) - return ""; - - s_line += ch; - i_total++; - } - while((ch != '\n') && i_total < MAXLENGTH); - - if(ch != '\n') - /* - ** the games people play - */ - return ""; - - return s_line; -} -int -sock::read_http(socketcontainer *p_sock, char *c_zbuf, int i_buflen, int &i_postpayloadoffset) -{ - /* - ** 1) Read the first line - ** 2) If GET, handle as such - ** 3) If POST, handle as such - */ - char ch; - int i_read; - int i_ret = -1; - int x,z; - - string s_content_length; - string s_cl; - string s_post_return; - string s_line = read_http_line(p_sock); - - i_postpayloadoffset = 0; - if(s_line.length() <= 0) - return -1; - - /* - ** GET yada\r\n Followed by stuff we don't care about :) heh. - ** 01234 - */ - /* - ** POST yada\r\n - ** xxxxx - ** Content-Length: NNN\n - ** \n - */ - if(s_line.substr(0,3) == "GET") - { - if(s_line.length() > i_buflen) - { - /* - ** Buffer overflow - */ - return -1; - } - else - { - memcpy(c_zbuf,s_line.c_str(),s_line.length()); - return s_line.length(); - } - } - - else - { - /* - ** POST yada - ** 01234 - */ - if(s_line.substr(0,4) != "POST") - return -1; - - /* - ** Get us to the Content-Length: - */ - s_post_return += s_line; - i_postpayloadoffset += s_line.length(); - - for(x=0 ;x < MAXLINES; x++) - { - s_line = read_http_line(p_sock); - s_post_return += s_line; - i_postpayloadoffset += s_line.length(); - - if (s_line.compare(0, 15, "Content-Length:")) - continue; - - // Match found on Content-Length:... process, and then break out and get us to the promised land - s_content_length = s_line.substr( 16 /*strlen("Content-Length: ")*/, - s_line.length() - 16 /*strlen("Content-Length: ")*/); - - /* - ** Content-Length: 333\n - ** 0123456789abcdefghijklmnopqrstuvwxyzAB - */ - - z = 0; - - do - { - ch = s_content_length[z]; - if(isdigit(ch)) - s_cl += ch; - - z++; - - } - while(ch != '\n'); - - break; - } - - if(s_cl.length() <= 0) - return -1; - - z = atoi(s_cl.c_str()); - - /* - ** If we are going to overflow the buffer just by the payload, leave - ** of, if z did not convert correctly. (should have been ok by isdigit) - */ - if(z > i_buflen || z < 0) - return -1; - - /* - ** We have MAXLINES to get to the blank line separating POST data. - */ - for(x=0 ;x < MAXLINES; x++) - { - s_line = read_http_line(p_sock); - s_post_return += s_line; - - i_postpayloadoffset += s_line.length(); - if(s_line == "\r\n") - break; - } - - /* - ** funny business - */ - if(x == MAXLINES) - return -1; - - for(x=0; x < z; x++) - { - if(_read(p_sock,&ch,sizeof(ch)) != 1) - return -1; - - s_post_return += ch; - } +#ifdef NCURSES - if(s_post_return.length() > i_buflen) - return -1; + mvprintw( NCUR_PORT_X,NCUR_PORT_Y, "Port: %d ", i_port); + refresh(); +#endif - memcpy(c_zbuf,s_post_return.c_str(),s_post_return.length()); - return s_post_return.length(); - } + return i_sock; } int -sock::read_write(socketcontainer* p_sock) +sock::read_write( int* p_sock ) { - int i_postpayloadoffset; - int i_sock = p_sock->i_sock; - + int i_sock = *p_sock; char c_req[READSOCK]; - - memset(c_req,0,sizeof(c_req)); - - int i_bytes = read_http(p_sock, c_req, READSOCK-1,i_postpayloadoffset); + int i_bytes = read(i_sock, c_req, READSOCK); if (i_bytes <= 0) { @@ -352,17 +160,25 @@ sock::read_write(socketcontainer* p_sock) struct sockaddr_in client; size_t size = sizeof(client); - getpeername(i_sock, (struct sockaddr *)&client, &size); +#ifdef CYGWIN + getpeername( i_sock, (struct sockaddr *)&client, (int*)&size); +#else + getpeername( i_sock, (struct sockaddr *)&client, &size); +#endif + uint32_t &s_addr = client.sin_addr.s_addr; - if ( (map_params["REMOTE_ADDR"] = get_elem(s_addr)) == "" ) + if ( (map_params["REMOTE_ADDR"] = get_elem(s_addr)) == "" ) { map_params["REMOTE_ADDR"] = string(inet_ntoa(client.sin_addr)); set_elem(map_params["REMOTE_ADDR"], s_addr); wrap::system_message(SOCKCAC+map_params["REMOTE_ADDR"]); } - string s_rep = req_parser->parse(p_sock, string(c_req), map_params, i_postpayloadoffset); + //map_params["REMOTE_ADDR"] = inet_ntoa_callback(&client.sin_addr); + //map_params["REMOTE_PORT"] = ntohs(client.sin_port); + + string s_rep = req_parser->parse(i_sock, string(c_req), map_params); #ifdef LOGGING @@ -370,31 +186,21 @@ sock::read_write(socketcontainer* p_sock) #endif // send s_rep to the client. - _send(p_sock, s_rep.c_str(), s_rep.size()); + send(i_sock, s_rep.c_str(), s_rep.size(), 0); // dont need those vals anymore. map_params.clear(); - _close(p_sock); + shutdown( i_sock, 2 ); + close ( i_sock ); + return 0; } - _close(p_sock); - return 1; -} - -void -sock::_main_loop_init() -{ - wrap::system_message(SOCKUNS); -} + shutdown( i_sock, 2 ); + close ( i_sock ); -socketcontainer* -sock::_create_container(int &i_sock) -{ - socketcontainer* p_sock = new socketcontainer; - p_sock->i_sock = i_sock; - return p_sock; + return 1; } int @@ -402,22 +208,22 @@ sock::start() { wrap::system_message( SOCKSRV ); pool* p_pool = wrap::POOL; - int i_sock = i_server_sock; #ifdef NCURSES - print_hits(); p_pool->print_pool_size(); #endif int i_port = tool::string2int( wrap::CONF->get_elem( "httpd.serverport" ) ); - _main_loop_init(); - - int i; + int i_sock, i; fd_set active_fd_set, read_fd_set; struct sockaddr_in clientname; size_t size; + + // create the server socket and set it up to accept connections. + i_sock = make_server_socket ( i_port ); + if (listen (i_sock, 1) < 0) { wrap::system_message( LISTERR ); @@ -430,8 +236,6 @@ sock::start() FD_ZERO (&active_fd_set); FD_SET (i_sock, &active_fd_set); - print_server_port(); - while( b_run ) { // block until input arrives on one or more active sockets. @@ -459,23 +263,36 @@ sock::start() int i_new_sock; size = sizeof(clientname); - i_new_sock = accept (i_sock, (struct sockaddr *) &clientname, &size); +#ifdef CYGWIN -#ifdef VERBOSE + i_new_sock = accept (i_sock, (struct sockaddr *) &clientname, (int*)&size); +#else - wrap::system_message(NEWREQU - + tool::int2string(i_req) + " " - + string(inet_ntoa( clientname.sin_addr )) + ":" - + tool::int2string(ntohs ( clientname.sin_port )) - ); + i_new_sock = accept (i_sock, (struct sockaddr *) &clientname, &size); #endif - FD_SET (i_new_sock, &active_fd_set); + if (i_new_sock < 0) + { + wrap::system_message( ACCPERR ); + close(i_new_sock); + } + else + { +#ifdef VERBOSE + wrap::system_message(NEWREQU + + tool::int2string(i_req) + " " + + string(inet_ntoa( clientname.sin_addr )) + ":" + + tool::int2string(ntohs ( clientname.sin_port )) + ); +#endif + FD_SET (i_new_sock, &active_fd_set); + } } else { - socketcontainer *p_sock = _create_container(i); + int *p_sock = new int; + *p_sock = i; p_pool->run( (void*) p_sock ); FD_CLR( i, &active_fd_set ); } @@ -492,18 +309,12 @@ sock::clean_ipcache() if ( i_currentsize > 0 && (i_ipcachesize == 0 || i_ipcachesize <= i_currentsize) ) { wrap::system_message( - SOCKCA2+tool::int2string(i_currentsize)+","+tool::int2string(i_ipcachesize)+")"); + SOCKCA2+tool::int2string(i_currentsize)+","+tool::int2string(i_ipcachesize)+")"); clear(); } } #ifdef NCURSES -void -sock::print_server_port() { - mvprintw( NCUR_PORT_X,NCUR_PORT_Y, "Port: %d ", i_server_port); - refresh(); -} - void sock::print_hits() { diff --git a/src/sock/sock.h b/src/sock/sock.h index 6e93468..62f32ae 100755 --- a/src/sock/sock.h +++ b/src/sock/sock.h @@ -12,7 +12,6 @@ #include "../reqp.h" #include "../chat/user.h" - #include "../thrd/pool.h" #include "../maps/shashmap.h" @@ -22,22 +21,19 @@ using namespace std; -class sock : public shashmap - < string, uint32_t, self_hash, equals_allocator > +class sock : protected shashmap +< string, uint32_t, self_hash, equals_allocator > { -protected: +private: #ifdef LOGGING - logd *log_daemon; // the log daemon #endif - int i_server_sock; - int i_server_port; - // total number of server requests. unsigned long long i_req; bool b_run; // true while socket manager is running. reqp *req_parser; // parses the http requests from clients. + char *c_buffer; // char buffer! pthread_mutex_t mut_hits; @@ -45,44 +41,34 @@ protected: public: // creates a server socket. - int read_http(socketcontainer *p_sock, char *c_zbuf, int i_buflen, int &i_payloadoffset); - string read_http_line(socketcontainer *p_sock); + int make_server_socket( int i_port ); - // small inline methods: - bool get_server_() const - { - return b_run; - } // small inline methods: bool get_run() const { return b_run; } + bool set_run( bool b_run ) { this->b_run = b_run; } - sock(); - - int read_write( socketcontainer* p_sock ); + sock( ); + ~sock( ); + int read_write( int* p_sock ); int start(); void clean_ipcache(); // the chat stream there all the chat messages will sent through. - void chat_stream( socketcontainer* p_sock, user* p_user, map &map_params ); //<< - virtual inline int _send(socketcontainer *p_sock, const char *sz, int len); - virtual inline int _read(socketcontainer *p_sock, char *sz, int len); - virtual inline int _close(socketcontainer *p_sock); - virtual void _main_loop_init(); - virtual inline socketcontainer* _create_container(int& i_sock); - virtual int _make_server_socket(int i_port); + static void chat_stream( int i_sock, user* p_user, map &map_params ); //<< #ifdef NCURSES - void print_server_port(); + void print_hits(); #endif }; + #endif diff --git a/src/stats.cpp b/src/stats.cpp index 7fba04d..4579f69 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -8,128 +8,130 @@ using namespace std; stats::stats() { - i_rusage_vec_size = tool::string2int( - wrap::CONF->get_elem("httpd.stats.rusagehistory")); + i_rusage_vec_size = tool::string2int( + wrap::CONF->get_elem("httpd.stats.rusagehistory")); - i_num_rooms = 0; //<< + i_num_rooms = 0; //<< - pthread_mutex_init( &mut_vec_rusage, NULL ); - pthread_mutex_init( &mut_num_rooms, NULL ); //<< + pthread_mutex_init( &mut_vec_rusage, NULL ); + pthread_mutex_init( &mut_num_rooms, NULL ); //<< } stats::~stats() { - pthread_mutex_destroy( &mut_vec_rusage ); - pthread_mutex_destroy( &mut_num_rooms ); //<< + pthread_mutex_destroy( &mut_vec_rusage ); + pthread_mutex_destroy( &mut_num_rooms ); //<< } void stats::update_rusage_history() { - wrap::system_message(STATUPR); - - rusage* p_rusage = new rusage; - getrusage( RUSAGE_SELF, p_rusage ); - - map map_rusage; - - map_rusage["ru_maxrss"] = p_rusage->ru_maxrss; - map_rusage["ru_ixrss"] = p_rusage->ru_ixrss; - map_rusage["ru_idrss"] = p_rusage->ru_idrss; - map_rusage["ru_isrss"] = p_rusage->ru_isrss; - map_rusage["ru_minflt"] = p_rusage->ru_minflt; - map_rusage["ru_majflt"] = p_rusage->ru_majflt; - map_rusage["ru_nswap"] = p_rusage->ru_nswap; - map_rusage["ru_inblock"] = p_rusage->ru_inblock; - map_rusage["ru_oublock"] = p_rusage->ru_oublock; - map_rusage["ru_msgsnd"] = p_rusage->ru_msgsnd; - map_rusage["ru_msgrcv"] = p_rusage->ru_msgrcv; - map_rusage["ru_nsignals"] = p_rusage->ru_nsignals; - map_rusage["ru_nvcsw"] = p_rusage->ru_nvcsw; - map_rusage["ru_nivcsw"] = p_rusage->ru_nivcsw; - - delete p_rusage; - - pthread_mutex_lock ( &mut_vec_rusage ); - - if ( vec_rusage_history.size() >= i_rusage_vec_size ) - vec_rusage_history.erase( vec_rusage_history.begin() ); - - vec_rusage_history.push_back(map_rusage); - - pthread_mutex_unlock( &mut_vec_rusage ); + wrap::system_message(STATUPR); + + rusage* p_rusage = new rusage; + getrusage( RUSAGE_SELF, p_rusage ); + + map map_rusage; + + map_rusage["ru_maxrss"] = p_rusage->ru_maxrss; + map_rusage["ru_ixrss"] = p_rusage->ru_ixrss; + map_rusage["ru_idrss"] = p_rusage->ru_idrss; + map_rusage["ru_isrss"] = p_rusage->ru_isrss; + map_rusage["ru_minflt"] = p_rusage->ru_minflt; + map_rusage["ru_majflt"] = p_rusage->ru_majflt; + map_rusage["ru_nswap"] = p_rusage->ru_nswap; + map_rusage["ru_inblock"] = p_rusage->ru_inblock; + map_rusage["ru_oublock"] = p_rusage->ru_oublock; + map_rusage["ru_msgsnd"] = p_rusage->ru_msgsnd; + map_rusage["ru_msgrcv"] = p_rusage->ru_msgrcv; + map_rusage["ru_nsignals"] = p_rusage->ru_nsignals; + map_rusage["ru_nvcsw"] = p_rusage->ru_nvcsw; + map_rusage["ru_nivcsw"] = p_rusage->ru_nivcsw; + + delete p_rusage; + + pthread_mutex_lock ( &mut_vec_rusage ); + + if ( vec_rusage_history.size() >= i_rusage_vec_size ) + vec_rusage_history.erase( vec_rusage_history.begin() ); + + vec_rusage_history.push_back(map_rusage); + + pthread_mutex_unlock( &mut_vec_rusage ); } void stats::set_rusage_vec_size( int i_rusage_vec_size ) { - pthread_mutex_lock ( &mut_vec_rusage ); - this->i_rusage_vec_size = i_rusage_vec_size; - pthread_mutex_unlock( &mut_vec_rusage ); + pthread_mutex_lock ( &mut_vec_rusage ); + this->i_rusage_vec_size = i_rusage_vec_size; + pthread_mutex_unlock( &mut_vec_rusage ); } long stats::get_ru_maxrss() { - rusage* p_rusage = new rusage; - getrusage( RUSAGE_SELF, p_rusage ); + rusage* p_rusage = new rusage; + getrusage( RUSAGE_SELF, p_rusage ); - long l_ret = p_rusage->ru_maxrss; - delete p_rusage; + long l_ret = p_rusage->ru_maxrss; + delete p_rusage; - return l_ret; + return l_ret; } string stats::get_rusage_history( string s_type, string s_seperator ) { - string s_ret; - int i_count = 0; - vector< map >::iterator iter; - - pthread_mutex_lock ( &mut_vec_rusage ); - - for ( iter = vec_rusage_history.begin(); - iter != vec_rusage_history.end(); - iter++, i_count++ ) - s_ret.append(s_seperator + - tool::int2string(i_count) + ". " + iter->find(s_type)->first + " " + - tool::int2string( iter->find(s_type)->second) + "\n"); - - pthread_mutex_unlock( &mut_vec_rusage ); - - return s_ret; + string s_ret; + int i_count = 0; + vector< map >::iterator iter; + + pthread_mutex_lock ( &mut_vec_rusage ); + + for ( iter = vec_rusage_history.begin(); + iter != vec_rusage_history.end(); + iter++, i_count++ ) + s_ret.append(s_seperator + + tool::int2string(i_count) + ". " + iter->find(s_type)->first + " " + + tool::int2string( iter->find(s_type)->second) + "\n"); + + pthread_mutex_unlock( &mut_vec_rusage ); + + return s_ret; } //<<* -int +int stats::get_num_rooms() { - pthread_mutex_lock ( &mut_num_rooms ); - int i_ret = i_num_rooms; - pthread_mutex_unlock( &mut_num_rooms ); - return i_ret; + pthread_mutex_lock ( &mut_num_rooms ); + int i_ret = i_num_rooms; + pthread_mutex_unlock( &mut_num_rooms ); + return i_ret; } -void +void stats::increment_num_rooms() { - pthread_mutex_lock ( &mut_num_rooms ); - ++i_num_rooms; - pthread_mutex_unlock( &mut_num_rooms ); + pthread_mutex_lock ( &mut_num_rooms ); + ++i_num_rooms; + pthread_mutex_unlock( &mut_num_rooms ); #ifdef NCURSES - print_num_rooms(); + + print_num_rooms(); #endif } -void +void stats::decrement_num_rooms() { - pthread_mutex_lock ( &mut_num_rooms ); - --i_num_rooms; - pthread_mutex_unlock( &mut_num_rooms ); + pthread_mutex_lock ( &mut_num_rooms ); + --i_num_rooms; + pthread_mutex_unlock( &mut_num_rooms ); #ifdef NCURSES - print_num_rooms(); + + print_num_rooms(); #endif } @@ -137,12 +139,13 @@ stats::decrement_num_rooms() void stats::print_num_rooms() { - if ( !wrap::NCUR->is_ready() ) - return; + if ( !wrap::NCUR->is_ready() ) + return; - mvprintw( NCUR_NUM_ROOMS_X, NCUR_NUM_ROOMS_Y, "Rooms: %d", get_num_rooms()); - refresh(); + mvprintw( NCUR_NUM_ROOMS_X, NCUR_NUM_ROOMS_Y, "Rooms: %d", get_num_rooms()); + refresh(); } #endif //*>> + #endif diff --git a/src/stats.h b/src/stats.h index 647f504..4458b6a 100644 --- a/src/stats.h +++ b/src/stats.h @@ -4,30 +4,30 @@ #define STATS_H #include "tool/tool.h" + #include #include #include #include -#include using namespace std; class stats { private: - // Specifies the max. amount of elements in vec_rusage_history; - int i_rusage_vec_size; - // History of the last i_rusage_vec_size rusage values. - vector< map > vec_rusage_history; - pthread_mutex_t mut_vec_rusage; + // Specifies the max. amount of elements in vec_rusage_history; + int i_rusage_vec_size; + // History of the last i_rusage_vec_size rusage values. + vector< map > vec_rusage_history; + pthread_mutex_t mut_vec_rusage; + + int i_num_rooms; //<< + pthread_mutex_t mut_num_rooms; //<< - int i_num_rooms; //<< - pthread_mutex_t mut_num_rooms; //<< - - void set_rusage_vec_size( int i_rusage_vec_size ); + void set_rusage_vec_size( int i_rusage_vec_size ); public: - stats( ); + stats( ); ~stats( ); //<<* @@ -40,6 +40,7 @@ public: long get_ru_maxrss(); //<<* #ifdef NCURSES + void print_num_rooms(); #endif //*>> diff --git a/src/thrd/CVS/Entries b/src/thrd/CVS/Entries new file mode 100644 index 0000000..bb6bf86 --- /dev/null +++ b/src/thrd/CVS/Entries @@ -0,0 +1,5 @@ +/pool.cpp/1.17/Fri Feb 25 01:22:35 2005// +/pool.h/1.12/Sun Mar 6 20:44:47 2005// +/thro.cpp/1.7/Sun Mar 6 20:44:47 2005// +/thro.h/1.6/Sun Mar 6 20:44:47 2005// +D diff --git a/src/thrd/CVS/Repository b/src/thrd/CVS/Repository new file mode 100644 index 0000000..058942a --- /dev/null +++ b/src/thrd/CVS/Repository @@ -0,0 +1 @@ +ychat/src/thrd diff --git a/src/thrd/CVS/Root b/src/thrd/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/thrd/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/thrd/pool.cpp b/src/thrd/pool.cpp index dd29d6a..1f4ace6 100755 --- a/src/thrd/pool.cpp +++ b/src/thrd/pool.cpp @@ -14,7 +14,7 @@ pool::pool() i_num_total_threads = 0; i_num_avail_threads = tool::string2int( wrap::CONF->get_elem( "httpd.thread.initpoolsize" ) ); - increase_pool(i_num_avail_threads); + increase_pool(i_num_avail_threads); } pool::~pool() @@ -91,10 +91,10 @@ pool::wait_for_task( void* p_void ) } pthread_mutex_unlock(&p_pool->mut_num_avail_threads); - pthread_mutex_lock(&p_pool->mut_queue_tasks); + pthread_mutex_lock(&p_pool->mut_queue_tasks); task* p_task = p_pool->queue_tasks.front(); p_pool->queue_tasks.pop(); - pthread_mutex_unlock(&p_pool->mut_queue_tasks); + pthread_mutex_unlock(&p_pool->mut_queue_tasks); pthread_mutex_unlock(&p_pool->mut_threads); @@ -118,8 +118,9 @@ pool::run(void* p_void) void pool::run_func(void *p_void) { - socketcontainer* p_sock = static_cast(p_void); + int* p_sock = static_cast(p_void); wrap::SOCK->read_write(p_sock); + delete p_sock; } bool diff --git a/src/thrd/pool.h b/src/thrd/pool.h index 3a5f7b6..ab03b57 100755 --- a/src/thrd/pool.h +++ b/src/thrd/pool.h @@ -7,7 +7,7 @@ using namespace std; -class pool +class pool { private: friend class thro; @@ -22,7 +22,7 @@ private: this->p_func = p_func; this->p_void = p_void; } - }; + }; pthread_mutex_t mut_threads; pthread_mutex_t mut_queue_tasks; @@ -43,11 +43,10 @@ public: pool(); ~pool(); - void run(void* p_void); + void run(void* p_void); bool allow_user_login(); #ifdef NCURSES - void print_pool_size(); #endif }; diff --git a/src/time/CVS/Entries b/src/time/CVS/Entries new file mode 100644 index 0000000..6a8c339 --- /dev/null +++ b/src/time/CVS/Entries @@ -0,0 +1,5 @@ +/timo.cpp/1.5/Mon Feb 21 01:55:50 2005// +/timo.h/1.4/Mon Feb 21 01:55:50 2005// +/timr.cpp/1.16/Sat Mar 5 11:53:19 2005// +/timr.h/1.5/Mon Feb 21 01:55:50 2005// +D diff --git a/src/time/CVS/Repository b/src/time/CVS/Repository new file mode 100644 index 0000000..0922ad7 --- /dev/null +++ b/src/time/CVS/Repository @@ -0,0 +1 @@ +ychat/src/time diff --git a/src/time/CVS/Root b/src/time/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/time/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/tool/CVS/Entries b/src/tool/CVS/Entries new file mode 100644 index 0000000..0f8f81b --- /dev/null +++ b/src/tool/CVS/Entries @@ -0,0 +1,5 @@ +/dir.cpp/1.6/Mon Feb 21 01:55:50 2005// +/dir.h/1.5/Mon Feb 21 01:55:50 2005// +/tool.cpp/1.9/Mon Feb 21 01:55:50 2005// +/tool.h/1.9/Mon Feb 21 01:55:50 2005// +D diff --git a/src/tool/CVS/Repository b/src/tool/CVS/Repository new file mode 100644 index 0000000..27d92be --- /dev/null +++ b/src/tool/CVS/Repository @@ -0,0 +1 @@ +ychat/src/tool diff --git a/src/tool/CVS/Root b/src/tool/CVS/Root new file mode 100644 index 0000000..745de68 --- /dev/null +++ b/src/tool/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@buetow.org:/usr/home/cvs/cvsroot diff --git a/src/wrap.cpp b/src/wrap.cpp index d7e0dba..d737038 100755 --- a/src/wrap.cpp +++ b/src/wrap.cpp @@ -6,42 +6,34 @@ using namespace std; //<<* -chat* wrap::CHAT = NULL; +chat* wrap::CHAT; #ifdef DATABASE -data* wrap::DATA = NULL; +data* wrap::DATA; #endif -gcol* wrap::GCOL = NULL; -sman* wrap::SMAN = NULL; -modl* wrap::MODL = NULL; +gcol* wrap::GCOL; +sman* wrap::SMAN; +modl* wrap::MODL; //*>> -conf* wrap::CONF = NULL; -html* wrap::HTML = NULL; +conf* wrap::CONF; +html* wrap::HTML; #ifdef LOGGING -logd* wrap::LOGD = NULL; +logd* wrap::LOGD; #endif #ifdef NCURSES -ncur* wrap::NCUR = NULL; +ncur* wrap::NCUR; #endif -sock* wrap::SOCK = NULL; -stats* wrap::STAT = NULL; -timr* wrap::TIMR = NULL; -pool* wrap::POOL = NULL; -dynamic_wrap* wrap::WRAP = NULL; +sock* wrap::SOCK; +stats* wrap::STAT; +timr* wrap::TIMR; +pool* wrap::POOL; +dynamic_wrap* wrap::WRAP; void wrap::system_message( string s_message ) { #ifdef NCURSES - if(NCUR) - { - NCUR->print( s_message ); - } - - else - { - cout << s_message << endl; - } + NCUR->print( s_message ); #endif #ifdef SERVMSG @@ -49,20 +41,19 @@ wrap::system_message( string s_message ) #endif #ifdef LOGGING - LOGD->log_simple_line( s_message + "\n" ); #endif } void -wrap::init_wrapper(map* p_main_loop_params) +wrap::init_wrapper(map* p_start_params) { // Init the dynamic wrapper (is needed to pass all wrapped objects through a single pointer). WRAP = new dynamic_wrap; // Init the config manager. - WRAP->CONF = CONF = new conf( CONFILE, p_main_loop_params ); - delete p_main_loop_params, + WRAP->CONF = CONF = new conf( CONFILE, p_start_params ); + delete p_start_params, // Init the statistic manager. WRAP->STAT = STAT = new stats; @@ -80,17 +71,7 @@ wrap::init_wrapper(map* p_main_loop_params) // Init the session manager. WRAP->SMAN = SMAN = new sman; //*>> - // Init the socket manager. - int i_port = tool::string2int( wrap::CONF->get_elem( "httpd.serverport" ) ); - - WRAP->SOCK = SOCK = new sock; - // create the server socket and set it up to accept connections. - if(SOCK->_make_server_socket ( i_port ) <= 0) - { - system_message(SOCKER1); - exit(-1); - } #ifdef NCURSES @@ -98,16 +79,13 @@ wrap::init_wrapper(map* p_main_loop_params) NCUR->run(); // run the thread // Wait until ncurses interface has been initialized. - do - { + do { usleep(1000); - } - while ( ! NCUR->is_ready() ); + } while ( ! NCUR->is_ready() ); HTML->print_cached(0); #else #ifdef CLI - cli* p_cli = new cli; p_cli->run(); #endif @@ -116,6 +94,9 @@ wrap::init_wrapper(map* p_main_loop_params) // Init the thread pool WRAP->POOL = POOL = new pool; + // Init the socket manager. + WRAP->SOCK = SOCK = new sock; + //<<* // Init the chat manager. WRAP->CHAT = CHAT = new chat; @@ -133,13 +114,12 @@ wrap::init_wrapper(map* p_main_loop_params) // Init the data manager. #ifdef DATABASE - WRAP->DATA = DATA = new data; #endif //*>> // Run threads - TIMR->run(); -} + TIMR->run(); +} #endif diff --git a/src/wrap.h b/src/wrap.h index f5c47dd..8ce2ba4 100755 --- a/src/wrap.h +++ b/src/wrap.h @@ -2,13 +2,6 @@ #define WRAP_H #include "incl.h" - - -struct socketcontainer -{ - int i_sock; -}; - #ifdef DATABASE #include "data/data.h" #endif @@ -32,16 +25,14 @@ struct socketcontainer #endif #include "chat/sman.h" - #include "sock/sock.h" -#include "monitor/stats.h" +#include "stats.h" #include "time/timr.h" #include "thrd/pool.h" using namespace std; - class dynamic_wrap { public: @@ -89,7 +80,7 @@ public: static void system_message( string s_message ); - static void init_wrapper(map* p_main_loop_params); + static void init_wrapper(map* p_start_params); //<<* static chat* CHAT; @@ -126,5 +117,4 @@ public: static dynamic_wrap* WRAP; }; - #endif -- cgit v1.2.3