diff options
author | keis <keijser@gmail.com> | 2011-01-14 20:45:56 +0100 |
---|---|---|
committer | keis <keijser@gmail.com> | 2011-02-15 21:05:49 +0100 |
commit | 95fb1bfa2a140611ee68ef42447327f6defd9b8d (patch) | |
tree | d76b965704d22cb844aa19d700d8db7164af0f23 /src/cookie-jar.c | |
parent | 681cb249c31e4e17e3ae9b8f68b10d7f33fea402 (diff) |
format event strings in send_event
send_event now takes a null terminated type, value sequence as arguments
vsend_event does the same thing but takes a va_list with arguments.
Diffstat (limited to 'src/cookie-jar.c')
-rw-r--r-- | src/cookie-jar.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/cookie-jar.c b/src/cookie-jar.c index 82a5269..bc7d022 100644 --- a/src/cookie-jar.c +++ b/src/cookie-jar.c @@ -45,13 +45,15 @@ changed(SoupCookieJar *jar, SoupCookie *old_cookie, SoupCookie *new_cookie) { if(cookie->expires) expires = g_strdup_printf ("%d", soup_date_to_time_t (cookie->expires)); - gchar * eventstr = g_strdup_printf ("'%s' '%s' '%s' '%s' '%s' '%s'", - cookie->domain, cookie->path, cookie->name, cookie->value, scheme, expires?expires:""); - if(new_cookie) - send_event(ADD_COOKIE, eventstr, NULL); - else - send_event(DELETE_COOKIE, eventstr, NULL); - g_free(eventstr); + send_event (new_cookie ? ADD_COOKIE : DELETE_COOKIE, NULL, + TYPE_STR, cookie->domain, + TYPE_STR, cookie->path, + TYPE_STR, cookie->name, + TYPE_STR, cookie->value, + TYPE_STR, scheme, + TYPE_STR, expires ? expires : "", + NULL); + if(expires) g_free(expires); } |