int i;
osrfLogDebug(OSRF_LOG_MARK,
- "WS received opensrf response for thread=%s, xid=%s",
- tmsg->thread, tmsg->osrf_xid);
+ "WS received opensrf response for thread=%s", tmsg->thread);
// first we need to perform some maintenance
msg_list = osrfMessageDeserialize(tmsg->body, NULL);
}
}
- // maintenance is done
- msg_list->freeItem = osrfMessageFree;
+ // osrfMessageDeserialize applies the freeItem handler to the
+ // newly created osrfList. We only need to free the list and
+ // the individual osrfMessage's will be freed along with it
osrfListFree(msg_list);
if (!trans->client_connected) {
- osrfLogDebug(OSRF_LOG_MARK,
- "WS discarding response for thread=%s, xid=%s",
- tmsg->thread, tmsg->osrf_xid);
+ osrfLogInfo(OSRF_LOG_MARK,
+ "WS discarding response for thread=%s", tmsg->thread);
return;
}
-
// client is still connected.
// relay the response messages to the client
if (tmsg->is_error) {
osrfLogError(OSRF_LOG_MARK,
- "WS received jabber error message in response to thread=%s and xid=%s",
- tmsg->thread, tmsg->osrf_xid);
+ "WS received jabber error message in response to thread=%s",
+ tmsg->thread);
jsonObjectSetKey(msg_wrapper, "transport_error", jsonNewBoolObject(1));
}
return NULL;
}
+ osrfLogForceXid(tmsg->osrf_xid);
osrf_responder_thread_main_body(tmsg);
message_free(tmsg);
}
request_rec *r = server->request(server);
apr_pool_t *pool;
- osrfLogDebug(OSRF_LOG_MARK,
+ osrfLogInfo(OSRF_LOG_MARK,
"WS connect from %s", r->connection->remote_ip);
//"WS connect from %s", r->connection->client_ip); // apache 2.4
clear_cached_recipient(thread);
break;
}
-
- osrfMessageFree(msg);
}
char* finalMsg = osrfMessageSerializeBatch(msg_list, num_msgs);
if (buffer_size <= 0) return OK;
+ // generate a new log trace for this request. it
+ // may be replaced by a client-provided trace below.
+ osrfLogMkXid();
+
osrfLogDebug(OSRF_LOG_MARK, "WS received message size=%d", buffer_size);
// buffer may not be \0-terminated, which jsonParse requires
return HTTP_BAD_REQUEST;
}
- // TODO: make this work with non-client and make this call accept
- // const char*'s. casting to (char*) for now to silence warnings.
- osrfLogSetXid((char*) log_xid);
-
- } else {
- // generate a new log trace id for this relay
- osrfLogMkXid();
+ osrfLogForceXid(log_xid);
}
if (thread) {
}
osrfLogDebug(OSRF_LOG_MARK,
- "WS relaying message thread=%s, xid=%s, recipient=%s",
- thread, osrfLogGetXid(), recipient);
+ "WS relaying message to opensrf thread=%s, recipient=%s",
+ thread, recipient);
msg_body = extract_inbound_messages(
r, service, thread, recipient, osrf_msg);
request_rec *r = server->request(server);
- osrfLogDebug(OSRF_LOG_MARK,
+ osrfLogInfo(OSRF_LOG_MARK,
"WS disconnect from %s", r->connection->remote_ip);
//"WS disconnect from %s", r->connection->client_ip); // apache 2.4
}