paivana

HTTP paywall reverse proxy
Log | Files | Refs | Submodules | README | LICENSE

commit f7291bccf247e03f0b0d317f56d55f826435a27b
parent 49e7ab0d0408a25305031ff94ff09cf304d46d11
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon,  4 May 2026 15:55:02 +0200

more logging

Diffstat:
Msrc/backend/paivana-httpd_cookie.c | 18+++++++++++++++++-
Msrc/backend/paivana-httpd_pay.c | 3+++
2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/backend/paivana-httpd_cookie.c b/src/backend/paivana-httpd_cookie.c @@ -85,22 +85,38 @@ PAIVANA_HTTPD_check_cookie (const char *cookie, dash = strchr (cookie, '-'); if (NULL == dash) + { + GNUNET_break_op (0); return false; + } dash++; if (1 != sscanf (cookie, "%llu-", &u)) + { + GNUNET_break_op (0); return false; + } a.abs_time.abs_value_us = u * 1000LLU * 1000LLU; if (GNUNET_TIME_absolute_is_past (a.abs_time)) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Cookie expired %s ago\n", + GNUNET_TIME_relative2s ( + GNUNET_TIME_absolute_get_duration (a.abs_time), + true)); return false; + } if (GNUNET_OK != GNUNET_STRINGS_string_to_data (dash, strlen (dash), &c, sizeof (c))) + { + GNUNET_break_op (0); return false; + } compute_cookie_hash (a, website, ca_len, @@ -181,6 +197,6 @@ PAIVANA_HTTPD_compute_paivana_id (struct GNUNET_TIME_Timestamp cur_time, (int) clen, cstr); GNUNET_free (cstr); - gcry_md_close(hd); + gcry_md_close (hd); return res; } diff --git a/src/backend/paivana-httpd_pay.c b/src/backend/paivana-httpd_pay.c @@ -250,6 +250,9 @@ order_status_cb (struct PayRequest *ph, ph->website, ca_len, ca); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Client paid, setting cookie `%s'\n", + cookie); GNUNET_free (ca); resp = MHD_create_response_from_buffer (0, NULL,