From 2b91f04008530039e830da5f820c6d449a9d5c4d Mon Sep 17 00:00:00 2001 From: Jakub Zawadzki Date: Sat, 28 Jan 2017 22:40:17 +0100 Subject: sharkd: windows support Change-Id: I6581bacdea49416cc26431f66b093f36b39c5a67 Reviewed-on: https://code.wireshark.org/review/19829 Reviewed-by: Guy Harris --- sharkd_session.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sharkd_session.c') 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)) { -- cgit v1.2.1