Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
c612e8e2
Commit
c612e8e2
authored
May 22, 2013
by
JINMEI Tatuya
Browse files
[2911] cleanup: remove db_file arg from XfrinConnection ctor.
this class now doesn't rely on the low level interface anymore.
parent
1ab87fb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/xfrin/tests/xfrin_test.py
View file @
c612e8e2
...
@@ -283,7 +283,7 @@ class MockXfrinConnection(XfrinConnection):
...
@@ -283,7 +283,7 @@ class MockXfrinConnection(XfrinConnection):
def
__init__
(
self
,
sock_map
,
zone_name
,
rrclass
,
datasrc_client
,
def
__init__
(
self
,
sock_map
,
zone_name
,
rrclass
,
datasrc_client
,
shutdown_event
,
master_addr
,
tsig_key
=
None
):
shutdown_event
,
master_addr
,
tsig_key
=
None
):
super
().
__init__
(
sock_map
,
zone_name
,
rrclass
,
MockDataSourceClient
(),
super
().
__init__
(
sock_map
,
zone_name
,
rrclass
,
MockDataSourceClient
(),
shutdown_event
,
master_addr
,
TEST_DB_FILE
)
shutdown_event
,
master_addr
)
self
.
query_data
=
b
''
self
.
query_data
=
b
''
self
.
reply_data
=
b
''
self
.
reply_data
=
b
''
self
.
force_time_out
=
False
self
.
force_time_out
=
False
...
...
src/bin/xfrin/xfrin.py.in
View file @
c612e8e2
...
@@ -565,13 +565,10 @@ class XfrinConnection(asyncore.dispatcher):
...
@@ -565,13 +565,10 @@ class XfrinConnection(asyncore.dispatcher):
def __init__(self,
def __init__(self,
sock_map, zone_name, rrclass, datasrc_client,
sock_map, zone_name, rrclass, datasrc_client,
shutdown_event, master_addrinfo,
db_file,
tsig_key=None,
shutdown_event, master_addrinfo, tsig_key=None,
idle_timeout=60):
idle_timeout=60):
'''Constructor of the XfirnConnection class.
'''Constructor of the XfirnConnection class.
db_file: SQLite3 DB file. Unforutnately we still need this for
temporary workaround in _get_zone_soa(). This should be
removed when we eliminate the need for the workaround.
idle_timeout: max idle time for read data from socket.
idle_timeout: max idle time for read data from socket.
datasrc_client: the data source client object used for the XFR session.
datasrc_client: the data source client object used for the XFR session.
This will eventually replace db_file completely.
This will eventually replace db_file completely.
...
@@ -595,7 +592,6 @@ class XfrinConnection(asyncore.dispatcher):
...
@@ -595,7 +592,6 @@ class XfrinConnection(asyncore.dispatcher):
self._rrclass = rrclass
self._rrclass = rrclass
# Data source handler
# Data source handler
self._db_file = db_file
self._datasrc_client = datasrc_client
self._datasrc_client = datasrc_client
self._zone_soa = self._get_zone_soa()
self._zone_soa = self._get_zone_soa()
...
@@ -1147,8 +1143,7 @@ def __process_xfrin(server, zone_name, rrclass, db_file,
...
@@ -1147,8 +1143,7 @@ def __process_xfrin(server, zone_name, rrclass, db_file,
while retry:
while retry:
retry = False
retry = False
conn = conn_class(sock_map, zone_name, rrclass, datasrc_client,
conn = conn_class(sock_map, zone_name, rrclass, datasrc_client,
shutdown_event, master_addrinfo, db_file,
shutdown_event, master_addrinfo, tsig_key)
tsig_key)
conn.init_socket()
conn.init_socket()
ret = XFRIN_FAIL
ret = XFRIN_FAIL
if conn.connect_to_master():
if conn.connect_to_master():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment