Browse Source

Enable b10-xfrout can be launched in source code tree.(Reviewed by Jelte)

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@2103 e5f2f494-b856-4b98-b285-d166d9295462
Likun Zhang 15 years ago
parent
commit
187844f29a
3 changed files with 15 additions and 3 deletions
  1. 5 0
      ChangeLog
  2. 7 1
      src/bin/auth/asio_link.cc
  3. 3 2
      src/bin/xfrout/xfrout.py.in

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+  54.   [bug]      zhanglikun
+	bin/xfrout: Enable b10-xfrout can be launched in source
+	code tree.
+	(Trac #224, svn r2103)
+
   53.   [bug]      zhanglikun
 	bin/bindctl: Generate a unique session ID by using 
 	socket.gethostname() instead of socket.gethostbyname(), 

+ 7 - 1
src/bin/auth/asio_link.cc

@@ -68,7 +68,13 @@ void
 dispatch_axfr_query(const int tcp_sock, char const axfr_query[],
                     const uint16_t query_len)
 {
-    string path(UNIX_SOCKET_FILE);
+    string path;
+    if (getenv("B10_FROM_BUILD")) {
+        path = string(getenv("B10_FROM_BUILD")) + "/auth_xfrout_conn";
+    } else {
+        path = UNIX_SOCKET_FILE;
+    }
+    
     XfroutClient xfr_client(path);
     try {
         xfr_client.connect();

+ 3 - 2
src/bin/xfrout/xfrout.py.in

@@ -40,13 +40,14 @@ except ImportError as e:
 
 if "B10_FROM_BUILD" in os.environ:
     SPECFILE_PATH = os.environ["B10_FROM_BUILD"] + "/src/bin/xfrout"
+    UNIX_SOCKET_FILE= os.environ["B10_FROM_BUILD"] + "/auth_xfrout_conn"
 else:
     PREFIX = "@prefix@"
     DATAROOTDIR = "@datarootdir@"
     SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
-SPECFILE_LOCATION = SPECFILE_PATH + "/xfrout.spec"
-UNIX_SOCKET_FILE = "@@LOCALSTATEDIR@@/auth_xfrout_conn"
+    UNIX_SOCKET_FILE = "@@LOCALSTATEDIR@@/auth_xfrout_conn"
 
+SPECFILE_LOCATION = SPECFILE_PATH + "/xfrout.spec"
 MAX_TRANSFERS_OUT = 10
 verbose_mode = False