From 69f731f19081c6820a71f8134acceb3d045f5e16 Mon Sep 17 00:00:00 2001 From: scottmk Date: Mon, 16 Nov 2009 04:57:11 +0000 Subject: [PATCH] Eliminated two members of the osrfMessage structure: result_string and sender_tz_offset. Neither is used for anything, and either may be easily reinstated if necessary. I was tempted to eliminate the protocol member as well, since it isn't used for anything either. However it's populated from one of the parameters to osrf_message_init(). Getting rid of the protocol member properly would ramify to all the code that calls osrf_message_init(), which would be a lot of work to undo if necessary, so I left it alone. M include/opensrf/osrf_message.h M src/libopensrf/osrf_message.c git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1856 9efc2488-bf62-4759-914b-345cdb29e865 --- include/opensrf/osrf_message.h | 8 -------- src/libopensrf/osrf_message.c | 14 +++----------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/include/opensrf/osrf_message.h b/include/opensrf/osrf_message.h index cd86e59..84839af 100644 --- a/include/opensrf/osrf_message.h +++ b/include/opensrf/osrf_message.h @@ -81,10 +81,6 @@ struct osrf_message_struct { /** Used for RESULT messages: contains the data returned by a remote procedure. */ jsonObject* _result_content; - /** Unparsed JSON string containing the data returned by a remote procedure. - Unused and useless. */ - char* result_string; - /** For a REQUEST message: name of the remote procedure to call. */ char* method_name; @@ -96,10 +92,6 @@ struct osrf_message_struct { /** Magical LOCALE hint. */ char* sender_locale; - - /** Timezone offset from GMT of sender, in seconds. Not used. */ - int sender_tz_offset; - }; typedef struct osrf_message_struct osrfMessage; diff --git a/src/libopensrf/osrf_message.c b/src/libopensrf/osrf_message.c index b1f7d4e..5a9c64b 100644 --- a/src/libopensrf/osrf_message.c +++ b/src/libopensrf/osrf_message.c @@ -40,10 +40,8 @@ osrfMessage* osrf_message_init( enum M_TYPE type, int thread_trace, int protocol msg->is_exception = 0; msg->_params = NULL; msg->_result_content = NULL; - msg->result_string = NULL; msg->method_name = NULL; msg->sender_locale = NULL; - msg->sender_tz_offset = 0; return msg; } @@ -235,20 +233,17 @@ void osrf_message_set_status_info( osrfMessage* msg, /** - @brief Populate the result_string and _result_content members of an osrfMessage. + @brief Populate the _result_content membersof an osrfMessage. @param msg Pointer to the osrfMessage to be populated. - @param json_string A JSON string encoding a result set. + @param json_string A JSON string encoding a result. - Used for a RESULT message to return the results of a request, such as a database lookup. + Used for a RESULT message to return the results of a remote procedure call. */ void osrf_message_set_result_content( osrfMessage* msg, const char* json_string ) { if( msg == NULL || json_string == NULL) return; - if( msg->result_string ) - free( msg->result_string ); if( msg->_result_content ) jsonObjectFree( msg->_result_content ); - msg->result_string = strdup(json_string); msg->_result_content = jsonParseString(json_string); } @@ -270,9 +265,6 @@ void osrfMessageFree( osrfMessage* msg ) { if( msg->_result_content != NULL ) jsonObjectFree( msg->_result_content ); - if( msg->result_string != NULL ) - free( msg->result_string); - if( msg->method_name != NULL ) free(msg->method_name); -- 2.11.0