summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3051bf)
raw | patch | inline | side by side (parent: e3051bf)
author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 27 Feb 2008 08:29:17 +0000 (09:29 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 27 Feb 2008 08:29:17 +0000 (09:29 +0100) |
src/network.c | patch | blob | history |
diff --git a/src/network.c b/src/network.c
index 34cf0181eb7428b1816b7400375f7448e6b7067c..618bf523ee2d0722cfa3a804c63aac2b25b584d0 100644 (file)
--- a/src/network.c
+++ b/src/network.c
return (0);
} /* int network_init */
+static int network_flush (int timeout)
+{
+ pthread_mutex_lock (&send_buffer_lock);
+
+ if (((time (NULL) - cache_flush_last) >= timeout)
+ && (send_buffer_fill > 0))
+ {
+ flush_buffer ();
+ }
+
+ pthread_mutex_unlock (&send_buffer_lock);
+
+ return (0);
+} /* int network_flush */
+
void module_register (void)
{
plugin_register_config ("network", network_config,
config_keys, config_keys_num);
plugin_register_init ("network", network_init);
+ plugin_register_flush ("network", network_flush);
} /* void module_register */