X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=tid%2Ftid_req.c;h=a1a7a5a46502fa6e2585af11975a8cc5b20233e4;hp=7575352420b663d3b2eb4ef9c6ed1a74129264f1;hb=39c2dec6054da6fb692b40f6b5ac374795b17092;hpb=5bfbc89bff7cdbdb6a8ba91493888ff48056411d diff --git a/tid/tid_req.c b/tid/tid_req.c index 7575352..a1a7a5a 100644 --- a/tid/tid_req.c +++ b/tid/tid_req.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, JANET(UK) + * Copyright (c) 2012, 2014-2015, JANET(UK) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,8 +44,11 @@ static int destroy_tid_req(TID_REQ *req) { + OM_uint32 minor; if (req->json_references) json_decref(req->json_references); + if (req->gssctx) + gss_delete_sec_context( &minor, &req->gssctx, NULL); return 0; } @@ -210,6 +213,21 @@ void tid_req_free(TID_REQ *req) talloc_free(req); } +int tid_req_add_path(TID_REQ *req, + const char *this_system, unsigned port) +{ + char *path_element = talloc_asprintf(req, "%s:%u", + this_system, port); + if (!req->path) { + req->path = json_array(); + if (!req->path) + return -1; + tid_req_cleanup_json(req, req->path); + } + return json_array_append( req->path, json_string(path_element)); +} + + void tid_srvr_get_address(const TID_SRVR_BLK *blk, const struct sockaddr **out_addr,