comparison libpurple/connection.c @ 21750:fb8ab2490ac4

De-magic number the prpl_info->keepalive interval, and document it.
author Will Thompson <will.thompson@collabora.co.uk>
date Mon, 03 Dec 2007 19:02:28 +0000
parents 1c9f741ee9c7
children da0b37abe4bd
comparison
equal deleted inserted replaced
21747:d376b1e191b5 21750:fb8ab2490ac4
36 #include "request.h" 36 #include "request.h"
37 #include "server.h" 37 #include "server.h"
38 #include "signals.h" 38 #include "signals.h"
39 #include "util.h" 39 #include "util.h"
40 40
41 #define KEEPALIVE_INTERVAL 30
42
41 static GList *connections = NULL; 43 static GList *connections = NULL;
42 static GList *connections_connecting = NULL; 44 static GList *connections_connecting = NULL;
43 static PurpleConnectionUiOps *connection_ui_ops = NULL; 45 static PurpleConnectionUiOps *connection_ui_ops = NULL;
44 46
45 static int connections_handle; 47 static int connections_handle;
71 return; 73 return;
72 74
73 if (on && !gc->keepalive) 75 if (on && !gc->keepalive)
74 { 76 {
75 purple_debug_info("connection", "Activating keepalive.\n"); 77 purple_debug_info("connection", "Activating keepalive.\n");
76 gc->keepalive = purple_timeout_add_seconds(30, send_keepalive, gc); 78 gc->keepalive = purple_timeout_add_seconds(KEEPALIVE_INTERVAL, send_keepalive, gc);
77 } 79 }
78 else if (!on && gc->keepalive > 0) 80 else if (!on && gc->keepalive > 0)
79 { 81 {
80 purple_debug_info("connection", "Deactivating keepalive.\n"); 82 purple_debug_info("connection", "Deactivating keepalive.\n");
81 purple_timeout_remove(gc->keepalive); 83 purple_timeout_remove(gc->keepalive);