fixed linked list bug which as pushing app responses onto the front of the queue...
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 27 Apr 2006 16:07:33 +0000 (16:07 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 27 Apr 2006 16:07:33 +0000 (16:07 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@706 9efc2488-bf62-4759-914b-345cdb29e865

src/libstack/osrf_app_session.c
src/libtransport/transport_client.c

index c02b8b8..f7ed56c 100644 (file)
@@ -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;
+               */
        }
 }
 
index 065a725..c5f30e3 100644 (file)
@@ -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;