Updated waitResponse

This commit is contained in:
arches 2016-07-26 10:06:33 -04:00
parent 60383a502c
commit 70bef36f64
1 changed files with 7 additions and 5 deletions

View File

@ -36,22 +36,24 @@ void etcdv3::AsyncWatchAction::waitForResponse()
{ {
void* got_tag; void* got_tag;
bool ok = false; bool ok = false;
while(cq_.Next(&got_tag, &ok)) while(cq_.Next(&got_tag, &ok))
{ {
if(ok == false || (got_tag == (void*)"writes done"))
{
break;
}
if(got_tag == (void*)this) // read tag if(got_tag == (void*)this) // read tag
{ {
if(reply.events_size()) if(reply.events_size())
{ {
stream->WritesDone((void*)this); stream->WritesDone((void*)"writes done");
cq_.Next(&got_tag, &ok);
break;
} }
else else
{ {
stream->Read(&reply, (void*)this); stream->Read(&reply, (void*)this);
} }
} }
} }
} }