diff options
author | FreeArtMan <dos21h@gmail.com> | 2017-05-13 22:37:06 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2017-05-13 22:37:06 +0100 |
commit | b385fc9a6832f4186f98cde4bd92b7de6ac553b9 (patch) | |
tree | 322004b33f00e35591bdc7cafa1c32df7a9375f7 /sock_conn.c | |
parent | 1e8e7cf72de6ca97b8e8cd3ba4266788ba9fec53 (diff) | |
download | agni-b385fc9a6832f4186f98cde4bd92b7de6ac553b9.tar.gz agni-b385fc9a6832f4186f98cde4bd92b7de6ac553b9.zip |
Now after suspend HW, bot can reconnect back to server address
Diffstat (limited to 'sock_conn.c')
-rw-r--r-- | sock_conn.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sock_conn.c b/sock_conn.c index 57a3acd..119dd10 100644 --- a/sock_conn.c +++ b/sock_conn.c @@ -499,6 +499,7 @@ int irc_reconnect(irc_conn *conn) irc_conn reconn; + PNL(); if (conn == NULL) { PERM(); @@ -516,18 +517,22 @@ int irc_reconnect(irc_conn *conn) fret = irc_open(hostname, port, &reconn); if (fret==-1) { - PERM(); + ENL(); return -1; } if (-1 == irc_read_timeout(&reconn, timeout)) { - PERM(); + ENL(); } //BUG lets think about this case deeper //free(hostname); //free(port); + PNL(); + + memcpy(conn, &reconn, sizeof(irc_conn)); + return 0; } |