setting/clearing log XID. honoring client log xid if present
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 19 Sep 2008 19:28:15 +0000 (19:28 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 19 Sep 2008 19:28:15 +0000 (19:28 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1434 9efc2488-bf62-4759-914b-345cdb29e865

src/gateway/osrf_http_translator.c

index 530b252..66bc90e 100644 (file)
@@ -116,11 +116,8 @@ static osrfHttpTranslator* osrfNewHttpTranslator(request_rec* apreq) {
     osrfStringArrayFree(params);
 
     /* load the request headers */
-    if (apr_table_get(apreq->headers_in, OSRF_HTTP_HEADER_XID) ) {
-        trans->localXid = 0;
-    } else {
-        trans->localXid = 1;
-    }
+    if (apr_table_get(apreq->headers_in, OSRF_HTTP_HEADER_XID)) // force our log xid to match the caller
+           osrfLogForceXid(strdup(apr_table_get(apreq->headers_in, OSRF_HTTP_HEADER_XID)));
 
     trans->handle = osrfSystemGetTransportClient();
     trans->recipient = apr_table_get(apreq->headers_in, OSRF_HTTP_HEADER_TO);
@@ -454,6 +451,7 @@ static int handler(request_rec *r) {
     testConnection(r);
 
     osrfHttpTranslator* trans = osrfNewHttpTranslator(r);
+       osrfLogMkXid();
     if(trans->body) {
         stat = osrfHttpTranslatorProcess(trans);
         //osrfHttpTranslatorDebug(trans);