From 43b74147212ddc5e619ac17dd1b5967b6b293d8a Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 15 Sep 2019 19:00:04 +0200 Subject: Set loggedin to false when connection breaks --- vchat-protocol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vchat-protocol.c b/vchat-protocol.c index f1b71a1..0073956 100755 --- a/vchat-protocol.c +++ b/vchat-protocol.c @@ -30,6 +30,8 @@ // TO BE GONE #include +FILE * dumpfile; + /* local includes */ #include "vchat.h" #include "vchat-user.h" @@ -185,6 +187,8 @@ vcconnect (char *server, char *port) snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_CONNECTED), server, port); writechan (tmpstr); + dumpfile = fopen( "dumpfile", "a"); + /* if we didn't fail until now, we've got a connection. */ return 0; } @@ -198,6 +202,7 @@ vcdisconnect () { close(serverfd); serverfd = -1; } + loggedin = 0; } /* handle a pm not sent error @@ -909,7 +914,7 @@ networkoutput (char *msg) { #ifdef DEBUG /* debugging? log network output! */ - fprintf (stderr, ">| %s\n", msg); + fprintf (dumpfile, ">| %s (%zd)\n", msg, strlen(msg)); #endif /* send data to server */ -- cgit v1.2.3