/soc/2012/sanket/statscollector-2.x.y: 16d8ddf0788a: Make the pl...
Sanket Agarwal
sanket at soc.pidgin.im
Tue Jul 10 00:36:26 EDT 2012
Changeset: 16d8ddf0788a050c6e39a7dee70f74172eeab2f2
Author: Sanket Agarwal <sanket at soc.pidgin.im>
Date: 2012-06-01 10:25 +0000
Branch: soc.2012.statscollector
URL: http://hg.pidgin.im/soc/2012/sanket/statscollector-2.x.y/rev/16d8ddf0788a
Description:
Make the plugin compatible on 3.0.0 and <3.0.0
There's an API change in 3.0.0 (util_fetch_request) which breaks the code
for lower versions. Place an #ifdef to handle compilation accordingly.
Also there are some string changes for being able to submit stats to the
remote server AND to ensure that stats are not submitted too often.
diffstat:
libpurple/plugins/statscollector.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (28 lines):
diff --git a/libpurple/plugins/statscollector.c b/libpurple/plugins/statscollector.c
--- a/libpurple/plugins/statscollector.c
+++ b/libpurple/plugins/statscollector.c
@@ -27,10 +27,10 @@
#endif
/* Timeout */
-#define RESEND_SEC 40
+#define RESEND_SEC (24*3600)
/* Sending URL */
-#define SEND_URL "http://localhost:8000/collectstats/collect/"
+#define SEND_URL "http://pidgin-stats.alwaysdata.net/collectstats/collect/"
/* POSIX compliance is an issue that I have looked into some detail now
* It seems like presence of unistd.h and _POSIX_VERSION being defined
@@ -749,7 +749,11 @@
"Content-Length: %" G_GSIZE_FORMAT "\r\n\r\n%s",
path, host, port, strlen(postdata), postdata);
+#if PURPLE_VERSION_CHECK(3,0,0)
urldata = purple_util_fetch_url_request(NULL, url, TRUE, NULL, FALSE, request, FALSE, -1, url_callback, (gpointer)postdata);
+#else
+ urldata = purple_util_fetch_url_request(url, TRUE, NULL, FALSE, request, FALSE, url_callback, (gpointer)postdata);
+#endif
purple_prefs_set_int("/plugins/core/statscollector/last-sent",\
More information about the Commits
mailing list