summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac9
-rw-r--r--lib/Handle.cc12
-rw-r--r--src/Main.cc20
-rw-r--r--src/paq.cc4
4 files changed, 28 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index ccdf018..5035d7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,6 @@ AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify getcwd gethostbyname m
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(deflate, z)
-AC_SEARCH_LIBS(EF_Print, efence)
if test x$ac_cv_search_deflate != xno ; then
OLDCPPFLAGS=$CPPFLAGS
@@ -103,11 +102,15 @@ else
system=`$unamepath -s`
AC_MSG_RESULT($system)
fi
-
+
AC_ARG_ENABLE([debug],
[ --enable-debug enable verbose debugging],
AC_DEFINE(DEBUG, 1, [Enable verbose debugging]))
-
+
+AC_ARG_ENABLE([efence],
+ [ --enable-efence enable compiling with electic-fence],
+ AC_SEARCH_LIBS(EF_Print, efence))
+
AC_CONFIG_FILES([baltisot-config
Makefile
doc/Makefile
diff --git a/lib/Handle.cc b/lib/Handle.cc
index 2233722..030eb2c 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -96,7 +96,7 @@ ssize_t Handle::write(const void *cbuf, size_t count) throw (GeneralException) {
ssize_t Handle::read(void *buf, size_t count) throw (GeneralException) {
ssize_t r;
-#ifdef DEBUG
+#ifdef FULLDEBUG
std::cerr << "read: reading " << count << " bytes from handle " << GetHandle() << std::endl;
#endif
@@ -252,7 +252,7 @@ void Handle::SetZ(int az) throw (GeneralException) {
}
format[index++] = (char) (az + '0');
format[index] = 0;
-#ifdef DEBUG
+#ifdef FULLDEBUG
std::cerr << "Performing gzdopen on handle " << h << " with mode \"" << format << "\"\n";
#endif
if (!(zfile = gzdopen(h, format))) {
@@ -265,7 +265,7 @@ void Handle::SetZ(int az) throw (GeneralException) {
ssize_t Handle::uwrite(const void * buf, size_t count) throw (GeneralException) {
if (z) {
itell += count;
-#ifdef DEBUG
+#ifdef FULLDEBUG
std::cerr << "Performing gzwrite of " << count << " byte for handle " << h << std::endl;
#endif
#ifdef HAVE_WD_ZLIB
@@ -273,9 +273,6 @@ ssize_t Handle::uwrite(const void * buf, size_t count) throw (GeneralException)
#else
int err = gzwrite(zfile, (char *) buf, count);
#endif
-#ifdef DEBUG
- std::cerr << "gzwrite returned " << err << std::endl;
-#endif
if (err == 0) {
const char * m = gzerror(zfile, &err);
if (err == Z_ERRNO) {
@@ -298,9 +295,6 @@ ssize_t Handle::uread(void * buf, size_t count) {
std::cerr << "Performing gzread of " << count << " byte for handle " << h << std::endl;
#endif
int err = gzread(zfile, buf, count);
-#ifdef DEBUG
- std::cerr << "gzwrite returned " << err << std::endl;
-#endif
if (err == -1) {
gzerror(zfile, &err);
if (err == Z_ERRNO) {
diff --git a/src/Main.cc b/src/Main.cc
index 6566193..22534c1 100644
--- a/src/Main.cc
+++ b/src/Main.cc
@@ -104,6 +104,18 @@ class ad_t : public Action {
};
Action * ad = new ad_t();
+class dostop_t : public Action {
+ public:
+ dostop_t() : Action("dostop") { }
+ virtual ~dostop_t() { }
+ virtual String GetTitle() { return "Arret du serveur"; }
+ virtual Task * Do(Variables * v, Variables * hds, Handle * h) {
+ TaskMan::Stop();
+ return 0;
+ }
+};
+Action * dostop = new dostop_t();
+
String Noms[] = {"Champ1", "Champ2", "Champ3"};
String Defaults[] = {"Default1", "Default2", 0};
String Invites[] = {"Champ 1:", "Champ 2:", "Champ 3:"};
@@ -138,13 +150,15 @@ Send this file: <INPUT NAME=\"userfile\" TYPE=\"file\">
</FORM>
", "upload");
-Action * Liste[] = {a1, a2, a3, a4, a5, ad, java, up};
-String Labels[] = {"Action 1", "Action 2", "Action 3", "Action 4", "Action 5", "Action dynamique", "Essai de java", "Test d'upload"};
+Action * stop = new Confirm("Stopper", "Stopper le serveur?", "stop", dostop, 0);
+
+Action * Liste[] = {a1, a2, a3, a4, a5, ad, java, up, stop};
+String Labels[] = {"Action 1", "Action 2", "Action 3", "Action 4", "Action 5", "Action dynamique", "Essai de java", "Test d'upload", "Stop"};
CODE_BEGINS
Action * buildmenu(void) {
- Action * m = new Menu("Menu Principal", "start", Labels, Liste, 8);
+ Action * m = new Menu("Menu Principal", "start", Labels, Liste, 9);
return m;
}
diff --git a/src/paq.cc b/src/paq.cc
index 96f6f39..913e925 100644
--- a/src/paq.cc
+++ b/src/paq.cc
@@ -116,7 +116,7 @@ void process_directory(const String & dirname) throw (GeneralException) {
fname = dirname + "/" + namelist[i]->d_name;
stat(fname.to_charp(), &fstats);
if (S_ISDIR(fstats.st_mode)) {
- if (!Regex("^\.{1,2}$").Match(namelist[i]->d_name)) {
+ if (!Regex("^\\.{1,2}$").Match(namelist[i]->d_name)) {
t = strlen(namelist[i]->d_name);
Archive->write(&t, 1);
Archive->write(namelist[i]->d_name, t);
@@ -130,7 +130,7 @@ void process_directory(const String & dirname) throw (GeneralException) {
process_directory(dirname + "/" + namelist[i]->d_name);
}
} else {
- if (!Regex("\.gz$").Match(namelist[i]->d_name)) {
+ if (!Regex("\\.gz$").Match(namelist[i]->d_name)) {
t = strlen(namelist[i]->d_name);
Archive->write(&t, 1);
Archive->write(namelist[i]->d_name, t);