mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
fixed bug in bin-var parsing
This commit is contained in:
parent
472314568f
commit
a96f01f355
2 changed files with 26 additions and 26 deletions
44
src/parser.c
44
src/parser.c
|
@ -307,19 +307,8 @@ inline int PSYC_parseElement(
|
|||
*vlength= dlength - *cursor -3;
|
||||
}else
|
||||
{
|
||||
*vlength=0;
|
||||
while(1)
|
||||
{
|
||||
if(dlength<=++(*cursor)) // incremented cursor inside lenght?
|
||||
{
|
||||
*cursor=startc; // set to start value
|
||||
return 1; // return insufficient
|
||||
}
|
||||
|
||||
if(0 == method && data[*cursor] == '\n')
|
||||
break;
|
||||
|
||||
if(1 == method && data[*cursor] == '|')
|
||||
*vlength=0;
|
||||
while(1)
|
||||
{
|
||||
if(dlength<=++(*cursor)) // incremented cursor inside lenght?
|
||||
{
|
||||
|
@ -327,15 +316,26 @@ inline int PSYC_parseElement(
|
|||
return 1; // return insufficient
|
||||
}
|
||||
|
||||
/* packet finishes here */
|
||||
if(data[*cursor] == '\n')
|
||||
if(0 == method && data[*cursor] == '\n')
|
||||
break;
|
||||
|
||||
if(1 == method && data[*cursor] == '|')
|
||||
{
|
||||
*cursor+=1;
|
||||
return 3;
|
||||
if(dlength<=++(*cursor)) // incremented cursor inside lenght?
|
||||
{
|
||||
*cursor=startc; // set to start value
|
||||
return 1; // return insufficient
|
||||
}
|
||||
|
||||
/* packet finishes here */
|
||||
if(data[*cursor] == '\n')
|
||||
{
|
||||
*cursor+=1;
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
++(*vlength);
|
||||
}}
|
||||
++(*vlength);
|
||||
}}
|
||||
}
|
||||
}else if(inHeader == 0 && method==0 && data[*cursor] == ' ') // oi, its a binary var!
|
||||
{ // after SP the length follows.
|
||||
|
@ -365,9 +365,9 @@ inline int PSYC_parseElement(
|
|||
return 1;
|
||||
}
|
||||
|
||||
*value = data + *cursor;
|
||||
*value = data + *cursor+1;
|
||||
*vlength=binLength;
|
||||
*cursor += binLength;
|
||||
*cursor += binLength+1;
|
||||
}else
|
||||
return -8;
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ _request_context_enter
|
|||
:_target psyc://p5B084547.dip.t-dialin.net/@test
|
||||
|
||||
:_more vars
|
||||
:_bin 4 1
|
||||
:_bin 6 "1
|
||||
3
|
||||
|
||||
"
|
||||
:_entity variablevalue
|
||||
_notice_context_leave
|
||||
|
|
||||
|
|
Loading…
Reference in a new issue