Updated to apply cleanly.
[rsync-patches.git] / ODBC-dblog.diff
index c71ed01c386f99c865acbee21b120d9763778d13..e82beebd9d616d232783a68f5855bc6a78453579 100644 (file)
@@ -88,8 +88,8 @@ This patch adds the following options:
     automatically generates unique IDs).  Defaults to True.
 
 
---- Makefile.in        2 May 2004 17:04:14 -0000       1.100
-+++ Makefile.in        13 May 2004 18:17:08 -0000
+--- orig/Makefile.in   2004-11-02 16:47:15
++++ Makefile.in        2004-07-03 20:22:18
 @@ -32,7 +32,7 @@ ZLIBOBJ=zlib/deflate.o zlib/infblock.o z
        zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
        zlib/zutil.o zlib/adler32.o
@@ -99,46 +99,46 @@ This patch adds the following options:
  OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
        fileio.o batch.o clientname.o
  OBJS3=progress.o pipe.o
---- cleanup.c  13 May 2004 07:08:18 -0000      1.22
-+++ cleanup.c  13 May 2004 18:17:08 -0000
-@@ -140,7 +140,12 @@ void _exit_cleanup(int code, const char 
-                       code = RERR_VANISHED;
+--- orig/cleanup.c     2005-03-05 18:58:38
++++ cleanup.c  2004-07-03 20:22:18
+@@ -144,8 +144,12 @@ void _exit_cleanup(int code, const char 
+                       code = RERR_PARTIAL;
        }
  
--      if (code) log_exit(code, file, line);
+-      if (code)
 +      if (code) {
-+              log_exit(code, file, line);
-+#ifdef HAVE_LIBODBC
+               log_exit(code, file, line);
++#if HAVE_LIBODBC
 +              db_log_exit(code,file,line);
 +#endif
 +      }
  
        if (verbose > 2) {
                rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): about to call exit(%d)\n",
---- clientserver.c     14 Apr 2004 23:33:34 -0000      1.121
-+++ clientserver.c     13 May 2004 18:17:08 -0000
-@@ -311,6 +311,9 @@ static int rsync_module(int f_in, int f_
-       exclude_path_prefix = NULL;
+--- orig/clientserver.c        2005-03-01 03:39:32
++++ clientserver.c     2004-07-03 20:22:18
+@@ -351,6 +351,9 @@ static int rsync_module(int f_in, int f_
+                  XFLG_ANCHORED2ABS | XFLG_OLD_PREFIXES);
  
        log_init();
-+#ifdef HAVE_LIBODBC
++#if HAVE_LIBODBC
 +      db_log_open();
 +#endif
  
        if (use_chroot) {
                /*
-@@ -429,6 +432,9 @@ static int rsync_module(int f_in, int f_
-                       rprintf(FINFO,"rsync %s %s from %s@%s (%s)\n",
-                               am_sender?"on":"to",
+@@ -473,6 +476,9 @@ static int rsync_module(int f_in, int f_
+                       rprintf(FLOG, "rsync %s %s from %s@%s (%s)\n",
+                               am_sender ? "on" : "to",
                                request, auth_user, host, addr);
-+#ifdef HAVE_LIBODBC
++#if HAVE_LIBODBC
 +                      db_log_session();
 +#endif
                } else {
-                       rprintf(FINFO,"rsync %s %s from %s (%s)\n",
-                               am_sender?"on":"to",
---- configure.in       30 Apr 2004 18:03:33 -0000      1.196
-+++ configure.in       13 May 2004 18:17:08 -0000
+                       rprintf(FLOG, "rsync %s %s from %s (%s)\n",
+                               am_sender ? "on" : "to",
+--- orig/configure.in  2005-03-16 02:19:29.819770817
++++ configure.in       2004-07-03 20:22:18
 @@ -94,6 +94,8 @@ AC_ARG_WITH(rsync-path,
        [  --with-rsync-path=PATH  set default --rsync-path to PATH (default: rsync)],
        [ RSYNC_PATH="$with_rsync_path" ],
@@ -148,23 +148,23 @@ This patch adds the following options:
  
  AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])
  
-@@ -463,6 +465,14 @@ fi
- if test x"$with_included_popt" != x"yes"
- then
+@@ -524,6 +526,14 @@ then
      AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes])
-+fi
-+
+ fi
 +if test x"$with_ODBC" = x"yes"
 +then
 +    AC_CHECK_HEADERS(sql.h sqlext.h sqltypes.h)
 +    AC_CHECK_LIB(odbc,SQLExecDirect)
 +    EXTRA_OBJECT="$EXTRA_OBJECT dblog.o"
 +    AC_SUBST(EXTRA_OBJECT)
- fi
++fi
++
  AC_MSG_CHECKING([whether to use included libpopt])
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ dblog-tables-mysql.sql     13 May 2004 18:17:08 -0000
+ if test x"$with_included_popt" = x"yes"
+ then
+--- orig/dblog-tables-mysql.sql        2004-07-02 21:35:58
++++ dblog-tables-mysql.sql     2004-07-02 21:35:58
 @@ -0,0 +1,43 @@
 +drop table transfer;
 +drop table exit;
@@ -209,8 +209,8 @@ This patch adds the following options:
 +      Primary Key (id),
 +      foreign key (session_id) references session (id)
 +);
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ dblog-tables-postgresql.sql        13 May 2004 18:17:08 -0000
+--- orig/dblog-tables-postgresql.sql   2004-07-02 21:35:58
++++ dblog-tables-postgresql.sql        2004-07-02 21:35:58
 @@ -0,0 +1,45 @@
 +drop table transfer;
 +drop table exit;
@@ -257,8 +257,8 @@ This patch adds the following options:
 +      Primary Key (id),
 +      foreign key (session_id) references session (id)
 +);
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ dblog.c    13 May 2004 18:17:08 -0000
+--- orig/dblog.c       2004-07-02 21:35:58
++++ dblog.c    2004-07-02 21:35:58
 @@ -0,0 +1,352 @@
 +/*
 + *  ODBC Database logging functions
@@ -269,26 +269,26 @@ This patch adds the following options:
 +
 +#include "rsync.h"
 +
-+#ifdef HAVE_SQL_H
++#if HAVE_SQL_H
 +#include <sql.h>
 +#else
-+#ifdef HAVE_ODBC_SQL_H
++#if HAVE_ODBC_SQL_H
 +#include <odbc/sql.h>
 +#endif
 +#endif
 +
-+#ifdef HAVE_SQLEXT_H
++#if HAVE_SQLEXT_H
 +#include <sqlext.h>
 +#else
-+#ifdef HAVE_ODBC_SQLEXT_H
++#if HAVE_ODBC_SQLEXT_H
 +#include <odbc/sqlext.h>
 +#endif
 +#endif
 +
-+#ifdef HAVE_SQLTYPES_H
++#if HAVE_SQLTYPES_H
 +#include <sqltypes.h>
 +#else
-+#ifdef HAVE_ODBC_SQLTYPES_H
++#if HAVE_ODBC_SQLTYPES_H
 +#include <odbc/sqltypes.h>
 +#endif
 +#endif
@@ -612,9 +612,9 @@ This patch adds the following options:
 +              rprintf(FERROR,"Error at db_log_exit: Not connected to database!\n");
 +      }
 +}
---- loadparm.c 4 Feb 2004 07:31:29 -0000       1.50
-+++ loadparm.c 13 May 2004 18:17:08 -0000
-@@ -122,6 +122,17 @@ typedef struct
+--- orig/loadparm.c    2005-02-19 17:38:51
++++ loadparm.c 2004-07-03 20:22:18
+@@ -125,6 +125,17 @@ typedef struct
        BOOL list;
        BOOL use_chroot;
        BOOL transfer_logging;
@@ -632,7 +632,7 @@ This patch adds the following options:
        BOOL ignore_errors;
        char *uid;
        char *gid;
-@@ -154,6 +165,17 @@ static service sDefault =
+@@ -159,6 +170,17 @@ static service sDefault =
        True,    /* list */
        True,    /* use chroot */
        False,   /* transfer logging */
@@ -650,7 +650,7 @@ This patch adds the following options:
        False,   /* ignore errors */
        "nobody",/* uid */
  
-@@ -292,6 +314,17 @@ static struct parm_struct parm_table[] =
+@@ -302,6 +324,17 @@ static struct parm_struct parm_table[] =
    {"include",          P_STRING,  P_LOCAL,  &sDefault.include,     NULL,   0},
    {"include from",     P_STRING,  P_LOCAL,  &sDefault.include_from,NULL,   0},
    {"transfer logging", P_BOOL,    P_LOCAL,  &sDefault.transfer_logging,NULL,0},
@@ -668,7 +668,7 @@ This patch adds the following options:
    {"ignore errors",    P_BOOL,    P_LOCAL,  &sDefault.ignore_errors,NULL,0},
    {"log format",       P_STRING,  P_LOCAL,  &sDefault.log_format,  NULL,   0},
    {"refuse options",   P_STRING,  P_LOCAL,  &sDefault.refuse_options,NULL, 0},
-@@ -359,6 +392,17 @@ FN_LOCAL_BOOL(lp_read_only, read_only)
+@@ -372,6 +405,17 @@ FN_LOCAL_BOOL(lp_write_only, write_only)
  FN_LOCAL_BOOL(lp_list, list)
  FN_LOCAL_BOOL(lp_use_chroot, use_chroot)
  FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging)
@@ -686,9 +686,9 @@ This patch adds the following options:
  FN_LOCAL_BOOL(lp_ignore_errors, ignore_errors)
  FN_LOCAL_BOOL(lp_ignore_nonreadable, ignore_nonreadable)
  FN_LOCAL_STRING(lp_uid, uid)
---- log.c      29 Apr 2004 19:34:31 -0000      1.72
-+++ log.c      13 May 2004 18:17:09 -0000
-@@ -75,7 +75,7 @@ struct {
+--- orig/log.c 2005-03-16 02:19:30.009754284
++++ log.c      2004-07-03 20:22:18
+@@ -83,7 +83,7 @@ struct {
  /*
   * Map from rsync error code to name, or return NULL.
   */
@@ -697,40 +697,39 @@ This patch adds the following options:
  {
        int i;
        for (i = 0; rerr_names[i].name; i++) {
---- main.c     10 Feb 2004 03:54:47 -0000      1.192
-+++ main.c     13 May 2004 18:17:09 -0000
-@@ -120,6 +120,9 @@ static void report(int f)
+--- orig/main.c        2005-03-16 02:19:30.077748367
++++ main.c     2004-07-03 20:22:18
+@@ -139,6 +139,9 @@ static void report(int f)
  
        if (am_daemon) {
                log_exit(0, __FILE__, __LINE__);
-+#ifdef HAVE_LIBODBC
++#if HAVE_LIBODBC
 +              db_log_exit(0,__FILE__,__LINE__);
 +#endif
-               if (f == -1 || !am_sender) return;
+               if (f == -1 || !am_sender)
+                       return;
        }
+--- orig/receiver.c    2005-03-16 02:19:30.248733487
++++ receiver.c 2005-03-05 00:31:00
+@@ -618,6 +618,9 @@ int recv_files(int f_in, struct file_lis
  
---- receiver.c 13 May 2004 07:08:22 -0000      1.77
-+++ receiver.c 13 May 2004 18:17:09 -0000
-@@ -454,7 +454,9 @@ int recv_files(int f_in,struct file_list
-               recv_ok = receive_data(f_in,mapbuf,fd2,fname,file->length);
-               log_recv(file, &initial_stats);
--
-+#ifdef HAVE_LIBODBC
-+              db_log_transfer(file, &initial_stats,"receive");
+               if (!log_before_transfer)
+                       log_item(file, &initial_stats, iflags, NULL);
++#if HAVE_LIBODBC
++              db_log_transfer(file, &initial_stats, "receive");
 +#endif
-               if (mapbuf) unmap_file(mapbuf);
-               if (fd1 != -1) {
+               if (fd1 != -1)
                        close(fd1);
---- sender.c   11 May 2004 19:53:16 -0000      1.39
-+++ sender.c   13 May 2004 18:17:09 -0000
-@@ -280,6 +280,9 @@ void send_files(struct file_list *flist,
-               } else  {
-                       match_sums(f_out, s, mbuf, st.st_size);
-                       log_send(file, &initial_stats);
-+#ifdef HAVE_LIBODBC
-+                      db_log_transfer(file, &initial_stats,"send");
+--- orig/sender.c      2005-03-16 02:19:30.828683018
++++ sender.c   2005-03-05 00:31:19
+@@ -351,6 +351,9 @@ void send_files(struct file_list *flist,
+               if (!log_before_transfer)
+                       log_item(file, &initial_stats, iflags, NULL);
++#if HAVE_LIBODBC
++              db_log_transfer(file, &initial_stats,"send");
 +#endif
-               }
  
-               if (!read_batch) {
+               if (mbuf) {
+                       j = unmap_file(mbuf);