tr_constraint_set_get_match_strings
[trust_router.git] / tid / tidc.c
index f35854e..7f675d3 100644 (file)
@@ -33,7 +33,6 @@
  */
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <jansson.h>
 
 #include <trust_router/tr_dh.h>
@@ -68,8 +67,15 @@ int tidc_open_connection (TIDC_INSTANCE *tidc,
 {
   int err = 0;
   int conn = -1;
+  unsigned int use_port = 0;
 
-  err = gsscon_connect(server, port, "trustidentity", &conn, gssctx);
+  if (0 == port)
+    use_port = TID_PORT;
+  else 
+    use_port = port;
+
+  fprintf(stderr, "tidc_open_connection: Opening GSS connection to %s:%u.", server, use_port);  
+  err = gsscon_connect(server, use_port, "trustidentity", &conn, gssctx);
 
   if (!err)
     return conn;
@@ -184,7 +190,7 @@ int tidc_fwd_request (TIDC_INSTANCE *tidc,
   if (msg)
     free(msg);
   if (tid_req)
-    free(tid_req);
+    tid_req_free(tid_req);
   if (req_buf)
     free(req_buf);
   if (resp_buf)
@@ -195,7 +201,3 @@ int tidc_fwd_request (TIDC_INSTANCE *tidc,
   return 0;
 }
 
-
-
-
-