mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-06 06:54:29 +00:00
Small protocol bugfix.
This commit is contained in:
parent
d8d7aa6af5
commit
dff9ba2702
@ -161,7 +161,7 @@ void Parser::OnContentReal(const char *content,int length){
|
|||||||
void Parser::ContinueParsing(){
|
void Parser::ContinueParsing(){
|
||||||
this->xmlFound = false;
|
this->xmlFound = false;
|
||||||
std::string errorstring;
|
std::string errorstring;
|
||||||
while(!this->xmlFound && !this->exit){
|
while( !this->xmlFound && !this->exit){
|
||||||
switch(this->xmlParserStatus){
|
switch(this->xmlParserStatus){
|
||||||
case XML_STATUS_SUSPENDED:
|
case XML_STATUS_SUSPENDED:
|
||||||
this->xmlParserStatus = XML_ResumeParser(this->xmlParser);
|
this->xmlParserStatus = XML_ResumeParser(this->xmlParser);
|
||||||
@ -175,15 +175,19 @@ void Parser::ContinueParsing(){
|
|||||||
this->Exit();
|
this->Exit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!this->supplier->Read()){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// create a temporary buffer to be able to remove null characters
|
// create a temporary buffer to be able to remove null characters
|
||||||
std::string tempBuffer(this->nextBuffer);
|
std::string tempBuffer(this->nextBuffer);
|
||||||
this->nextBuffer.clear();
|
this->nextBuffer.clear();
|
||||||
|
|
||||||
|
if(tempBuffer.empty()){
|
||||||
|
if(!this->supplier->Read()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
tempBuffer.append(this->supplier->Buffer(),this->supplier->BufferSize());
|
tempBuffer.append(this->supplier->Buffer(),this->supplier->BufferSize());
|
||||||
|
}
|
||||||
|
|
||||||
static std::string nullCharacter("\0",1);
|
static std::string nullCharacter("\0",1);
|
||||||
std::string::size_type nullPosition(tempBuffer.find(nullCharacter));
|
std::string::size_type nullPosition(tempBuffer.find(nullCharacter));
|
||||||
if(nullPosition!=std::string::npos){
|
if(nullPosition!=std::string::npos){
|
||||||
@ -192,6 +196,7 @@ void Parser::ContinueParsing(){
|
|||||||
tempBuffer.resize(nullPosition);
|
tempBuffer.resize(nullPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// this->xmlParserStatus = XML_Parse(this->xmlParser,this->supplier->Buffer(),(int)this->supplier->BufferSize(),0);
|
// this->xmlParserStatus = XML_Parse(this->xmlParser,this->supplier->Buffer(),(int)this->supplier->BufferSize(),0);
|
||||||
this->xmlParserStatus = XML_Parse(this->xmlParser,tempBuffer.c_str(),(int)tempBuffer.size(),0);
|
this->xmlParserStatus = XML_Parse(this->xmlParser,tempBuffer.c_str(),(int)tempBuffer.size(),0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user