Added support for multiple result sets.

This commit is contained in:
Markus Makela
2015-03-06 22:40:10 +02:00
parent 2aaa367c37
commit 22849f7c90
3 changed files with 64 additions and 33 deletions

View File

@ -558,7 +558,7 @@ GWBUF* modutil_get_complete_packets(GWBUF** p_readbuf)
* @return Number of EOF packets
*/
int
modutil_count_signal_packets(GWBUF *reply, int use_ok, int n_found)
modutil_count_signal_packets(GWBUF *reply, int use_ok, int n_found, int* more)
{
unsigned char* ptr = (unsigned char*) reply->start;
unsigned char* end = (unsigned char*) reply->end;
@ -566,6 +566,7 @@ modutil_count_signal_packets(GWBUF *reply, int use_ok, int n_found)
int pktlen, eof = 0, err = 0;
int errlen = 0, eoflen = 0;
int iserr = 0, iseof = 0;
bool moreresults = false;
while(ptr < end)
{
@ -587,6 +588,7 @@ modutil_count_signal_packets(GWBUF *reply, int use_ok, int n_found)
if((ptr + pktlen) > end || (eof + n_found) >= 2)
{
moreresults = PTR_EOF_MORE_RESULTS(ptr);
ptr = prev;
break;
}
@ -616,6 +618,8 @@ modutil_count_signal_packets(GWBUF *reply, int use_ok, int n_found)
}
}
*more = moreresults;
return(eof + err);
}