From 406fb515ec8c4216d17f96842de60d2990d499c7 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 27 Apr 2006 16:07:33 +0000 Subject: [PATCH] fixed linked list bug which as pushing app responses onto the front of the queue, and some general cleanup git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@706 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libstack/osrf_app_session.c | 16 ++++++++++++++-- src/libtransport/transport_client.c | 5 ----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/libstack/osrf_app_session.c b/src/libstack/osrf_app_session.c index c02b8b8..f7ed56c 100644 --- a/src/libstack/osrf_app_session.c +++ b/src/libstack/osrf_app_session.c @@ -56,11 +56,23 @@ void _osrf_app_request_free( void * req ){ void _osrf_app_request_push_queue( osrf_app_request* req, osrf_message* result ){ if(req == NULL || result == NULL) return; osrfLogDebug( OSRF_LOG_MARK, "App Session pushing request [%d] onto request queue", result->thread_trace ); - if(req->result == NULL) + if(req->result == NULL) { req->result = result; - else { + + } else { + + osrf_message* ptr = req->result; + osrf_message* ptr2 = req->result->next; + while( ptr2 ) { + ptr = ptr2; + ptr2 = ptr2->next; + } + ptr->next = result; + + /* result->next = req->result; req->result = result; + */ } } diff --git a/src/libtransport/transport_client.c b/src/libtransport/transport_client.c index 065a725..c5f30e3 100644 --- a/src/libtransport/transport_client.c +++ b/src/libtransport/transport_client.c @@ -60,11 +60,6 @@ transport_client* client_init( char* server, int port, char* unix_path, int comp client->m_list->type = MESSAGE_LIST_HEAD; client->session = init_transport( server, port, unix_path, client, component ); - - if(client->session == NULL) { - osrfLogError(OSRF_LOG_MARK, "client_init(): Out of Memory"); - return NULL; - } client->session->message_callback = client_message_handler; return client; -- 2.11.0