summaryrefslogtreecommitdiff
path: root/vchat-protocol.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2019-09-15 19:00:04 +0200
committerDirk Engling <erdgeist@erdgeist.org>2019-09-15 19:00:04 +0200
commit43b74147212ddc5e619ac17dd1b5967b6b293d8a (patch)
tree90064efb078be2b557d05eb9fbfaaa13d0bc1676 /vchat-protocol.c
parent9b8e801777f2bcc15c6ca1caffca3236b8cf2b75 (diff)
Set loggedin to false when connection breaks
Diffstat (limited to 'vchat-protocol.c')
-rwxr-xr-xvchat-protocol.c7
1 files changed, 6 insertions, 1 deletions
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 @@
30// TO BE GONE 30// TO BE GONE
31#include <openssl/bio.h> 31#include <openssl/bio.h>
32 32
33FILE * dumpfile;
34
33/* local includes */ 35/* local includes */
34#include "vchat.h" 36#include "vchat.h"
35#include "vchat-user.h" 37#include "vchat-user.h"
@@ -185,6 +187,8 @@ vcconnect (char *server, char *port)
185 snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_CONNECTED), server, port); 187 snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_CONNECTED), server, port);
186 writechan (tmpstr); 188 writechan (tmpstr);
187 189
190 dumpfile = fopen( "dumpfile", "a");
191
188 /* if we didn't fail until now, we've got a connection. */ 192 /* if we didn't fail until now, we've got a connection. */
189 return 0; 193 return 0;
190} 194}
@@ -198,6 +202,7 @@ vcdisconnect () {
198 close(serverfd); 202 close(serverfd);
199 serverfd = -1; 203 serverfd = -1;
200 } 204 }
205 loggedin = 0;
201} 206}
202 207
203/* handle a pm not sent error 208/* handle a pm not sent error
@@ -909,7 +914,7 @@ networkoutput (char *msg)
909{ 914{
910#ifdef DEBUG 915#ifdef DEBUG
911 /* debugging? log network output! */ 916 /* debugging? log network output! */
912 fprintf (stderr, ">| %s\n", msg); 917 fprintf (dumpfile, ">| %s (%zd)\n", msg, strlen(msg));
913#endif 918#endif
914 919
915 /* send data to server */ 920 /* send data to server */