mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Fixed ignored Stream timeout and made sure we don't read more that necessary (issue #422)
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "../JsonBuffer.hpp"
|
||||
#include "../JsonVariant.hpp"
|
||||
#include "StringReader.hpp"
|
||||
#include "StringWriter.hpp"
|
||||
|
||||
namespace ArduinoJson {
|
||||
@@ -74,23 +73,23 @@ class JsonParser {
|
||||
|
||||
template <typename TJsonBuffer, typename TString>
|
||||
struct JsonParserBuilder {
|
||||
typedef typename Internals::StringTraits<TString>::Iterator InputIterator;
|
||||
typedef JsonParser<StringReader<InputIterator>, TJsonBuffer &> TParser;
|
||||
typedef typename Internals::StringTraits<TString>::Reader InputReader;
|
||||
typedef JsonParser<InputReader, TJsonBuffer &> TParser;
|
||||
|
||||
static TParser makeParser(TJsonBuffer *buffer, TString &json,
|
||||
uint8_t nestingLimit) {
|
||||
return TParser(buffer, InputIterator(json), *buffer, nestingLimit);
|
||||
return TParser(buffer, InputReader(json), *buffer, nestingLimit);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename TJsonBuffer>
|
||||
struct JsonParserBuilder<TJsonBuffer, char *> {
|
||||
typedef typename Internals::StringTraits<char *>::Iterator InputIterator;
|
||||
typedef JsonParser<StringReader<InputIterator>, StringWriter> TParser;
|
||||
typedef typename Internals::StringTraits<char *>::Reader InputReader;
|
||||
typedef JsonParser<InputReader, StringWriter> TParser;
|
||||
|
||||
static TParser makeParser(TJsonBuffer *buffer, char *json,
|
||||
uint8_t nestingLimit) {
|
||||
return TParser(buffer, InputIterator(json), json, nestingLimit);
|
||||
return TParser(buffer, InputReader(json), json, nestingLimit);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user