[Opensrf-commits] r1856 - in trunk: include/opensrf src/libopensrf (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Nov 15 23:57:14 EST 2009
Author: scottmk
Date: 2009-11-15 23:57:11 -0500 (Sun, 15 Nov 2009)
New Revision: 1856
Modified:
trunk/include/opensrf/osrf_message.h
trunk/src/libopensrf/osrf_message.c
Log:
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
Modified: trunk/include/opensrf/osrf_message.h
===================================================================
--- trunk/include/opensrf/osrf_message.h 2009-11-16 03:53:18 UTC (rev 1855)
+++ trunk/include/opensrf/osrf_message.h 2009-11-16 04:57:11 UTC (rev 1856)
@@ -81,10 +81,6 @@
/** 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 @@
/** 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;
Modified: trunk/src/libopensrf/osrf_message.c
===================================================================
--- trunk/src/libopensrf/osrf_message.c 2009-11-16 03:53:18 UTC (rev 1855)
+++ trunk/src/libopensrf/osrf_message.c 2009-11-16 04:57:11 UTC (rev 1856)
@@ -40,10 +40,8 @@
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 @@
/**
- @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 @@
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);
More information about the opensrf-commits
mailing list