diff --git a/src/StreamProtocol.cc b/src/StreamProtocol.cc index f43f8c2..100ee22 100644 --- a/src/StreamProtocol.cc +++ b/src/StreamProtocol.cc @@ -1057,14 +1057,6 @@ compileNumber(unsigned long& number, const char*& source, unsigned long max) bool StreamProtocolParser::Protocol:: compileString(StreamBuffer& buffer, const char*& source, - FormatType formatType, Client* client, int quoted) -{ - return compileStringInternal(buffer, source, formatType, client, quoted, 0); -} - - -bool StreamProtocolParser::Protocol:: -compileStringInternal(StreamBuffer& buffer, const char*& source, FormatType formatType, Client* client, int quoted, int recursionDepth) { bool escaped = false; @@ -1074,8 +1066,8 @@ compileStringInternal(StreamBuffer& buffer, const char*& source, line = getLineNumber(source); debug("StreamProtocolParser::Protocol::compileString " - "line %d source=\"%s\"\n", - line, source); + "line %d source=\"%s\" recursionDepth=%d\n", + line, source, recursionDepth); // coding is done in two steps: // 1) read a line from protocol source and code quoted strings, @@ -1258,7 +1250,7 @@ compileStringInternal(StreamBuffer& buffer, const char*& source, source += strlen(source)+1+sizeof(int); p = value(); int saveline = line; - if (!compileStringInternal(buffer, p, formatType, client, false, recursionDepth + 1)) + if (!compileString(buffer, p, formatType, client, false, recursionDepth + 1)) return false; line = saveline; continue; diff --git a/src/StreamProtocol.h b/src/StreamProtocol.h index 91f9183..4a859d8 100644 --- a/src/StreamProtocol.h +++ b/src/StreamProtocol.h @@ -59,7 +59,7 @@ public: bool compileCommands(StreamBuffer&, const char*& source, Client*); bool replaceVariable(StreamBuffer&, const char* varname); const Variable* getVariable(const char* name); - bool compileStringInternal(StreamBuffer& buffer, const char*& source, + bool compileString(StreamBuffer& buffer, const char*& source, FormatType formatType, Client*, int quoted, int recursionDepth); public: @@ -75,7 +75,9 @@ public: bool compileNumber(unsigned long& number, const char*& source, unsigned long max = 0xFFFFFFFF); bool compileString(StreamBuffer& buffer, const char*& source, - FormatType formatType = NoFormat, Client* = NULL, int quoted = false); + FormatType formatType = NoFormat, Client* client = NULL, int quoted = false) { + return compileString(buffer, source, formatType, client, quoted, 0); + } bool checkUnused(); ~Protocol(); void report();