From 873e2c154f3154a181bbc433475ed97999463aea Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 11 Jun 2012 10:21:27 +0000 Subject: [PATCH] -zkey re --- src/gns/gnunet-gns-proxy.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 2fef34343..b4ad6cb3d 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c @@ -43,6 +43,7 @@ /* regexp */ #define RE_DOTPLUS "pp_buf, 0, sizeof(ctask->pp_buf)); - memcpy (ctask->pp_buf, hostptr, (m[1].rm_eo-m[1].rm_so)); + + /* If .+ extend with authority */ + if (0 == strcmp (ctask->buffer_ptr+m[1].rm_eo, "+")) + { + memcpy (ctask->pp_buf, hostptr, (m[1].rm_eo-m[1].rm_so)); + strcpy ( ctask->pp_buf+strlen(ctask->pp_buf), + ctask->authority); + } + /* If .zkey simply copy the name */ + else if (0 == strcmp (ctask->buffer_ptr+m[1].rm_eo, "zkey", 4)) + { + memcpy (ctask->pp_buf, hostptr, (m[1].rm_eo-m[1].rm_so+4)); + } ctask->is_postprocessing = GNUNET_YES; ctask->pp_finished = GNUNET_NO; + + GNUNET_GNS_shorten (gns_handle, + ctask->pp_buf, + &process_shorten, + ctask); //postprocess_name(ctask, NULL); - ctask->pp_task = GNUNET_SCHEDULER_add_now (&postprocess_name, ctask); + //ctask->pp_task = GNUNET_SCHEDULER_add_now (&postprocess_name, ctask); return 0; } -- 2.25.1