Added logging of all user commands.
[egate.git] / kernel / urp.c
index 0e2e4d6..c6dc851 100644 (file)
@@ -2,7 +2,19 @@
  * Europagate, 1995
  *
  * $Log: urp.c,v $
- * Revision 1.11  1995/02/22 15:22:33  adam
+ * Revision 1.16  1995/02/23 10:08:20  adam
+ * Added logging of all user commands.
+ *
+ * Revision 1.15  1995/02/23  08:32:17  adam
+ * Changed header.
+ *
+ * Revision 1.13  1995/02/22  16:54:42  adam
+ * Qualifiers of LOC target updated. More logging messages.
+ *
+ * Revision 1.12  1995/02/22  15:51:51  adam
+ * Bug fix: swap of parameter number and offset in function present.
+ *
+ * Revision 1.11  1995/02/22  15:22:33  adam
  * Much more checking of run-time state. Show command never retrieves
  * more records than indicated by the previous search request. Help
  * command available. The maximum number of records retrieved can be
@@ -364,7 +376,7 @@ struct command_word show_tab [] =
 {   NULL, NULL }
 };
 
-static void present (const char *set, int number, int offset,
+static void present (const char *set, int offset, int number,
                      struct ccl_token *format_token)
 {
     const struct zass_presentent *zp;
@@ -616,7 +628,7 @@ static int exec_command (const char *str)
     {
         if (!info.zass && no != 9 && no != 4)
             reopen_target ();
-        fprintf (reply_fd, "\n> %s", str);
+        fprintf (reply_fd, "\n> %s\n", str);
         if (!info.zass && (no == 1 || no == 2 || no == 3))
         {
             fprintf (reply_fd, "%s\n",
@@ -688,6 +700,7 @@ int urp (FILE *inf)
                                                    "gw.msg.subject",
                                                    "Your Query"));
         fprintf (reply_fd, "\n");
+        gw_log (GW_LOG_DEBUG, "urp", "Mail from %s", from_str);
     }
     else
         gw_log (GW_LOG_WARN, "urp", "No From in email header");
@@ -695,8 +708,13 @@ int urp (FILE *inf)
                                            "Email->Z39.50 gateway"));
     while (fgets (line_buf, LINE_MAX, inf))
     {
+        char *cp;
+
         if (line_buf[0] == '\n')
             break;
+        if ((cp = strchr (line_buf, '\n')))
+            *cp = '\0';
+        gw_log (GW_LOG_ACCT, "urp", "cmd: %s", line_buf);
         ccl_token_and = gw_res_get (info.kernel_res, "ccl.token.and", "and");
         ccl_token_or = gw_res_get (info.kernel_res, "ccl.token.or", "or");
         ccl_token_not = gw_res_get (info.kernel_res, "ccl.token.not", "not");
@@ -731,6 +749,7 @@ int urp (FILE *inf)
             gw_log (GW_LOG_FATAL, "urp", "Reply '%s' got exit code %d",
                     cmd, mta_code);
         unlink (reply_fname);        
+        gw_log (GW_LOG_DEBUG, "urp", "Normal session for user %s", from_str);
     }
     return 0;
 }