Support set-command usage - #1
Conversation
The data offset field of a TCP header contains the number of words the header is long (minimum 5). Previously, this code assumed all TCP headers were exactly 5 words long and would treat the TCP options as payload. This patch makes the parser respect the data offset field and start parsing data at the correct point.
|
@bmatheny I did not send the PR to the upstream since it's not active for a long time. Some commits in the PR are of personal favour (e.g.: use cmake instead of autotools). Please let me know if any of them should be sent to the upstream. |
1527814 to
5903393
Compare
There was a problem hiding this comment.
Thanks for your review! Please comment lgtm if the PR looks good to you.
diff --git a/README.md b/README.md
index 798c385..be9a603 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ Build Status: [
-l, --logfile=FILE Output logs to FILE
-R, --report=REPORT Output data in REPORT format (CSV or curses, default curses)
- -C, --capture=CAPTRUE_TYPE Capture memcached command type (set or get, default get)
+ -C, --capture=CAPTURE_TYPE Capture memcached command type (set or get, default get)
-h, --help This help
-v, --verbose Increase verbosity. May be used multiple times.
diff --git a/src/cli.cpp b/src/cli.cpp
index 4233d2f..f046707 100644
--- a/src/cli.cpp
+++ b/src/cli.cpp
@@ -54,7 +54,7 @@ string Cli::help(const char * progname) {
txt << mkHelpDoc(
longopts[9],
"Capture memcached command type (set or get, default get)",
- "CAPTRUE_TYPE");
+ "CAPTURE_TYPE");
txt << endl;
txt << mkHelpDoc(longopts[4], "This help", "");
txt << mkHelpDoc(longopts[5],rebased and pushed --force
|
Please submit the non-build features upstream. I also don't think the address selection logic you have introduced is correct. If you're going to include the "Use default IP", please make it more generic. Either allow the user to specify an address on the command line, or don't include the change in the upstream pull request. FWIW, not submitting because there hasn't been activity isn't a great reason. There would be activity if people submitted pull requests :) |
|
@bmatheny Partial of these commits are from bmatheny#21 . Please consider merge that first. I'll check f433ef9 soon. |
There might be more than one IP addresses on a single network device. The first IP provided by `pcap_findalldevs` will be used on default. You can also specify an IPv4 address via the `-a`/`--address` param.
credits: - allenlz@8ebaec2
Agree. I can't find anything documentation about the order of the return value of pcap_findalldevs. cmd line parameter |
|
I will send a corresponding PR to upstream soon. |
ChangeLog:
-C set, for beansdb)getcommand, and vice versa forsetcommand.cc @youngsofun @zzl0