sks-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sks-devel] show peer address in rejects


From: Peter Palfrader
Subject: [Sks-devel] show peer address in rejects
Date: Sun, 2 May 2004 16:04:08 +0200
User-agent: Mutt/1.5.5.1+cvs20040105i

Hi Yaron,

This makes log entries like:

2004-05-02 16:03:05 <reconciliation handler> error in callback.: 
Failure("Remote (<ADDR_INET 213.133.99.198:50417>) configuration rejected: 
filters do not match.\n\tlocal filters: [ yminsky.dedup yminsky.merge 
]\n\tremote filters: [ yminsky.dedup ]")

i.e. it adds the remote address.

diff -ruN sks-1.0.7-old/reconCS.ml sks-1.0.7/reconCS.ml
--- sks-1.0.7-old/reconCS.ml    Fri Feb 20 00:58:18 2004
+++ sks-1.0.7/reconCS.ml        Sun May  2 15:45:11 2004
@@ -83,7 +83,7 @@
   @param filters list of strings representing filters that have been applied
   to data.
 *)
-let handle_config cin cout filters = 
+let handle_config cin cout filters peer = 
   let configdata = build_configdata filters in
   marshal cout (Config configdata); (* channel is flushed here *)
   let remote_configdata = 
@@ -99,15 +99,15 @@
         marshal_string cout "failed";
         marshal_string cout reason;
         cout#flush;
-        failwith (sprintf "Remote configuration rejected: %s"
-                    reason)
+        failwith (sprintf "Remote (%s) configuration rejected: %s"
+                    (sockaddr_to_string peer) reason)
   );
   (match unmarshal_string cin with
        "passed" -> ()
      | "failed" ->
         let reason = unmarshal_string cin in
-        failwith (sprintf "Local configuration rejected remotely: %s"
-                    reason)
+        failwith (sprintf "Local configuration rejected remotely(%s): %s"
+                    (sockaddr_to_string peer) reason)
      | _ -> failwith "Unexpected configuration confirmation response"
   );
   remote_configdata
@@ -144,7 +144,7 @@
     let cin = Channel.sys_in_from_fd s
     and cout = Channel.sys_out_from_fd s in
     signore (plerror 4 "Initiating reconciliation");
-    let remote_config = handle_config cin cout filters in
+    let remote_config = handle_config cin cout filters partner in
     ignore (Unix.alarm !Settings.reconciliation_timeout);
 
     let http_port = config_get_http_port remote_config in
@@ -160,7 +160,7 @@
 let handle_connection tree ~filters ~partner cin cout  = 
 
   signore (plerror 4 "Joining reconciliation");
-  let remote_config = handle_config cin cout filters in
+  let remote_config = handle_config cin cout filters partner in
   ignore (Unix.alarm !Settings.reconciliation_timeout);
   
   let http_port = config_get_http_port remote_config in



Peter
-- 
 PGP signed and encrypted  |  .''`.  ** Debian GNU/Linux **
    messages preferred.    | : :' :      The  universal
                           | `. `'      Operating System
 http://www.palfrader.org/ |   `-    http://www.debian.org/

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]