[lib-client] send_request(): update the packet ID

This commit is contained in:
Matteo Cypriani 2011-10-24 15:19:31 +02:00
parent 8e7aac1e6e
commit c53b8d61e7
1 changed files with 4 additions and 1 deletions

View File

@ -98,11 +98,14 @@ void owl_send_request(const int sockfd,
owl_send_packet(sockfd, server, packet, packet_size) ;
// Transmit remaining packets (if any):
for (i = 0 ; i < nb_pkt - 1 ; ++i)
for (i = 1 ; i < nb_pkt ; ++i)
{
uint16_t current_pkt = htons(i + 1) ;
owl_msleep(delay) ; // Wait during the wanted delay
if (! owl_run)
break ;
memcpy(&((char*) packet)[packet_size - sizeof(uint16_t)],
&current_pkt, sizeof(uint16_t)) ;
owl_send_packet(sockfd, server, packet, packet_size) ;
}