]> git.pld-linux.org Git - packages/ekg2.git/commitdiff
- this patch disconnect irc plugin when irc server dies
authormarti <marti@pld-linux.org>
Tue, 5 Jul 2011 07:43:10 +0000 (07:43 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ekg2-keepalive_irc.patch -> 1.1

ekg2-keepalive_irc.patch [new file with mode: 0644]

diff --git a/ekg2-keepalive_irc.patch b/ekg2-keepalive_irc.patch
new file mode 100644 (file)
index 0000000..4377913
--- /dev/null
@@ -0,0 +1,42 @@
+diff -ur leafnode-ekg2-bd26d9a-orig/plugins/irc/irc.c leafnode-ekg2-bd26d9a/plugins/irc/irc.c
+--- leafnode-ekg2-bd26d9a-orig/plugins/irc/irc.c       2011-05-21 13:19:15.000000000 +0200
++++ leafnode-ekg2-bd26d9a/plugins/irc/irc.c    2011-07-05 09:32:19.636396656 +0200
+@@ -571,6 +571,24 @@
+       irc_handle_disconnect(s, err->message, EKG_DISCONNECT_FAILURE);
+ }
++static TIMER_SESSION(irc_ping_timer_handler) {
++   irc_private_t *j;
++   GTimeVal tv;
++
++   if (type == 1)
++       return 0;
++
++   if (!s || !s->connected)
++       return -1;
++
++   j = irc_private(s);
++
++   g_get_current_time(&tv);
++   ekg_connection_write(j->send_stream, "PRIVMSG %s :\01PING %d %d\01\r\n",
++       j->nick ,tv.tv_sec, tv.tv_usec);
++   return 0;
++}
++
+ /*                                                                     *
+  * ======================================== COMMANDS ------------------- *
+@@ -599,6 +617,12 @@
+       if (session_status_get(session) == EKG_STATUS_NA)
+               session_status_set(session, EKG_STATUS_AVAIL);
++      
++      if(timer_find_session(session, "ping") == NULL) {
++          /* ping irc server for every 30 minutes */
++          timer_add_session(session, "ping", 30*60, 1, irc_ping_timer_handler);
++      }
++
+       /* XXX: timeout */
+       return -1;
+Tylko w leafnode-ekg2-bd26d9a/plugins/irc: irc.c~
This page took 0.109454 seconds and 4 git commands to generate.