Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 12 Sep 2013 20:59:03 +0000 (22:59 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 12 Sep 2013 20:59:03 +0000 (22:59 +0200)
Conflicts:
citadel/modules/network/serv_network.c
citadel/modules/smtp/serv_smtp.c
citadel/modules/smtp/smtp_util.c

26 files changed:
citadel/file_ops.c
citadel/modules/network/serv_netspool.c
citadel/modules/networkclient/serv_networkclient.c
citadel/modules/rssclient/serv_rssclient.c
citadel/modules/smtp/serv_smtp.c
citadel/modules/smtp/smtp_util.c
citadel/modules/smtp/smtp_util.h
citadel/parsedate.c
citadel/parsedate.y
ctdlsh/aclocal.m4
ctdlsh/configure
ctdlsh/src/ctdlsh.h
libcitadel/lib/stringbuf.c
webcit/calendar.h
webcit/calendar_view.c
webcit/dav.h
webcit/decode.c
webcit/messages.h
webcit/paramhandling.c
webcit/paramhandling.h
webcit/preferences.h
webcit/roomops.h
webcit/subst.h
webcit/tcp_sockets.h
webcit/utils.h
webcit/webserver.h

index 5547c005e0a374c20df9be7a32753111a88c0282..098554cd90d57b741768dca26bde49862349c935 100644 (file)
@@ -545,6 +545,8 @@ void cmd_ucls(char *cmd)
                        );
 
                        if (link(CC->upl_path, final_filename) == 0) {
+                               syslog(LOG_INFO, "UCLS: updoaded %s\n",
+                                      final_filename);
                                unlink(CC->upl_path);
                        }
                        else {
@@ -552,6 +554,7 @@ void cmd_ucls(char *cmd)
                                        CC->upl_path, final_filename, strerror(errno)
                                );
                        }
+                       
 
                        /* FIXME ... here we need to trigger a network run */
                }
index 9394091754712c504b4471981402c8abcf2dc1d7..be4da12af30317f19d422a5f1ee6f37edb809bcb 100644 (file)
@@ -624,7 +624,7 @@ void network_process_file(char *filename,
        long msgend = (-1L);
        long msgcur = 0L;
        int ch;
-
+       int nMessages = 0;
 
        fp = fopen(filename, "rb");
        if (fp == NULL) {
@@ -653,6 +653,7 @@ void network_process_file(char *filename,
                }
 
                ++msgcur;
+               nMessages ++;
        }
 
        msgend = msgcur - 1;
@@ -663,8 +664,15 @@ void network_process_file(char *filename,
                                        working_ignetcfg,
                                        the_netmap,
                                        netmap_changed);
+               nMessages ++;
        }
 
+       if (nMessages > 0)
+               QN_syslog(LOG_INFO,
+                         "network: processed %d messages in %s\n",
+                         nMessages,
+                         filename);
+
        fclose(fp);
        unlink(filename);
 }
index cc4ac6260a42504ebdbc84e275aa26f13e97213b..5d6a6e2dc99a39d438220856b56701bf5de588e3 100644 (file)
@@ -327,10 +327,20 @@ eNextState NWC_ReadNDOPReply(AsyncNetworker *NW)
        NWC_DBG_READ();
        if (ChrPtr(NW->IO.IOBuf)[0] == '2')
        {
+               int LogLevel = LOG_DEBUG;
 
                NW->IO.IOB.TotalSentAlready = 0;
+
                TotalSendSize = atol (ChrPtr(NW->IO.IOBuf) + 4);
-               EVN_syslog(LOG_DEBUG, "Expecting to transfer %d bytes\n", TotalSendSize);
+
+               if (TotalSendSize > 0)
+                       LogLevel = LOG_INFO;
+
+               EVN_syslog(LogLevel,
+                          "Expecting to transfer %d bytes to %s\n",
+                          TotalSendSize,
+                          ChrPtr(NW->tempFileName));
+
                if (TotalSendSize <= 0) {
                        NW->State = eNUOP - 1;
                }
@@ -434,7 +444,13 @@ eNextState NWC_ReadREADBlob(AsyncNetworker *NW)
                               ChrPtr(NW->SpoolFileName), 
                               strerror(errno));
                }
-       
+               else {
+                       EVN_syslog(LOG_INFO, 
+                              "moved %s to %s\n",
+                              ChrPtr(NW->tempFileName), 
+                              ChrPtr(NW->SpoolFileName));
+               }
+
                unlink(ChrPtr(NW->tempFileName));
                rc = NWC_DispatchWriteDone(&NW->IO);
                NW->State --;
@@ -464,6 +480,12 @@ eNextState NWC_ReadREADBlobDone(AsyncNetworker *NW)
                               ChrPtr(NW->SpoolFileName), 
                               strerror(errno));
                }
+               else {
+                       EVN_syslog(LOG_INFO, 
+                              "moved %s to %s\n",
+                              ChrPtr(NW->tempFileName), 
+                              ChrPtr(NW->SpoolFileName));
+               }
        
                unlink(ChrPtr(NW->tempFileName));
                rc = NWC_DispatchWriteDone(&NW->IO);
@@ -542,6 +564,14 @@ eNextState NWC_SendNUOP(AsyncNetworker *NW)
                if (fd > 0) close(fd);
                return rc;
        }
+       else
+               {
+               EVN_syslog(LOG_INFO,
+                          "sending %s to %s\n", 
+                          ChrPtr(NW->SpoolFileName),
+                          ChrPtr(NW->node));
+       }
+
        FDIOBufferInit(&NW->IO.IOB, &NW->IO.SendBuf, fd, TotalSendSize);
 
        StrBufPlain(NW->IO.SendBuf.Buf, HKEY("NUOP\n"));
@@ -618,7 +648,12 @@ eNextState NWC_ReadUCLS(AsyncNetworker *NW)
        AsyncIO *IO = &NW->IO;
        NWC_DBG_READ();
 
-       EVN_syslog(LOG_NOTICE, "Sent %ld octets to <%s>\n", NW->IO.IOB.ChunkSize, ChrPtr(NW->node));
+       EVN_syslog(LOG_NOTICE,
+                  "Sent %s [%ld] octets to <%s>\n",
+                  ChrPtr(NW->SpoolFileName),
+                  NW->IO.IOB.ChunkSize,
+                  ChrPtr(NW->node));
+
        if (ChrPtr(NW->IO.IOBuf)[0] == '2') {
                EVN_syslog(LOG_DEBUG, "Removing <%s>\n", ChrPtr(NW->SpoolFileName));
                unlink(ChrPtr(NW->SpoolFileName));
index 374d53d4c0cc319d112bdbaca8ed40301ca89768..701f9717b80cdfc8c95258c8aba847f74bc10619 100644 (file)
@@ -290,6 +290,8 @@ int rss_format_item(AsyncIO *IO, networker_save_message *SaveMsg)
                return 0;
        }
 
+       memset(&SaveMsg->Msg, 0, sizeof (struct CtdlMessage));
+
        if (SaveMsg->author_or_creator != NULL) {
 
                char *From;
index d96cda9bd84eb8b1d3870b75bea230b32df0960d..4eec7e85d5852400de7e4cb750b189082c7eef48 100644 (file)
  * The VRFY and EXPN commands have been removed from this implementation
  * because nobody uses these commands anymore, except for spammers.
  *
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2013 by the citadel.org team
  *
- *  This program is open source software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3.
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
  *  
- *  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.
+ * 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.
  */
 
 #include "sysdep.h"
@@ -148,6 +148,8 @@ void smtp_greeting(int is_msa)
        sSMTP->from = NewStrBufPlain(NULL, SIZ);
        sSMTP->recipients = NewStrBufPlain(NULL, SIZ);
        sSMTP->OneRcpt = NewStrBufPlain(NULL, SIZ);
+       sSMTP->preferred_sender_email = NULL;
+       sSMTP->preferred_sender_name = NULL;
 
        /* If this config option is set, reject connections from problem
         * addresses immediately instead of after they execute a RCPT
@@ -339,6 +341,7 @@ void smtp_webcit_preferences_hack_backend(long msgnum, void *userdata) {
 void smtp_webcit_preferences_hack(void) {
        char config_roomname[ROOMNAMELEN];
        char *webcit_conf = NULL;
+       citsmtp *sSMTP = SMTP;
 
        snprintf(config_roomname, sizeof config_roomname, "%010ld.%s", CC->user.usernum, USERCONFIGROOM);
        if (CtdlGetRoom(&CC->room, config_roomname) != 0) {
@@ -355,10 +358,24 @@ void smtp_webcit_preferences_hack(void) {
                return;
        }
 
-       /* FIXME : now do something with this data */
+       /* Parse the webcit configuration and attempt to do something useful with it */
+       char *str = webcit_conf;
+       char *saveptr = str;
+       char *this_line = NULL;
+       while (this_line = strtok_r(str, "\n", &saveptr), this_line != NULL) {
+               str = NULL;
+               if (!strncasecmp(this_line, "defaultfrom|", 12)) {
+                       sSMTP->preferred_sender_email = NewStrBufPlain(&this_line[12], -1);
+               }
+               if (!strncasecmp(this_line, "defaultname|", 12)) {
+                       sSMTP->preferred_sender_name = NewStrBufPlain(&this_line[12], -1);
+               }
+               if ((!strncasecmp(this_line, "defaultname|", 12)) && (sSMTP->preferred_sender_name == NULL)) {
+                       sSMTP->preferred_sender_name = NewStrBufPlain(&this_line[12], -1);
+               }
 
+       }
        free(webcit_conf);
-       abort();
 }
 
 
@@ -447,7 +464,7 @@ void smtp_try_plain(long offset, long Flags)
 
        if (result == login_ok) {
                if (CtdlTryPassword(pass, len) == pass_ok) {
-////                   smtp_webcit_preferences_hack();
+                       smtp_webcit_preferences_hack();
                        smtp_auth_greeting(offset, Flags);
                        return;
                }
@@ -842,13 +859,19 @@ void smtp_data(long offset, long flags)
                        return;
                }
 
-               CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
                CM_SetField(msg, eNodeName, config.c_nodename, strlen(config.c_nodename));
                CM_SetField(msg, eHumanNode, config.c_humannode, strlen(config.c_humannode));
                CM_SetField(msg, eOriginalRoom, HKEY(MAILROOM));
+               if (sSMTP->preferred_sender_name != NULL)
+                       CM_SetFieldSB(msg, eAuthor, sSMTP->preferred_sender_name);
+               else 
+                       CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
 
                if (!validemail) {
-                       CM_SetField(msg, erFc822Addr, CCC->cs_inet_email, strlen(CCC->cs_inet_email));
+                       if((sSMTP->preferred_sender_email != NULL)
+                               CM_SetFieldSB(msg, erFc822Addr, sSMTP->preferred_sender_email)) 
+                       else
+                               CM_SetField(msg, erFc822Addr, CCC->cs_inet_email, strlen(CCC->cs_inet_email));
                }
        }
 
@@ -1048,6 +1071,8 @@ void smtp_cleanup_function(void)
        FreeStrBuf(&sSMTP->from);
        FreeStrBuf(&sSMTP->recipients);
        FreeStrBuf(&sSMTP->OneRcpt);
+       FreeStrBuf(&sSMTP->preferred_sender_email);
+       FreeStrBuf(&sSMTP->preferred_sender_name);
 
        free(sSMTP);
 }
index d6633fb564799bc3051fa614a021b95c9b663c54..dae60b6daf14a8d46f2c457d9fbcfd69ddca4302 100644 (file)
@@ -287,6 +287,7 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
        StrBufAppendBuf(BounceMB, boundary, 0);
        StrBufAppendBufPlain(BounceMB, HKEY("--\r\n"), 0);
        CM_SetAsFieldSB(bmsg, eMesageText, &BounceMB);
+
        /* Deliver the bounce if there's anything worth mentioning */
        syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
        if (num_bounces > 0) {
index 1da497de0b3c4f41eb69b1cc0ace38a9d92c7a98..7666a34dfc3980abe56ca9ce833867faaf493c80 100644 (file)
  * The VRFY and EXPN commands have been removed from this implementation
  * because nobody uses these commands anymore, except for spammers.
  *
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2013 by the citadel.org team
  *
- *  This program is open source software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3.
- *  
- *  
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
  *
- *  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.
+ * 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.
  *
- *  
- *  
- *  
  */
 
 const char *smtp_get_Recipients(void);
@@ -52,7 +47,9 @@ typedef struct _citsmtp {             /* Information about the current session */
        int is_lmtp;
        int is_unfiltered;
        int is_msa;
-}citsmtp;
+       StrBuf *preferred_sender_email;
+       StrBuf *preferred_sender_name;
+} citsmtp;
 
 #define SMTP           ((citsmtp *)CC->session_specific_data)
 
index 67342a5d1f43c03319255e1603bb9f882ea0a05d..74cf35563cda9122297f4d7745effdf876222af6 100644 (file)
@@ -76,7 +76,7 @@
 **  <rsalz@osf.org> and Jim Berets <jberets@bbn.com> in August, 1990.
 **  Further revised (removed obsolete constructs and cleaned up timezone
 **  names) in August, 1991, by Rich.  Paul Eggert <eggert@twinsun.com>
-**  helped in September, 1992.  Art Cancro <ajc@uncensored.citadel.org> cleaned
+**  helped in September, 1992.  Art Cancro <ajc@citadel.org> cleaned
 **  it up for ANSI C in December, 1999.
 **
 **  This grammar has six shift/reduce conflicts.
index f3e94ef7654fd3b8e28d52b038318650bc119d1f..3166f310698c3140c8b1e9faac3c08ef88903c5c 100644 (file)
@@ -7,7 +7,7 @@
 **  <rsalz@osf.org> and Jim Berets <jberets@bbn.com> in August, 1990.
 **  Further revised (removed obsolete constructs and cleaned up timezone
 **  names) in August, 1991, by Rich.  Paul Eggert <eggert@twinsun.com>
-**  helped in September, 1992.  Art Cancro <ajc@uncensored.citadel.org> cleaned
+**  helped in September, 1992.  Art Cancro <ajc@citadel.org> cleaned
 **  it up for ANSI C in December, 1999.
 **
 **  This grammar has six shift/reduce conflicts.
index eba341be3583f26c2c893183899595fbf50f9198..1bc55f421bc3643c0cc620f1fa49458893221ed1 100644 (file)
@@ -13,8 +13,8 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
-[m4_warning([this file was generated for autoconf 2.67.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
index bf18a053db5b5e2fe62ff5d5ff3ff4360afb75aa..4debd9968d818ea61a0f2cb1b235e43ed657dd1e 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for ctdlsh 1.0.
+# Generated by GNU Autoconf 2.68 for ctdlsh 1.0.
 #
 # Report bugs to <bug-automake@gnu.org>.
 #
@@ -91,6 +91,7 @@ fi
 IFS=" ""       $as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -215,11 +216,18 @@ IFS=$as_save_IFS
   # We cannot yet assume a decent shell, so we have to provide a
        # neutralization value for shells without unset; and this also
        # works around shells that cannot unset nonexistent variables.
+       # Preserve -v and -x to the replacement shell.
        BASH_ENV=/dev/null
        ENV=/dev/null
        (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
        export CONFIG_SHELL
-       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+       case $- in # ((((
+         *v*x* | *x*v* ) as_opts=-vx ;;
+         *v* ) as_opts=-v ;;
+         *x* ) as_opts=-x ;;
+         * ) as_opts= ;;
+       esac
+       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
@@ -1055,7 +1063,7 @@ Try \`$0 --help' for more information"
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1352,7 +1360,7 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 ctdlsh configure 1.0
-generated by GNU Autoconf 2.67
+generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -1398,7 +1406,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
        ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1444,7 +1452,7 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
@@ -1453,7 +1461,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by ctdlsh $as_me 1.0, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
 
@@ -1711,7 +1719,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -1848,7 +1856,7 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -1935,11 +1943,11 @@ am_lf='
 '
 case `pwd` in
   *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
 esac
 
 # Do `set' in a subshell so we don't clobber the current shell's
@@ -2025,7 +2033,7 @@ if test "$cross_compiling" != no; then
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
+if ${ac_cv_prog_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
@@ -2065,7 +2073,7 @@ if test -z "$ac_cv_prog_STRIP"; then
 set dummy strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
@@ -2118,7 +2126,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
-  if test "${ac_cv_path_mkdir+set}" = set; then :
+  if ${ac_cv_path_mkdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2169,7 +2177,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
+if ${ac_cv_prog_AWK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
@@ -2209,7 +2217,7 @@ done
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -2317,7 +2325,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2357,7 +2365,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2410,7 +2418,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2450,7 +2458,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2509,7 +2517,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2553,7 +2561,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2608,7 +2616,7 @@ fi
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -2723,7 +2731,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -2766,7 +2774,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -2825,7 +2833,7 @@ $as_echo "$ac_try_echo"; } >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -2836,7 +2844,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2877,7 +2885,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -2887,7 +2895,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2924,7 +2932,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3002,7 +3010,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3163,7 +3171,7 @@ depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
@@ -3472,10 +3480,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -3523,7 +3542,7 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -3624,6 +3643,7 @@ fi
 IFS=" ""       $as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3931,7 +3951,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # values after options handling.
 ac_log="
 This file was extended by ctdlsh $as_me 1.0, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -3997,7 +4017,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 ctdlsh config.status 1.0
-configured by $0, generated by GNU Autoconf 2.67,
+configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -4130,7 +4150,7 @@ do
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -4153,9 +4173,10 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -4163,12 +4184,13 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -4190,7 +4212,7 @@ else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -4218,7 +4240,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -4266,7 +4288,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = "\a"
 
@@ -4298,7 +4320,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -4332,7 +4354,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -4344,8 +4366,8 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -4446,7 +4468,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -4465,7 +4487,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
         # (if the path is not absolute).  The absolute path cannot be DOS-style,
         # because $ac_f cannot contain `:'.
@@ -4474,7 +4496,7 @@ do
           [\\/$]*) false;;
           *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
           esac ||
-          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -4500,8 +4522,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -4637,21 +4659,22 @@ s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -4662,20 +4685,20 @@ which seems to be undefined.  Please make sure it is defined" >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
+      mv "$ac_tmp/config.h" "$ac_file" \
        || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
 # Compute "$ac_file"'s index in $config_headers.
index 5152bd942ec63541a23d0fa1fac38f55bc8c416b..8424391e38f23764b5d1dd41b97ae431377c9412 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * main header file for ctdlsh
  *
- * Copyright (c) 2009-2012 by the citadel.org team
+ * Copyright (c) 2009-2013 by the citadel.org team
  * This program is open source software, cheerfully made available to
  * you under the terms of the GNU General Public License version 3.
  */
@@ -28,7 +28,9 @@
  * Set to the location of Citadel
  * FIXME this needs to be configurable
  */
+#ifndef CTDLDIR
 #define CTDLDIR        "/usr/local/citadel"
+#endif
 
 typedef int ctdlsh_cmdfunc_t(int, char *);
 
index bd67e0d48a93ad19eee581390e115d970de3ce0b..1b9ea072366221b9bea1f8cf1f438a229f795bb3 100644 (file)
@@ -3934,9 +3934,17 @@ long IOBufferStrLength(IOBuffer *FB)
        return StrLength(FB->Buf) - (FB->ReadWritePointer - FB->Buf->buf);
 }
 
-void FDIOBufferInit(FDIOBuffer *FDB, IOBuffer *IO, int FD, long TotalSendSize)
+inline static void FDIOBufferFlush(FDIOBuffer *FDB)
 {
        memset(FDB, 0, sizeof(FDIOBuffer));
+       FDB->OtherFD = -1;
+       FDB->SplicePipe[0] = -1;
+       FDB->SplicePipe[1] = -1;
+}
+
+void FDIOBufferInit(FDIOBuffer *FDB, IOBuffer *IO, int FD, long TotalSendSize)
+{
+       FDIOBufferFlush(FDB);
        FDB->ChunkSize = 
                FDB->TotalSendSize = TotalSendSize;
        FDB->IOB = IO;
@@ -3955,15 +3963,18 @@ void FDIOBufferDelete(FDIOBuffer *FDB)
 #ifdef LINUX_SPLICE
        if (EnableSplice)
        {
-               close(FDB->SplicePipe[0]);
-               close(FDB->SplicePipe[1]);
+               if (FDB->SplicePipe[0] > 0)
+                       close(FDB->SplicePipe[0]);
+               if (FDB->SplicePipe[1] > 0)
+                       close(FDB->SplicePipe[1]);
        }
        else
 #endif
                FreeStrBuf(&FDB->ChunkBuffer);
        
-       close(FDB->OtherFD);
-       memset(FDB, 0, sizeof(FDIOBuffer));     
+       if (FDB->OtherFD > 0)
+               close(FDB->OtherFD);
+       FDIOBufferFlush(FDB);
 }
 
 int FileSendChunked(FDIOBuffer *FDB, const char **Err)
index a5571a0e49c98dff0e7afef05a606356d83965d2..ee1f8bc6a061a0f7ddcfe196eb810470c364bf9e 100644 (file)
@@ -1,19 +1,13 @@
 /*
- * Copyright (c) 1996-2012 by the citadel.org team
+ * Copyright (c) 1996-2013 by the citadel.org team
  *
  * This program is open source software.  You can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
- * 
- * 
  *
  * 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.
- *
- * 
- * 
- * 
  */
 
 #ifndef __CALENDAR_H__
index 0e8ac9843385bc217f6326014f2110af9c2033cd..bfc455728740c1b3bd23d318418fdfcced4974f6 100644 (file)
@@ -17,8 +17,8 @@
 #include "calendar.h"
 
 /* These define how high the hour rows are in the day view */
-#define TIMELINE       30
-#define EXTRATIMELINE  (TIMELINE / 2)
+#define TIMELINE       22
+#define EXTRATIMELINE  22
 
 void embeddable_mini_calendar(int year, int month)
 {
index a2963f0fb7b30dfa158d98083f89d76e34cbca33..3426c81cde61d30dfc652a4d0eac5a04b70c40d6 100644 (file)
@@ -1,6 +1,18 @@
 /*
- * Data passed back and forth between dav_get() and its
- * callback functions called by the MIME parser
+ * Copyright (c) 1996-2013 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * 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.
+ */
+
+
+/*
+ * Data passed back and forth between dav_get() and its callback functions called by the MIME parser
  */
 struct epdata {
        char desired_content_type_1[128];
index 2593d8c72d99a3a090c5ca9b673c8aedda82ee0e..cf1f4aeb796a40f720869f234bb9700d3ecbce62 100644 (file)
@@ -67,12 +67,12 @@ void utf8ify_rfc822_string(char **buf) {
        char encoding[16];
        char istr[1024];
        iconv_t ic = (iconv_t)(-1) ;
-       char *ibuf;                     /**< Buffer of characters to be converted */
-       char *obuf;                     /**< Buffer for converted characters */
-       size_t ibuflen;                 /**< Length of input buffer */
-       size_t obuflen;                 /**< Length of output buffer */
-       char *isav;                     /**< Saved pointer to input buffer */
-       char *osav;                     /**< Saved pointer to output buffer */
+       char *ibuf;                     /* Buffer of characters to be converted */
+       char *obuf;                     /* Buffer for converted characters */
+       size_t ibuflen;                 /* Length of input buffer */
+       size_t obuflen;                 /* Length of output buffer */
+       char *isav;                     /* Saved pointer to input buffer */
+       char *osav;                     /* Saved pointer to output buffer */
        int passes = 0;
        int i, len, delta;
        int illegal_non_rfc2047_encoding = 0;
@@ -174,10 +174,10 @@ void utf8ify_rfc822_string(char **buf) {
 
                ibuf = malloc(1024);
                isav = ibuf;
-               if (!strcasecmp(encoding, "B")) {       /**< base64 */
+               if (!strcasecmp(encoding, "B")) {       /* base64 */
                        ibuflen = CtdlDecodeBase64(ibuf, istr, strlen(istr));
                }
-               else if (!strcasecmp(encoding, "Q")) {  /**< quoted-printable */
+               else if (!strcasecmp(encoding, "Q")) {  /* quoted-printable */
                        size_t len;
                        long pos;
                        
@@ -192,7 +192,7 @@ void utf8ify_rfc822_string(char **buf) {
                        ibuflen = CtdlDecodeQuotedPrintable(ibuf, istr, len);
                }
                else {
-                       strcpy(ibuf, istr);             /**< unknown encoding */
+                       strcpy(ibuf, istr);             /* unknown encoding */
                        ibuflen = strlen(istr);
                }
 
@@ -254,16 +254,15 @@ inline void utf8ify_rfc822_string(char **a){};
 
 
 
-/**
- * \brief      RFC2047-encode a header field if necessary.
- *             If no non-ASCII characters are found, the string
- *             will be copied verbatim without encoding.
+/*
+ * RFC2047-encode a header field if necessary.
+ * If no non-ASCII characters are found, the string will be copied verbatim without encoding.
+ * Returns encoded length; -1 if non success.
  *
- * \param      target          Target buffer.
- * \param      maxlen          Maximum size of target buffer.
- * \param      source          Source string to be encoded.
- * \param       SourceLen       Length of the source string
- * \returns     encoded length; -1 if non success.
+ * target              Target buffer.
+ * maxlen              Maximum size of target buffer.
+ * source              Source string to be encoded.
+ * SourceLen           Length of the source string
  */
 int webcit_rfc2047encode(char *target, int maxlen, char *source, long SourceLen)
 {
index 050117b0e2dd7df7a136eab2ff68045188d67537..0738e947e39ff3ba1e80f4641c792853a52c6a96 100644 (file)
@@ -1,3 +1,15 @@
+/*
+ * Copyright (c) 1996-2013 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * 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.
+ */
+
 extern CtxType CTX_MAILSUM;
 extern CtxType CTX_MIME_ATACH;
 extern HashList *MsgHeaderHandler;
index a317ad39daff72f72d330d5652071913ed978c7d..f7d1a325d21fd85b83c02b83449628411b2814ec 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * parse urlparts and post data
  *
- * Copyright (c) 1996-2012 by the citadel.org team
+ * Copyright (c) 1996-2013 by the citadel.org team
  *
  * This program is open source software.  You can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
 #include "webcit.h"
 #include "webserver.h"
 
+/* uncomment to see all parameters sent to the server by the browser. */
+/* #define DEBUG_URLSTRINGS */
+
+
 void free_url(void *U)
 {
        urlcontent *u = (urlcontent*) U;
@@ -27,19 +31,21 @@ void free_url(void *U)
  */
 void ParseURLParams(StrBuf *url)
 {
-       const char *aptr, *bptr, *eptr, *up;
-       int len, keylen;
-       urlcontent *u;
+       const char *aptr, *bptr, *eptr, *up = NULL;
+       int len, keylen = 0;
+       urlcontent *u = NULL;
        wcsession *WCC = WC;
 
-       if (WCC->Hdr->urlstrings == NULL)
+       if (WCC->Hdr->urlstrings == NULL) {
                WCC->Hdr->urlstrings = NewHash(1, NULL);
+       }
        eptr = ChrPtr(url) + StrLength(url);
        up = ChrPtr(url);
        while ((up < eptr) && (!IsEmptyStr(up))) {
                aptr = up;
-               while ((aptr < eptr) && (*aptr != '\0') && (*aptr != '='))
+               while ((aptr < eptr) && (*aptr != '\0') && (*aptr != '=')) {
                        aptr++;
+               }
                if (*aptr != '=') {
                        return;
                }
@@ -50,16 +56,17 @@ void ParseURLParams(StrBuf *url)
                        bptr++;
                }
                keylen = aptr - up - 1; /* -1 -> '=' */
-               if(keylen >= sizeof(u->url_key)) {
-                       syslog(LOG_WARNING, "invalid url_key from %s", ChrPtr(WCC->Hdr->HR.browser_host));
-                       return;
+               if (keylen > sizeof(u->url_key)) {
+                       syslog(LOG_WARNING, "%s:%d: invalid url_key of size %d in string size %d",
+                               __FILE__, __LINE__, keylen, sizeof(u->url_key)
+                       );
                }
 
                u = (urlcontent *) malloc(sizeof(urlcontent));
                memcpy(u->url_key, up, keylen);
                u->url_key[keylen] = '\0';
                if (keylen < 0) {
-                       syslog(LOG_WARNING, "invalid url_key from %s", ChrPtr(WCC->Hdr->HR.browser_host));
+                       syslog(LOG_WARNING, "%s:%d: invalid url_key of size %d", __FILE__, __LINE__, keylen);
                        free(u);
                        return;
                }
@@ -357,7 +364,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
                WCC->upload_filename = NewStrBufPlain(filename, -1);
                safestrncpy(WCC->upload_content_type, cbtype, sizeof(WC->upload_content_type));
 #ifdef DEBUG_URLSTRINGS
-               syslog(LOG_DEBUG, "File: <%s> len: [%ld]", filename, length);
+               syslog(LOG_DEBUG, "File: <%s> len: [%ld]", filename, (long int)length);
 #endif
                
        }
@@ -367,10 +374,9 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
 void PutBstr(const char *key, long keylen, StrBuf *Value)
 {
        urlcontent *u;
-       wcsession *WCC = WC;
 
        if(keylen >= sizeof(u->url_key)) {
-               syslog(LOG_WARNING, "invalid url_key from %s", ChrPtr(WCC->Hdr->HR.browser_host));
+               syslog(LOG_WARNING, "%s:%d: invalid url_key of size %ld", __FILE__, __LINE__, keylen);
                FreeStrBuf(&Value);
                return;
        }
index 87b0b1cec65ae1ff103aab804497f26930f7666d..4aaddea71cff0df7ea5a631a3415e7e43c87fd17 100644 (file)
@@ -1,3 +1,15 @@
+/*
+ * Copyright (c) 1996-2013 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * 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.
+ */
+
 /* URL / Mime Post parsing -> paramhandling.c */
 void upload_handler(char *name, char *filename, char *partnum, char *disp,
                    void *content, char *cbtype, char *cbcharset,
index 7a3c04300ec5923da5abdf6eb6c40b59da870add..7a30a7bbde56a33d5aee5088b0775594ebc881ef 100644 (file)
@@ -1,3 +1,15 @@
+/*
+ * Copyright (c) 1996-2013 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * 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.
+ */
+
 
 typedef enum _ePrefType{
        PRF_UNSET = 0,
index 7d9cd89e3792281e9e51ac22bb9796fa76a276cd..fd1f60e4ae62686a1bf9606569bc96722cf73097 100644 (file)
@@ -1,8 +1,20 @@
+/*
+ * Copyright (c) 1996-2013 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * 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.
+ */
+
 
 #define VIRTUAL_MY_FLOOR -1
 
 /*
- * \brief This struct holds a list of rooms for \\\<G\\\>oto operations.
+ * This struct holds a list of rooms for "Goto" operations.
  */
 struct march {
        struct march *next;       /* pointer to next in linked list */
@@ -11,9 +23,8 @@ struct march {
        int march_order;          /* sequence in which we are to visit this room */
 };
 
-/* *
- * \brief      This struct holds a list of rooms for client display.
- *             It is a binary tree.
+/*
+ * This struct holds a list of rooms for client display. It is a binary tree.
  */
 struct roomlisting {
        struct roomlisting *lnext;      /* pointer to 'left' tree node */
@@ -35,8 +46,8 @@ typedef struct _floor {
        long AlphaN;
 } Floor;
 
-/**
- * \brief  Data structure for roomlist-to-folderlist conversion 
+/*
+ * Data structure for roomlist-to-folderlist conversion 
  */
 struct __ofolder {
        int floor;      /* which floor is it on */
@@ -51,8 +62,8 @@ struct __ofolder {
 
 
 
-/**
- * \brief  Data structure for roomlist-to-folderlist conversion 
+/*
+ * Data structure for roomlist-to-folderlist conversion 
  */
 typedef struct _folder {
        /* Data citserver tells us about the room */
@@ -108,7 +119,7 @@ typedef struct _folder {
        int BumpUsers; /* if SETR set to 1 to make all users who knew this room to forget about it. */
 
        HashList *IgnetCfgs[maxRoomNetCfg + 1];
-}folder;
+} folder;
 
 HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
 void vDeleteFolder(void *vFolder);
index 30c3a6b66ff743379595473b03c1c7ae81ea891e..bd6f8318d97d1d0202c8a93de535c546a64bb3a6 100644 (file)
@@ -1,5 +1,15 @@
-/**
- * @defgroup subst Template processing functions
+/*
+ * Copyright (c) 1996-2013 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * 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.
+ *
+ * subst template processing functions
  */
 
 extern HashList *Conditionals;
index a8bfb20ca3e266fa4d42e5b2d16c3590a1f18486..8528539bf9ef04d32036f20716b9049b736862a9 100644 (file)
@@ -1,26 +1,36 @@
+/*
+ * Copyright (c) 1996-2013 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * 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.
+ */
+
 int uds_connectsock(char *);
 int tcp_connectsock(char *, char *);
 int serv_getln(char *strbuf, int bufsize);
 int StrBuf_ServGetln(StrBuf *buf);
 
-/**
- * @defgroup CoreSrv Core Server Functionality
+/*
+ * parse & check the server reply 
+ *
+ * Line                the line containing the server reply
+ * FullState   if you need more than just the major number, this is returns it. Ignored if NULL.
+ * PutImportantMessage if you want to forward the text part of the server reply to the user, specify 1; 
+ *             the result will be put into the 'Important Message' framework.
+ * MajorOK     in case of which major number not to put the ImportantMessage? 0 for all.
+ *
+ * returns the most significant digit of the server status
  */
 
-/**
- * @ingroup CoreSrv
- * @brief parse & check the server reply 
- * @param Line the line containing the server reply
- * @param FullState if you need more than just the major number, this is returns it. Ignored if NULL.
- * @param PutImportantMessage if you want to forward the text part of the server reply to the user, specify 1; 
- *    the result will be put into the 'Important Message' framework.
- * @param MajorOK in case of which major number not to put the ImportantMessage? 0 for all.
- * @return the most significant digit of the server status
- */
 int GetServerStatusMsg(StrBuf *Line, long* FullState, int PutImportantMessage, int MajorOK);
-/**
- * @ingroup CoreSrv
- * @brief to migrate old calls.... 
+
+/*
+ * to migrate old calls.... 
  */
 #define GetServerStatus(a, b) GetServerStatusMsg(a, b, 0, 0)
 
index 57cf13b9f5e8848c840507ceccd6f62d07908bc2..7c322492b351f434a635928ed2b0d615af701491 100644 (file)
@@ -1,3 +1,15 @@
+/*
+ * Copyright (c) 1996-2013 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * 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.
+ */
+
 void StrEscPuts(const StrBuf *strbuf);
 void StrEscputs1(const StrBuf *strbuf, int nbsp, int nolinebreaks);
 
index 51926cbf58b13d5b7354db54d5a6d0a1b1459891..dc142d0d1a08e7a7887efbb0cbb078e7e8e570a1 100644 (file)
@@ -1,3 +1,15 @@
+/*
+ * Copyright (c) 1996-2013 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * 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.
+ */
+
 
 extern char *static_dirs[PATH_MAX];          /**< Web representation */
 extern int ndirs;