Amos,
Is it enough just to change the ESICustomParser?
Thanks in advance,
William
----- Mensagem original -----
De: "Amos Jeffries" <[email protected]>
Para: [email protected]
Enviadas: Terça-feira, 2 de Fevereiro de 2016 4:12:57
Assunto: Re: [squid-dev] String::append assertion
On 2/02/2016 8:04 a.m., William Lima wrote:
> Hi all,
>
> I have an assertion (1) of String::append called from ESICustomParser::parse
> (2). Is 64K too small in some scenarios?
>
> 1 - String.cc:204: "len_ + len < 65536"
> 2 - CustomParser.cc:85
>
Exactly so. If the expanded ESI template produces an object >= 64KB in
size it will do this.
We now have SBuf storage type to fix these issues. But ESI has not yet
been converted to using it. Any assistance or patches are welcome.
Amos
_______________________________________________
squid-dev mailing list
[email protected]
http://lists.squid-cache.org/listinfo/squid-dev
--- squid-3.5.13/src/esi/CustomParser.cc 2016-01-07 01:21:47.000000000 -0200
+++ squid-3.5.13/src/esi/CustomParser.cc 2016-02-03 12:57:36.334098062 -0200
@@ -89,9 +89,9 @@ ESICustomParser::parse(char const *dataT
}
size_t openESITags (0);
- //erring on the safe side. Probably rawBuf would be ok too
- char const *currentPos = content.termedBuf();
- size_t remainingCount = content.size();
+ //erring on the safe side. Probably rawContent would be ok too
+ char const *currentPos = content.c_str();
+ SBuf::size_type remainingCount = content.length();
char const *tag = NULL;
while ((tag = findTag(currentPos, remainingCount))) {
--- squid-3.5.13/src/esi/CustomParser.h 2016-01-07 01:21:47.000000000 -0200
+++ squid-3.5.13/src/esi/CustomParser.h 2016-02-03 12:57:36.334098062 -0200
@@ -14,7 +14,7 @@ class Trie;
/* inherits from */
#include "esi/Parser.h"
-/* for String variables */
+#include "SBuf.h"
#include "SquidString.h"
/**
@@ -46,7 +46,7 @@ private:
ESIParserClient *theClient;
String error;
/* cheap n dirty - buffer it all */
- String content;
+ SBuf content;
/* TODO: make a class of this type code */
ESITAG_t lastTag;
};
_______________________________________________
squid-dev mailing list
[email protected]
http://lists.squid-cache.org/listinfo/squid-dev