summaryrefslogtreecommitdiff
path: root/sharkd_session.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2017-01-28 22:40:17 +0100
committerGuy Harris <guy@alum.mit.edu>2017-02-01 04:36:32 +0000
commit2b91f04008530039e830da5f820c6d449a9d5c4d (patch)
tree1c1e99a37b022ea58799f08ce1a28b0b67490094 /sharkd_session.c
parente25c45866e275ed156b7c31303e27e1c8cfe48cc (diff)
downloadwireshark-2b91f04008530039e830da5f820c6d449a9d5c4d.tar.gz
sharkd: windows support
Change-Id: I6581bacdea49416cc26431f66b093f36b39c5a67 Reviewed-on: https://code.wireshark.org/review/19829 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'sharkd_session.c')
-rw-r--r--sharkd_session.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sharkd_session.c b/sharkd_session.c
index 234a9a0e1d..faddaa364a 100644
--- a/sharkd_session.c
+++ b/sharkd_session.c
@@ -1882,7 +1882,11 @@ sharkd_session_process(char *buf, const jsmntok_t *tokens, int count)
else
fprintf(stderr, "::: req = %s\n", tok_req);
+ /* reply for every command are 0+ lines of JSON reply (outputed above), finished by empty new line */
printf("\n");
+
+ /* stdout is on most systems buffered, fflush() to output reply to a socket */
+ fflush(stdout);
}
}
@@ -1894,9 +1898,6 @@ sharkd_session_main(void)
int tokens_max = -1;
fprintf(stderr, "Hello in child!\n");
-#ifndef _WIN32
- setlinebuf(stdout);
-#endif
while (fgets(buf, sizeof(buf), stdin))
{