summaryrefslogtreecommitdiff
path: root/libwardrobe
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-23 15:02:12 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-23 15:02:12 +0200
commit9e7903867979ebbf485c61cc95b69bd5ed1bfedb (patch)
tree37c3c3de620bfe10e82b2f78fd3a24470d33cddd /libwardrobe
parentf24af088f51effac4f77a47a3ef14288e303998c (diff)
downloadpianobar-windows-9e7903867979ebbf485c61cc95b69bd5ed1bfedb.tar.gz
pianobar-windows-9e7903867979ebbf485c61cc95b69bd5ed1bfedb.tar.bz2
pianobar-windows-9e7903867979ebbf485c61cc95b69bd5ed1bfedb.zip
client/wardrobe: Fix scrobbling time issue
Diffstat (limited to 'libwardrobe')
-rw-r--r--libwardrobe/src/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libwardrobe/src/main.c b/libwardrobe/src/main.c
index 2da94f0..897a596 100644
--- a/libwardrobe/src/main.c
+++ b/libwardrobe/src/main.c
@@ -26,6 +26,7 @@ THE SOFTWARE.
#include <stdio.h>
#include <curl/curl.h>
+#include "wardrobe.h"
#include "md5.h"
#define WARDROBE_HTTP_BUFFER_SIZE 10000
@@ -144,17 +145,16 @@ void WardrobeDestroy (WardrobeHandle_t *wh) {
*/
WardrobeReturn_t WardrobeHandshake (WardrobeHandle_t *wh) {
/* we'll use gmt */
- time_t currTime = time (NULL);
- time_t currGmTime = mktime (gmtime (&currTime));
char url[1024], tmp[100], *tmpDigest, *pwDigest, *ret;
WardrobeReturn_t fRet = WARDROBE_RET_ERR;
+ time_t currTStamp = time (NULL);
tmpDigest = WardrobeMd5Calc (wh->password);
- snprintf (tmp, sizeof (tmp), "%s%li", tmpDigest, currGmTime);
+ snprintf (tmp, sizeof (tmp), "%s%li", tmpDigest, currTStamp);
pwDigest = WardrobeMd5Calc (tmp);
snprintf (url, sizeof (url), "http://post.audioscrobbler.com/"
"?hs=true&p=1.2&c=tst&v=1.0&u=%s&t=%li&a=%s", wh->user,
- currGmTime, pwDigest);
+ currTStamp, pwDigest);
WardrobeHttpGet (wh->ch, url, &ret);
@@ -289,3 +289,4 @@ char *WardrobeErrorToString (WardrobeReturn_t ret) {
}
return NULL;
}
+