Skip to content

Commit

Permalink
refined loop
Browse files Browse the repository at this point in the history
  • Loading branch information
smlng committed Aug 17, 2016
1 parent f4948b5 commit 7d32cf6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/piggyback.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ int main(void)
printf("Bad packet rc=%d\n", rc);
}
else {
int state = 0;
do {
for (int state = 0; state != COAP_STATE_RSP; ) {
size_t buflen = sizeof(buf);
coap_packet_t rsppkt;
state = coap_handle_request(resources, &pkt, &rsppkt);
Expand All @@ -107,7 +106,7 @@ int main(void)
else {
sendto(fd, buf, buflen, 0, (struct sockaddr *)&cliaddr, sizeof(cliaddr));
}
} while (state != COAP_STATE_RSP);
}
}
}
}

0 comments on commit 7d32cf6

Please sign in to comment.