From ccf3ac8d0c95f6edbb967d62862681da1a89bb01 Mon Sep 17 00:00:00 2001 From: Mikhail Burakov Date: Sun, 9 Apr 2023 14:36:09 +0200 Subject: Drop second socket for input handling and use just one --- main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index e398b51..aaba0ba 100644 --- a/main.c +++ b/main.c @@ -137,19 +137,15 @@ static void DecodeContextDtor(struct DecodeContext** decode_context) { } int main(int argc, char* argv[]) { - if (argc < 3) { - LOG("Usage: %s : :", argv[0]); + if (argc < 2) { + LOG("Usage: %s :", argv[0]); return EXIT_FAILURE; } int __attribute__((cleanup(SocketDtor))) sock = ConnectSocket(argv[1]); if (sock == -1) return EXIT_FAILURE; - // TODO(mburakov): Use sock instead of sock2 once backend is ready. - int __attribute__((cleanup(SocketDtor))) sock2 = ConnectSocket(argv[2]); - if (sock2 == -1) return EXIT_FAILURE; - struct InputStream __attribute__((cleanup(InputStreamDtor)))* input_stream = - InputStreamCreate(sock2); + InputStreamCreate(sock); if (!input_stream) { LOG("Failed to create input stream"); return EXIT_FAILURE; -- cgit v1.2.3