updates
authorPekka Riikonen <priikone@silcnet.org>
Wed, 7 Nov 2001 14:18:26 +0000 (14:18 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 7 Nov 2001 14:18:26 +0000 (14:18 +0000)
README.CVS
apps/silcd/server.c
apps/silcd/silcd.c

index 3c0f45dc744e24748b660bfb552b18aa402290be..1835d121424be173238d16866046a36e535df610 100644 (file)
@@ -171,10 +171,16 @@ SILC_LOG_DEBUG* scripts.  Warning is due here:  The debugging produced
 by both cilent and server is very heavy, thus it is common to test
 the programs as follows:
 
-       ./silc -d -f configfile 2>log
-       ./silcd -d -f configfile 2>log
-
-Do not give the -d options if you do not want to dump the debugging.
+       ./silc -d "*" -f configfile 2>log
+       ./silcd -d "*" -f configfile 2>log
+
+The -d option enables the debug printing.  The argument for the -d option
+is a string that is used to match the output debug.  The example "*" will
+match for everything, and all debugs will be printed.  If you want to
+limit the debugs you want to printout you can give for example a string
+like "*server*,*rng*" to match all functions, and filenames that has
+"server" or "rng" string in them.  Others will not be printed out.  You   
+can freely define regural expressions as debug string.
 
 
 Howto Clean SILC Source Tree
index 31ae88774e476c065cd8b322172ff6f0be89bfdb..d7fc856cef29f6b24d320d0a1f479ca26c20fb70 100644 (file)
@@ -1507,11 +1507,11 @@ SILC_TASK_CALLBACK(silc_server_packet_process)
 
     if (ret == -1)
       SILC_LOG_ERROR(("Error receiving packet from connection "
-                     "%s:%d [%s]", sock->hostname, sock->port,  
+                     "%s:%d [%s] %s", sock->hostname, sock->port,  
                      (sock->type == SILC_SOCKET_TYPE_UNKNOWN ? "Unknown" :
                       sock->type == SILC_SOCKET_TYPE_CLIENT ? "Client" :
                       sock->type == SILC_SOCKET_TYPE_SERVER ? "Server" :
-                      "Router")));
+                      "Router"), strerror(errno)));
     return;
   }    
 
index abc53ac7064f3480409b533c8f3347040573863a..8dfa1e490c7255e9bd2fa52d1f58e2962ce13055 100644 (file)
@@ -41,7 +41,7 @@ silc_server_create_key_pair(char *pkcs_name, int bits, char *path,
 static struct option long_opts[] = 
 {
   { "config-file", 1, NULL, 'f' },
-  { "debug", 0, NULL, 'd' },
+  { "debug", 1, NULL, 'd' },
   { "help", 0, NULL, 'h' },
   { "version", 0, NULL,'V' },
 
@@ -70,7 +70,7 @@ Usage: silcd [options]\n\
 \n\
   Generic Options:\n\
   -f  --config-file=FILE        Alternate configuration file\n\
-  -d  --debug                   Enable debugging (no daemon)\n\
+  -d  --debug=string            Enable debugging (no daemon)\n\
   -h  --help                    Display this message\n\
   -V  --version                 Display version\n\
 \n\
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
 
   /* Parse command line arguments */
   if (argc > 1) {
-    while ((opt = getopt_long(argc, argv, "cf:dhVC:",
+    while ((opt = getopt_long(argc, argv, "cf:d:hVC:",
                              long_opts, &option_index)) != EOF) {
       switch(opt) 
        {
@@ -125,6 +125,7 @@ int main(int argc, char **argv)
          break;
        case 'd':
          silc_debug = TRUE;
+         silc_log_set_debug_string(optarg);
          break;
        case 'f':
          config_file = strdup(optarg);