Add orig_coi to the reponse, fix bugs with coi-to-apc conversion.
authorMargaret Wasserman <margaret@moonshot-proxy.(none)>
Mon, 6 May 2013 14:07:04 +0000 (10:07 -0400)
committerMargaret Wasserman <margaret@moonshot-proxy.(none)>
Mon, 6 May 2013 14:07:04 +0000 (10:07 -0400)
common/tr_msg.c
tid/tids.c

index 204f9d6..592e145 100644 (file)
@@ -112,6 +112,11 @@ static json_t * tr_msg_encode_tidreq(TID_REQ *req)
 
   jstr = json_string(req->comm->buf);
   json_object_set_new(jreq, "community", jstr);
+  
+  if (req->orig_coi) {
+    jstr = json_string(req->orig_coi->buf);
+    json_object_set_new(jreq, "orig_coi", jstr);
+  }
 
   json_object_set_new(jreq, "dh_info", tr_msg_encode_dh(req->tidc_dh));
   
index 1b50b54..56fe596 100644 (file)
@@ -235,7 +235,7 @@ int tids_send_response (TIDS_INSTANCE *tids, TID_REQ *req, TID_RESP *resp)
 
   /* Never send a second response if we already sent one. */
   if (req->resp_sent)
-    return -1;
+    return 0;
 
   mresp.msg_type = TID_RESPONSE;
   mresp.tid_resp = resp;