Commit 12071a88 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[master] Merge branch 'trac2665'

parents e090b84b 50e61198
......@@ -261,7 +261,7 @@ skipChars(std::istream& in, const char* chars, int& line, int& pos) {
} else {
++pos;
}
in.get();
in.ignore();
c = in.peek();
}
}
......@@ -291,7 +291,7 @@ skipTo(std::istream& in, const std::string& file, int& line,
pos = 1;
++line;
}
in.get();
in.ignore();
++pos;
}
in.putback(c);
......@@ -352,7 +352,7 @@ strFromStringstream(std::istream& in, const std::string& file,
throwJSONError("Bad escape", file, line, pos);
}
// drop the escaped char
in.get();
in.ignore();
++pos;
}
ss.put(c);
......@@ -490,14 +490,14 @@ fromStringstreamMap(std::istream& in, const std::string& file, int& line,
throwJSONError(std::string("Unterminated map, <string> or } expected"), file, line, pos);
} else if (c == '}') {
// empty map, skip closing curly
c = in.get();
in.ignore();
} else {
while (c != EOF && c != '}') {
std::string key = strFromStringstream(in, file, line, pos);
skipTo(in, file, line, pos, ":", WHITESPACE);
// skip the :
in.get();
in.ignore();
pos++;
ConstElementPtr value = Element::fromJSON(in, file, line, pos);
......
......@@ -343,6 +343,7 @@ TEST_F(CCSessionTest, checkCommand) {
session.addMessage(el("{ \"command\": \"bad_command\" }"), "Spec29", "*");
result = mccs.checkCommand();
EXPECT_EQ(0, session.getMsgQueue()->size());
EXPECT_EQ(0, result);
session.addMessage(el("{ \"command\": [ \"bad_command\" ] }"),
"Spec29", "*");
......@@ -627,6 +628,7 @@ TEST_F(CCSessionTest, ignoreRemoteConfigCommands) {
EXPECT_EQ(1, session.getMsgQueue()->size());
result = mccs.checkCommand();
EXPECT_EQ(0, session.getMsgQueue()->size());
EXPECT_EQ(0, result);
}
TEST_F(CCSessionTest, initializationFail) {
......
......@@ -227,7 +227,6 @@ stringParse(Iterator s, Iterator send, bool downcase, Offsets& offsets,
isc_throw(BadLabelType,
"invalid label type in " << string(orig_s, send));
}
state = ft_escape;
// FALLTHROUGH
case ft_escape:
if (!isdigit(c & 0xff)) {
......
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