Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'
[vpp.git]
/
src
/
vpp
/
app
/
vppctl.c
diff --git
a/src/vpp/app/vppctl.c
b/src/vpp/app/vppctl.c
index
f81a0ce
..
b7582c0
100644
(file)
--- a/
src/vpp/app/vppctl.c
+++ b/
src/vpp/app/vppctl.c
@@
-147,6
+147,7
@@
main (int argc, char *argv[])
u8 *cmd = 0;
int do_quit = 0;
int is_interactive = 0;
u8 *cmd = 0;
int do_quit = 0;
int is_interactive = 0;
+ int acked = 1; /* counts messages from VPP; starts at 1 */
int sent_ttype = 0;
int sent_ttype = 0;
@@
-156,7
+157,7
@@
main (int argc, char *argv[])
argc--;
argv++;
argc--;
argv++;
- if (argc > 1 && str
cmp (argv[0], "-s"
) == 0)
+ if (argc > 1 && str
ncmp (argv[0], "-s", 2
) == 0)
{
s->config = argv[1];
argc -= 2;
{
s->config = argv[1];
argc -= 2;
@@
-314,7
+315,10
@@
main (int argc, char *argv[])
}
while (q < (p + len) && !*q)
}
while (q < (p + len) && !*q)
- q++;
+ {
+ q++;
+ acked++; /* every NUL is an acknowledgement */
+ }
len -= q - p;
p = q;
}
len -= q - p;
p = q;
}
@@
-322,7
+326,7
@@
main (int argc, char *argv[])
vec_reset_length (str);
}
vec_reset_length (str);
}
- if (do_quit)
+ if (do_quit
&& do_quit < acked
)
{
/* Ask the other end to close the connection */
clib_socket_tx_add_formatted (s, "quit\n");
{
/* Ask the other end to close the connection */
clib_socket_tx_add_formatted (s, "quit\n");
@@
-339,7
+343,7
@@
main (int argc, char *argv[])
clib_socket_tx_add_formatted (s, "%s\n", cmd);
clib_socket_tx (s);
vec_free (cmd);
clib_socket_tx_add_formatted (s, "%s\n", cmd);
clib_socket_tx (s);
vec_free (cmd);
- do_quit =
1;
+ do_quit =
acked; /* quit after the next response */
}
}
else
}
}
else