Commit a79aa742 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

sync with trunk


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac312@2853 e5f2f494-b856-4b98-b285-d166d9295462
parents c7d2c477 aa400844
......@@ -59,7 +59,7 @@ b10_auth_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
b10_auth_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la
b10_auth_LDADD += $(top_builddir)/src/lib/cc/libcc.la
b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
b10_auth_LDADD += $(top_builddir)/src/bin/auth/libasio_link.a
b10_auth_LDADD += libasio_link.a
b10_auth_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la
b10_auth_LDADD += $(SQLITE_LIBS)
......
......@@ -35,7 +35,6 @@ import os, time, random, re
import getpass
from hashlib import sha1
import csv
import json
import pwd
import getpass
......
......@@ -601,17 +601,17 @@ Name::isWildcard() const {
Name
Name::concatenate(const Name& suffix) const {
assert(this->length_ > 0 && suffix.length_ > 0);
assert(this->labelcount_ > 0 && suffix.labelcount_ > 0);
assert(length_ > 0 && suffix.length_ > 0);
assert(labelcount_ > 0 && suffix.labelcount_ > 0);
unsigned int length = this->length_ + suffix.length_ - 1;
unsigned int length = length_ + suffix.length_ - 1;
if (length > Name::MAX_WIRE) {
isc_throw(TooLongName, "names are too long to concatenate");
}
Name retname;
retname.ndata_.reserve(length);
retname.ndata_.assign(this->ndata_, 0, this->length_ - 1);
retname.ndata_.assign(ndata_, 0, length_ - 1);
retname.ndata_.insert(retname.ndata_.end(),
suffix.ndata_.begin(), suffix.ndata_.end());
assert(retname.ndata_.size() == length);
......@@ -622,14 +622,13 @@ Name::concatenate(const Name& suffix) const {
// excluding that for the trailing dot, and append the offsets of the
// suffix name with the additional offset of the length of the prefix.
//
unsigned int labels = this->labelcount_ + suffix.labelcount_ - 1;
unsigned int labels = labelcount_ + suffix.labelcount_ - 1;
assert(labels <= Name::MAX_LABELS);
retname.offsets_.reserve(labels);
retname.offsets_.assign(&this->offsets_[0],
&this->offsets_[0] + this->labelcount_ - 1);
retname.offsets_.assign(&offsets_[0], &offsets_[0] + labelcount_ - 1);
transform(suffix.offsets_.begin(), suffix.offsets_.end(),
back_inserter(retname.offsets_),
bind2nd(plus<char>(), this->length_ - 1));
bind2nd(plus<char>(), length_ - 1));
assert(retname.offsets_.size() == labels);
retname.labelcount_ = labels;
......
......@@ -344,15 +344,19 @@ class testSession(unittest.TestCase):
if os.path.exists(TEST_SOCKET_FILE):
os.remove(TEST_SOCKET_FILE)
s1.bind(TEST_SOCKET_FILE)
s1.listen(1)
s2 = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s2.connect(TEST_SOCKET_FILE)
sess = MySession(1, s2)
# set timeout to 100 msec, so test does not take too long
sess.set_timeout(100)
#self.assertRaises(SessionTimeout, sess.group_recvmsg, False)
try:
s1.listen(1)
s2 = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s2.connect(TEST_SOCKET_FILE)
sess = MySession(1, s2)
# set timeout to 100 msec, so test does not take too long
sess.set_timeout(100)
self.assertRaises(SessionTimeout, sess.group_recvmsg, False)
finally:
os.remove(TEST_SOCKET_FILE)
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment