soc.2012.statscollector: 3ff37c9c: Make the plugin compatible on 3.0.0 and ...

sanket at sanket at
Fri Jun 1 05:43:17 EDT 2012

Revision: 3ff37c9c0bfc4876905e342fc23b4a0448dade77
Parent:   393832b1daa7dc5eadd0c1212da24f6ef7c6b758
Author:   sanket at
Date:     06/01/12 06:25:12
Branch:   im.pidgin.soc.2012.statscollector


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.

Changes against parent 393832b1daa7dc5eadd0c1212da24f6ef7c6b758

  patched  libpurple/plugins/statscollector.c

-------------- next part --------------
--- libpurple/plugins/statscollector.c	bfb369807a86418dfec21a4995ff4ec2f188270c
+++ libpurple/plugins/statscollector.c	f9d65a198aed914f2c5c97cf9f0f3ce81b542cdf
@@ -27,10 +27,10 @@
 /* Timeout */
-#define RESEND_SEC 40
+#define RESEND_SEC (24*3600)
 /* Sending URL */
-#define SEND_URL "http://localhost:8000/collectstats/collect/"
+#define SEND_URL ""
 /* 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 @@ send_stats()
           "Content-Length: %" G_GSIZE_FORMAT "\r\n\r\n%s",
           path, host, port, strlen(postdata), postdata);
   urldata = purple_util_fetch_url_request(NULL, url, TRUE, NULL, FALSE, request, FALSE, -1, url_callback, (gpointer)postdata);
+  urldata = purple_util_fetch_url_request(url, TRUE, NULL, FALSE, request, FALSE, url_callback, (gpointer)postdata);

More information about the Commits mailing list