summaryrefslogtreecommitdiffstats
path: root/sockutil.c
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2013-08-12 16:00:07 -0400
committerNathan Straz <nstraz@redhat.com>2013-09-11 17:40:21 -0400
commit0a361ddae1649b0a3102e113d16e6f7f07f6d7e8 (patch)
tree135db1a19710250f11da8c31e3be47efac3b047f /sockutil.c
parentb7aafc98a56966d4aab712ac0f73df0ae07ca657 (diff)
downloadqarsh-0a361ddae1649b0a3102e113d16e6f7f07f6d7e8.tar.gz
qarsh-0a361ddae1649b0a3102e113d16e6f7f07f6d7e8.tar.xz
qarsh-0a361ddae1649b0a3102e113d16e6f7f07f6d7e8.zip
Move packet sequence numbering to send_packet
Diffstat (limited to 'sockutil.c')
-rw-r--r--sockutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sockutil.c b/sockutil.c
index dd3d1a8..63af812 100644
--- a/sockutil.c
+++ b/sockutil.c
@@ -32,6 +32,7 @@
#include "qarsh_packet.h"
+static int packet_seq = 1;
/* Some generic socket related functions to make things easier */
int
@@ -255,11 +256,13 @@ recv_read:
int
send_packet(int fd, struct qa_packet *qp)
{
- Buffer pb = { "", 0, 0};
+ Buffer pb = { "", 0, 0 };
uint32_t netsize;
ssize_t ret = -1;
struct iovec iovs[2];
+ qp->qp_seq = packet_seq++;
+
pb.end = qptostr(qp, pb.buf, QARSH_MAX_PACKET_SIZE - sizeof netsize);
if (pb.end > 0) {