opensrf/bjwebb.git
16 years agoPatch from Scott McKellar to fix up some const correctness issues.
miker [Thu, 31 Jan 2008 19:09:46 +0000 (19:09 +0000)]
Patch from Scott McKellar to fix up some const correctness issues.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1236 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Thu, 31 Jan 2008 19:07:30 +0000 (19:07 +0000)]
Patch from Scott McKellar:

1. I replaced the following identifiers with their camel-case
equivalents:

   osrf_message             ==> osrfMessage
   osrf_message_free        ==> osrfMessageFree
   string_array             ==> osrfStringArray
   string_array_get_string  ==> osrfStringArrayGetString

2. In osrf_app_server_session_init() we were leaking session in the
case of an early return.  I stuck in a free().

3. Likewise in osrfAppSessionMakeLocaleRequest() we were leaking req
in the case of an early return.  I plugged that one too.

4. In osrfAppRequestRespondComplete() we were leaking payload in one
branch of an if/else.  I moved the osrfMessageFree() beyond both
branches so that it would be unconditional.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1235 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Thu, 31 Jan 2008 19:05:18 +0000 (19:05 +0000)]
Patch from Scott McKellar:

1. I moved the declarations of the following functions out of the
header and into the implementation file, and declared the functions
as static:

   _osrfAppBuildMethod
   _osrfAppFindApplication
   __osrfAppFindMethod (and removed both underscores)
   __osrfAppRunSystemMethod (and removed one underscore)
   __osrfAppRegisterSysMethods (and removed one underscore)
   __osrfAppPostProcess (and removed one underscore)
   _osrfAppRespond
   osrfAppIntrospect
   osrfAppIntrospectAll
   osrfAppEcho
   osrfAppSetOnExit

2. I plugged a memory leak in osrfAppRunExitCode (we weren't freeing
the osrfHashIterator).

3. I made sure to populate all members of a new osrfMethod.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1234 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Thu, 31 Jan 2008 18:23:52 +0000 (18:23 +0000)]
Patch from Scott McKellar:

1. I renamed __osrfRouter simply to router, and made it static.  We
had one global variable and one auto variable pointing to the same
object, causing some needless juggling.  Now we have just one
pointer.

2. I removed the leading underscores from __setupRouter().

3. I renamed the parameter to routerSignalHandler() from "signal"
to "signo", since "signal" is a reserved identifier.  I also added
some code to re-raise the signal caught.

[from a followup email]

> I chose instead to terminate the program by re-raising the signal.
> That way the parent process has a chance to detect that the program
> was terminated by a signal rather than by a normal return.

After posting this I realized that the router program runs as a
daemon, and its adopted parent process doesn't care whether it
terminates by a signal or by a normal return.  So there's not
much point in re-raising the signal.

It remains true that the signal handler should contrive to
terminate the program, either by exiting or by setting a flag that
the rest of the program tests.

[ The original patch, re-raising the signal, is applied. ]

4. In main() I moved two calls to free() so that they are reachable.

5. In main() I return either EXIT_SUCCESS or EXIT_FAILURE, which are
portable.  Otherwise we could find ourselves returning -1, which is
not portable.

6. In setupRouter() I arranged to free resource, and to free
tservers and tclients in the case of an early return.  I also free
router in the unlikely event that osrfRouterRun returns.

7. I reworded an error message to something that I think is more
clear.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1233 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Thu, 31 Jan 2008 18:18:29 +0000 (18:18 +0000)]
Patch from Scott McKellar:

1. In the header: I added compilation guards.

2. In the header: I changed leading double underscores to leading
single underscores.  These identifiers don't appear elsewhere in the
code base, with either double or single underscores.

3. I moved most of the header into the implementation file.  The
headers whose prototypes I moved are now static.  Where there were
comments associated with the prototypes, I moved them to the function
definitions.

4. I removed an extra leading underscore from __osrfRouterFillFDSet().

5. I replaced some deprecated identifiers with their camel-case
equivalents:

   osrf_message_free   ==> osrfMessageFree
   osrf_message        ==> osrfMessage

6. I added the const qualifier to several function parameters.

7. In a couple of spots we were failing to free classname buffers.
I plugged those leaks.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1232 9efc2488-bf62-4759-914b-345cdb29e865

16 years agocamelCasingPatch from Scott McKellar
miker [Thu, 31 Jan 2008 17:33:02 +0000 (17:33 +0000)]
camelCasingPatch from Scott McKellar

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1231 9efc2488-bf62-4759-914b-345cdb29e865

16 years agotry/except/finally combinations are only supported in Python 2.5. in this case,...
erickson [Wed, 30 Jan 2008 17:36:43 +0000 (17:36 +0000)]
try/except/finally combinations are only supported in Python 2.5.  in this case, the finally is not necessary. removed it

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1230 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoturn \d{1,10} into a number on the wire
miker [Wed, 30 Jan 2008 17:30:43 +0000 (17:30 +0000)]
turn \d{1,10} into a number on the wire

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1229 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoupdating legacy JSON parser to store numbers as strings
erickson [Wed, 30 Jan 2008 17:06:21 +0000 (17:06 +0000)]
updating legacy JSON parser to store numbers as strings

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1228 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoappending neglected boolean object to growing JSON object. Thanks, Scott
erickson [Tue, 29 Jan 2008 17:03:41 +0000 (17:03 +0000)]
appending neglected boolean object to growing JSON object.  Thanks, Scott

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1227 9efc2488-bf62-4759-914b-345cdb29e865

16 years agopython opensrf pre-forking server implementation. this component manages the
erickson [Tue, 29 Jan 2008 03:17:07 +0000 (03:17 +0000)]
python opensrf pre-forking server implementation.  this component manages the
"inbound" and drone processes for server applications.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1226 9efc2488-bf62-4759-914b-345cdb29e865

16 years agocreated a shallow clone method
erickson [Tue, 22 Jan 2008 19:09:37 +0000 (19:09 +0000)]
created a shallow clone method

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1225 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoSet the Makefile shell to bash via the Makefile SHELL variable
dbs [Tue, 22 Jan 2008 16:35:51 +0000 (16:35 +0000)]
Set the Makefile shell to bash via the Makefile SHELL variable

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1224 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded the ability to wait forever by passing <0 to recv. explicitly setting sender...
erickson [Sun, 20 Jan 2008 00:00:15 +0000 (00:00 +0000)]
added the ability to wait forever by passing <0 to recv.  explicitly setting sender address in messages to be correct.  added ability to create a message from raw xml

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1223 9efc2488-bf62-4759-914b-345cdb29e865

16 years agolibxml2 and libxslt1 Python modules are abnormal - remove them from requires list
dbs [Thu, 17 Jan 2008 16:39:23 +0000 (16:39 +0000)]
libxml2 and libxslt1 Python modules are abnormal - remove them from requires list
We'll document how to install these as system packages instead

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1222 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoAdd dnspython, libxml, and libxslt1 dependencies on behalf of pyxmpp
dbs [Wed, 16 Jan 2008 17:40:07 +0000 (17:40 +0000)]
Add dnspython, libxml, and libxslt1 dependencies on behalf of pyxmpp

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1221 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded the ability to use cjson for json encoding/decoding. gracefully falls back...
erickson [Wed, 16 Jan 2008 16:48:24 +0000 (16:48 +0000)]
added the ability to use cjson for json encoding/decoding.  gracefully falls back to simplejson

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1220 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoI started adding some basic bootstrap options looking ahead to server-side python.
erickson [Tue, 15 Jan 2008 23:24:31 +0000 (23:24 +0000)]
I started adding some basic bootstrap options looking ahead to server-side python.
This resulted in a small set of code cleanup including:
    move from camelCase to lower_under for method names
    move from global variables to class-level static variables
    move from global functions to class-level static functions

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1219 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoRevert Gentoo changes (sigh)
dbs [Tue, 15 Jan 2008 18:02:41 +0000 (18:02 +0000)]
Revert Gentoo changes (sigh)

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1218 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoMake cleaning in Python dir optional as well, to avoid problems with missing setuptools
dbs [Tue, 15 Jan 2008 17:50:06 +0000 (17:50 +0000)]
Make cleaning in Python dir optional as well, to avoid problems with missing setuptools

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1217 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoAdd a build flag for Python modules
dbs [Tue, 15 Jan 2008 17:42:45 +0000 (17:42 +0000)]
Add a build flag for Python modules

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1216 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoBootstrapping doesn't work as desired on systems that already have setuptools
dbs [Tue, 15 Jan 2008 17:37:11 +0000 (17:37 +0000)]
Bootstrapping doesn't work as desired on systems that already have setuptools

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1215 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoBootstrap setuptools, drop unnecessary directory metadata
dbs [Tue, 15 Jan 2008 15:51:49 +0000 (15:51 +0000)]
Bootstrap setuptools, drop unnecessary directory metadata

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1214 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoremoving old, unused code
erickson [Tue, 15 Jan 2008 14:43:40 +0000 (14:43 +0000)]
removing old, unused code

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1213 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoSwitch to setuptools to enable dependency installs as well
dbs [Tue, 15 Jan 2008 04:03:07 +0000 (04:03 +0000)]
Switch to setuptools to enable dependency installs as well

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1212 9efc2488-bf62-4759-914b-345cdb29e865

16 years agorepaired expire time logic to force use of the configured max if timeout is indefinit...
erickson [Mon, 7 Jan 2008 14:55:36 +0000 (14:55 +0000)]
repaired expire time logic to force use of the configured max if timeout is indefinite (0) or larger than max

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1211 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Mon, 7 Jan 2008 02:11:47 +0000 (02:11 +0000)]
Patch from Scott McKellar:

1. I moved almost everything from the header file into the
implementation file, since it isn't referenced elsewhere.  All that's
left is one function prototype and a series of nested #includes.

2. I added compilation guards to the header.

3. Except for osrf_prefork_run(), all functions are now static, as is
the child_dead variable.

4. I commented out the MAX_BUFSIZE macro, since it isn't used.

5. I removed the declaration of main(), which seemed rather pointless.

6. I added the const qualifier to the parameters of osrf_prefork_run()
and osrf_prefork_routers().

7. I made sure that all members were explicitly initialized when
creating a prefork_simple or a prefork_child.

8. I commented out both the prototype and the definition of
find_prefork_child(), since we don't call it anywhere.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1210 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Mon, 7 Jan 2008 02:08:10 +0000 (02:08 +0000)]
Patch from Scott McKellar:

1. I moved almost everything from the header into the implementation
file, since it isn't referenced elsewhere.  All that's left is one
prototype and some nested #includes.

2. I moved the nested #includes inside the compilation guard.

3. Except for osrf_stack_transport_handler(), all functions are now
static.

4. I applied the const qualifier to the second parameter of
osrf_stack_transport_handler().

5. I plugged a memory leak in osrf_stack_transport_handler().  When
unable to open a session, we were returning without freeing the
input message.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1209 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoJSON to XML patches from Scott McKellar:
miker [Mon, 7 Jan 2008 02:04:54 +0000 (02:04 +0000)]
JSON to XML patches from Scott McKellar:

Guard against multiple #inclusions.

Plug a potential memory leak in the jsonObjectToXML
function.  If the input parameter was NULL we would fail to free
the growing_buffer we had just allocated.  I rearranged it to check
for NULL before allocating the growing_buffer.

Also: I added the static qualifier to the _escape_xml function, to
match the declaration at the top of the file.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1208 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoMemory leak fixes for the old-style gateway:
miker [Mon, 7 Jan 2008 02:00:25 +0000 (02:00 +0000)]
Memory leak fixes for the old-style gateway:

1. osrf_locale, allocated by either buffer_release() or strdup().

2. A series of buffers allocated by apacheGetFirstParamValue():

   param_locale
   service
   method
   format
   input_format
   a_l
   tout

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1207 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoMemory leak plugged by Scott McKellar:
miker [Mon, 7 Jan 2008 01:57:18 +0000 (01:57 +0000)]
Memory leak plugged by Scott McKellar:

In handle_request() we allocate a growing_buffer and pass the pointer
to send_request().  However we weren't freeing the growing_buffer
after the return from send_request().

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1206 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoTwo patch sets from Scott McKellar
miker [Mon, 7 Jan 2008 01:55:25 +0000 (01:55 +0000)]
Two patch sets from Scott McKellar

First:

1. I moved the macros OSRF_LIST_DEFAULT_SIZE and OSRF_LIST_INC_SIZE
from the header into the implementation file.  No other source files
reference them, nor should they.

2. I moved the OSRF_LIST_MAX_SIZE macro into the implementation file
as well, and then commented it out.  It is nowhere referenced, but
out of caution I preserved it like a fly in amber.

3. I removed a leading underscore from each of the struct names
__osrfListStruct and __osrfListIteratorStruct.

4. I removed some obsolete comment text concerning osrfNewList().

5. I deleted the declaration for __osrfListSetSize(), which is
nowhere defined.

6. I made sure to explicitly initialize all struct members.

7. When allocating pointer arrays, I explicitly initialize all the
pointers to NULL.

8. I rewrote osrfNewList() as a thin wrapper for osrfNewListSize(),
to eliminate some duplication of code.

Second:

These patches eliminate the following identifiers, which have all been
replaced by their camel-case equivalents:

   osrf_app_session_make_req
   osrf_app_session_destroy
   osrf_app_session_request_recv
   osrf_app_request
   osrf_system_get_transport_client
   osrf_system_bootstrap_client_resc

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1205 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Mon, 7 Jan 2008 01:46:42 +0000 (01:46 +0000)]
Patch from Scott McKellar:

1. Move several internal details from the header to the implementation
file:

   The macros OSRF_HASH_LIST_SIZE and OSRF_HASH_NODE_FREE
   The declaration of the osrfHashNode struct
   The declarations of the osrfNewHashNode and osrfHashNodeFree
       functions (which are now static)

2. Remove a leading underscore from each of the struct tags
__osrfHashStruct and __osrfHashIteratorStruct;

3. Explicitly initialize all struct members.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1204 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoEnable Python build with regular user to avoid perm problems at clean time.
dbs [Mon, 7 Jan 2008 00:37:13 +0000 (00:37 +0000)]
Enable Python build with regular user to avoid perm problems at clean time.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1203 9efc2488-bf62-4759-914b-345cdb29e865

16 years agousing new C-based JSON parser: JSON::XS - this new code wraps the to/from JSON calls...
erickson [Sun, 6 Jan 2008 21:12:09 +0000 (21:12 +0000)]
using new C-based JSON parser: JSON::XS - this new code wraps the to/from JSON calls with opensrf class management

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1202 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoproviding option to connect to memcache at general connect time
erickson [Sun, 6 Jan 2008 20:24:43 +0000 (20:24 +0000)]
providing option to connect to memcache at general connect time

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1201 9efc2488-bf62-4759-914b-345cdb29e865

16 years agomade exceptions a litte more generic, passing msg to superclass for networexception
erickson [Sun, 6 Jan 2008 20:22:57 +0000 (20:22 +0000)]
made exceptions a litte more generic, passing msg to superclass for networexception

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1200 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Sat, 5 Jan 2008 19:07:02 +0000 (19:07 +0000)]
Patch from Scott McKellar:

These patches are the culmination of several postings on this subject.
The overall effect is to store numbers in jsonObjects as strings,
rather than as doubles, in order to avoid needless loss of precision
in translating back and forth between text and floating point
representations.

I shall not repeat the details outlined in previous posts, but rather
focus on what's new:

1. A new extern function jsonNewNumberStringObject constructs a
JSON_NUMBER from a character string.  If the string is not numeric
according to JSON rules, the function returns NULL.

2. A new extern function jsonScrubNumber accepts a character string
and reformats it, if possible, into a numeric string that is valid
according to JSON rules.  For example, it transforms "  +00.42"
into "0.42".  The transformed string is returned as a char* that
the caller is responsible for freeing.

jsonScrubNumber performs this transformation by manipulating text,
not by passing the value through a double.  Therefore it can handle
numbers that would be too long, too large, or too small for strtod()
and its kindred to handle.

It accepts leading white space and scientific notation, but not
trailing white space, hex, or octal.

If the input string is not numeric, jsonScrubNumber returns NULL.

3. The doubleToString function now translates the incoming double
to a character string with up to 30 decimal digits of precision.
That should be enough to minimize the impact on existing code,
depending of course on how faithfully snprintf() does the formatting.

4. In osrf_json.h: I changed the signature of the next-to-last
function pointer in a jsonParserHandler, so that it accepts a
character pointer instead of a double.  Likewise for the corresponding
declaration of _jsonHandleNumber in osrf_json_utils.h.

5. In osrf_json_parser.c: I construct a JSON_NUMBER from the input
character string without passing it through a double.  If the input
character string is not valid according to JSON rules, I try to use
the new jsonScrubNumber() to normalize the formatting so that JSON
can accept it.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1199 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoremoved assumption that settings values would be numbers. cleaned up the code some...
erickson [Thu, 3 Jan 2008 22:28:52 +0000 (22:28 +0000)]
removed assumption that settings values would be numbers.  cleaned up the code some to make it more readable

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1198 9efc2488-bf62-4759-914b-345cdb29e865

16 years agochanged str to msg to prevent clobbering. changed repr call to unicode, which seems...
erickson [Wed, 2 Jan 2008 18:53:30 +0000 (18:53 +0000)]
changed str to msg to prevent clobbering.  changed repr call to unicode, which seems more appropriate for human-readable error message

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1197 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Tue, 1 Jan 2008 02:00:38 +0000 (02:00 +0000)]
Patch from Scott McKellar:

1. Makes sure that all members of OsrfChatServer and OsrfChatNode are
explicitly initialized;

2. Plugs several actual or potential memory leaks.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1196 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Tue, 1 Jan 2008 01:56:28 +0000 (01:56 +0000)]
Patch from Scott McKellar:

1. Plugs a memory leak in file_to_string().  If we failed to open the
file, we were returning without freeing the growing_buffer that held
the file name.

2. Replaces a couple of calls to buffer_data() with calls to
buffer_release().

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1195 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Tue, 1 Jan 2008 01:52:44 +0000 (01:52 +0000)]
Patch from Scott McKellar:

1. Added the const qualifier in various places.

2. Eliminated some unnecessary calls to strlen(), where they were
used merely to determine whether a string was empty.

3. Ensured that all members of a new transport_message are
explicitly populated.

4. Plugged a memory leak in the case where strdup() fails.

5. Eliminated some unhelpful casts of malloc'd pointers.

6. Added some protective tests for NULL pointer parameters.

7. In several spots I replaced numeric literals with character
literals, both to make the code more readable and to avoid a needless
dependence on ASCII.

8. Rewrote the jid_get_resource function to avoid repeatedly
overwriting the same buffer.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1194 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar; use camelCase instead of under_score function names
miker [Tue, 1 Jan 2008 01:42:22 +0000 (01:42 +0000)]
Patch from Scott McKellar; use camelCase instead of under_score function names

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1193 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar; use camelCase instead of under_score function names
miker [Tue, 1 Jan 2008 01:41:31 +0000 (01:41 +0000)]
Patch from Scott McKellar; use camelCase instead of under_score function names

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1192 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar; use camelCase instead of under_score function names
miker [Tue, 1 Jan 2008 01:40:30 +0000 (01:40 +0000)]
Patch from Scott McKellar; use camelCase instead of under_score function names

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1191 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar; use camelCase instead of under_score function names
miker [Tue, 1 Jan 2008 01:38:58 +0000 (01:38 +0000)]
Patch from Scott McKellar; use camelCase instead of under_score function names

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1190 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar; use camelCase instead of under_score function names
miker [Tue, 1 Jan 2008 01:37:39 +0000 (01:37 +0000)]
Patch from Scott McKellar; use camelCase instead of under_score function names

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1189 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar which adds some const-correctness.
miker [Tue, 1 Jan 2008 01:34:54 +0000 (01:34 +0000)]
Patch from Scott McKellar which adds some const-correctness.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1188 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded a static method to see if there is already a globally connected cache client
erickson [Thu, 27 Dec 2007 21:40:04 +0000 (21:40 +0000)]
added a static method to see if there is already a globally connected cache client

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1187 9efc2488-bf62-4759-914b-345cdb29e865

16 years agorepaired stderr call
erickson [Thu, 27 Dec 2007 21:05:52 +0000 (21:05 +0000)]
repaired stderr call

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1186 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoforcing int-ness on timeout value
erickson [Thu, 27 Dec 2007 19:37:55 +0000 (19:37 +0000)]
forcing int-ness on timeout value

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1185 9efc2488-bf62-4759-914b-345cdb29e865

16 years agochanged osrf python version from 1.2. to 1.0 to match opensrf
erickson [Wed, 26 Dec 2007 14:25:29 +0000 (14:25 +0000)]
changed osrf python version from 1.2. to 1.0 to match opensrf

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1184 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoUse distutils to install Python into the standard location
dbs [Sun, 23 Dec 2007 02:31:38 +0000 (02:31 +0000)]
Use distutils to install Python into the standard location
Correct a syntax error in http_translator.py

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1183 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded a flag to encode/decode flattened data as json
erickson [Fri, 21 Dec 2007 13:34:51 +0000 (13:34 +0000)]
added a flag to encode/decode flattened data as json

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1182 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded a multisession class for agregating requets into a single recv manager
erickson [Thu, 20 Dec 2007 15:53:54 +0000 (15:53 +0000)]
added a multisession class for agregating requets into a single recv manager

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1181 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded an xml flattener similar to the java xml flattener
erickson [Thu, 20 Dec 2007 14:13:29 +0000 (14:13 +0000)]
added an xml flattener similar to the java xml flattener

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1180 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded internal log level. added some crucial log lines. logging thread id
erickson [Sun, 16 Dec 2007 21:33:10 +0000 (21:33 +0000)]
added internal log level.  added some crucial log lines.  logging thread id

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1179 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoContinue the march towards a pedantic 1.0 python API.
dbs [Sun, 16 Dec 2007 21:06:49 +0000 (21:06 +0000)]
Continue the march towards a pedantic 1.0 python API.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1178 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded iscomplete method
erickson [Sun, 16 Dec 2007 20:01:10 +0000 (20:01 +0000)]
added iscomplete method

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1177 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoparsing logfile settings and initing logger
erickson [Sun, 16 Dec 2007 20:00:28 +0000 (20:00 +0000)]
parsing logfile settings and initing logger

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1176 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoAdd rudimentary locale support to srfsh.py
dbs [Sun, 16 Dec 2007 19:58:38 +0000 (19:58 +0000)]
Add rudimentary locale support to srfsh.py

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1175 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadding a basic mutlisession manager
erickson [Sun, 16 Dec 2007 19:55:41 +0000 (19:55 +0000)]
adding a basic mutlisession manager

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1174 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoAdd some basic locale support.
dbs [Sun, 16 Dec 2007 19:00:32 +0000 (19:00 +0000)]
Add some basic locale support.
Revert a dailyWTF that caused massive CPU & memory consumption.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1173 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoFurther pedanticize logging method names.
dbs [Sun, 16 Dec 2007 16:37:11 +0000 (16:37 +0000)]
Further pedanticize logging method names.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1172 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoMove towards Pythonic API style conventions (as informed by pylint)
dbs [Sun, 16 Dec 2007 16:20:41 +0000 (16:20 +0000)]
Move towards Pythonic API style conventions (as informed by pylint)

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1171 9efc2488-bf62-4759-914b-345cdb29e865

16 years agocreated a simplified XSL processing class with test
erickson [Sun, 16 Dec 2007 16:19:27 +0000 (16:19 +0000)]
created a simplified XSL processing class with test

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1170 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoxml.py conflicts with other xml module namespace (boo). Renaming.
dbs [Sun, 16 Dec 2007 05:59:19 +0000 (05:59 +0000)]
xml.py conflicts with other xml module namespace (boo). Renaming.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1169 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoThis file will hold only OpenSRF XML functions.
dbs [Sun, 16 Dec 2007 04:42:25 +0000 (04:42 +0000)]
This file will hold only OpenSRF XML functions.
osrfObjectFindPath will be moved to the net_obj module.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1168 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadding a generic xml flattening utility with test
erickson [Fri, 14 Dec 2007 19:01:12 +0000 (19:01 +0000)]
adding a generic xml flattening utility with test

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1167 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar to allow E as well as e for scientific notation
miker [Wed, 12 Dec 2007 02:35:36 +0000 (02:35 +0000)]
Patch from Scott McKellar to allow E as well as e for scientific notation

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1166 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar to correct some problems with _jsonParserError(),
miker [Tue, 11 Dec 2007 12:33:57 +0000 (12:33 +0000)]
Patch from Scott McKellar to correct some problems with _jsonParserError(),
which constructs and issues a message about a parsing error:

The problems arise in the course of extracting a fragment of JSON text to
provide the context of the error.

1. The code starts by picking the beginning and end of the fragment to
extract.  In order to avoid beginning before the start of the string,
the original code goes through a loop, incrementing an index until it
is non-negative.  A similar loop corrects for an ending beyond the
end of the string.

These loops do the job, but to my eyes they look silly.  I replaced
them by assigning the corrected values directly, when corrections
are in order.

2. There is an off-by-two error in calculating the size of the buffer
needed to hold the fragment.  To begin with, we miscalculate the
length of the fragment.  If the fragment extends from character 30
through character 40, there are 11 characters in the fragment, not
10.  Then we neglect to add another byte for a terminal nul.

The result is that the last two characters in the intended fragment
are not displayed.  If the character in error is the last or the
next to last character in the string, it doesn't get displayed as
part of the fragment, leading to likely bafflement.

I corrected both these errors, embiggening the buffer by two.

3. The original code copies the fragment into the buffer by calling
snprintf().  Besides being needlessly inefficient, snprintf() is
dangerous in this context.  If the copied fragment contains a
format specifier such as "%s" or "%d", sprintf goes off looking for
a non-existent parameter, resulting in a mangled message or worse.

I replaced the snprintf() with a memcpy() and a terminal nul.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1165 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar to speed up parts of the growing_buffer API; return values...
miker [Mon, 10 Dec 2007 02:35:36 +0000 (02:35 +0000)]
Patch from Scott McKellar to speed up parts of the growing_buffer API; return values from buffer add/reset API brought into a consistent state for proper return value checks

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1164 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar to clean up const-iness and simplify the parser internals
miker [Sun, 9 Dec 2007 15:13:50 +0000 (15:13 +0000)]
Patch from Scott McKellar to clean up const-iness and simplify the parser internals

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1163 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoarg ... add tracking in both "new" functions
miker [Sat, 8 Dec 2007 19:31:57 +0000 (19:31 +0000)]
arg ... add tracking in both "new" functions

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1162 9efc2488-bf62-4759-914b-345cdb29e865

16 years agotracking actual list length based on adds and uses
miker [Sat, 8 Dec 2007 19:29:09 +0000 (19:29 +0000)]
tracking actual list length based on adds and uses

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1161 9efc2488-bf62-4759-914b-345cdb29e865

16 years agotrack malloc()-created objects
miker [Sat, 8 Dec 2007 19:09:57 +0000 (19:09 +0000)]
track malloc()-created objects

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1160 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar which adds a free-object-pool for jsonObjects, reducing...
miker [Sat, 8 Dec 2007 19:03:52 +0000 (19:03 +0000)]
Patch from Scott McKellar which adds a free-object-pool for jsonObjects, reducing malloc/free overhead by a large degree

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1159 9efc2488-bf62-4759-914b-345cdb29e865

16 years agocreated external script for downloading java dependencies. added new install.conf...
erickson [Fri, 7 Dec 2007 19:58:27 +0000 (19:58 +0000)]
created external script for downloading java dependencies.  added new install.conf settings for where dependency jars are kept and whether or not to build the java libs

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1158 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoMinor code cleanup:
dbs [Fri, 7 Dec 2007 05:00:55 +0000 (05:00 +0000)]
Minor code cleanup:
Avoid stepping on str's toes by renaming the variable 'str' to string.
Explicitly call osrf.json and str methods rather than polluting global name space.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1157 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoAdded support for "migratable" opensrf services.
erickson [Wed, 5 Dec 2007 14:44:54 +0000 (14:44 +0000)]
Added support for "migratable" opensrf services.

See http://list.georgialibraries.org/pipermail/open-ils-dev/2007-October/001904.html

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1156 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoreturning if config is not defined since next line of code tries to use config
erickson [Wed, 5 Dec 2007 14:38:16 +0000 (14:38 +0000)]
returning if config is not defined since next line of code tries to use config

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1155 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoremoved unnecessary log line
erickson [Fri, 30 Nov 2007 16:28:39 +0000 (16:28 +0000)]
removed unnecessary log line

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1154 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoparsing requests so the translator can return OK and stop waiting on DISCONNECT messa...
erickson [Fri, 30 Nov 2007 16:27:28 +0000 (16:27 +0000)]
parsing requests so the translator can return OK and stop waiting on DISCONNECT messages.  added some debug logging.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1153 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoremoving confusing dead code
miker [Fri, 30 Nov 2007 02:48:23 +0000 (02:48 +0000)]
removing confusing dead code

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1152 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded cache delete. updated some logging
erickson [Thu, 29 Nov 2007 16:43:02 +0000 (16:43 +0000)]
added cache delete.  updated some logging

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1151 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded the proof-of-concept http multipart translation code. still needs request...
erickson [Thu, 29 Nov 2007 16:42:04 +0000 (16:42 +0000)]
added the proof-of-concept http multipart translation code.  still needs request parsing to handle client disconnect messages and more testing with non-multipart

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1150 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded a default timeout cache setting
erickson [Tue, 27 Nov 2007 22:39:45 +0000 (22:39 +0000)]
added a default timeout cache setting

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1149 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadding a caching api. requires memcache: ftp://ftp.tummy.com/pub/python-memcached/
erickson [Tue, 27 Nov 2007 20:07:36 +0000 (20:07 +0000)]
adding a caching api.  requires memcache: ftp://ftp.tummy.com/pub/python-memcached/

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1148 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded error message. re-tabbed to 4 spaces
erickson [Mon, 26 Nov 2007 22:35:42 +0000 (22:35 +0000)]
added error message. re-tabbed to 4 spaces

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1147 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoremoved debug statement
erickson [Mon, 26 Nov 2007 22:35:03 +0000 (22:35 +0000)]
removed debug statement

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1146 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoin addition to pushing the received message to the callback, we return the message...
erickson [Mon, 26 Nov 2007 22:27:50 +0000 (22:27 +0000)]
in addition to pushing the received message to the callback, we return the message from recv()

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1145 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoPatch from Scott McKellar:
miker [Mon, 26 Nov 2007 18:20:40 +0000 (18:20 +0000)]
Patch from Scott McKellar:

1. Shift toward a camel case style of identifiers.

2. Make functions static when they are not called from elsewhere.

3. Populate all members in newly-allocated structs.

4. Add a couple of consts.

Details:

1. We have two redundant typdefs. I replaced all references to the
lower_case_with_underscores version with references to the camelCase
versions (while keeping the obsolescent typedefs themselves):

   osrf_app_request ==> osrfAppRequest
   osrf_app_session ==> osrfAppSession

2. I deleted the prototypes of two functions that are nowhere
referenced or even defined:

   _osrf_app_session_get_request()
   _osrf_app_session_push_request()

3. I eliminated osrf_app_session_make_locale_req(), replacing it
with the equivalent osrfAppSessionMakeLocaleRequest function.  No
other file references the former.

4. I made the following functions static, and removed their
prototypes from the header, since none is referenced from any other
file:

   osrfAppSessionMakeLocaleRequest()
   osrfAppSessionSendBatch()
   all remaining functions with a leading underscore

5. I explicitly initialized the stateless and session_locale members
of osrfAppSession.

6. I added the const qualifier to a couple of parameters of
osrfAppSessionStatus().

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1144 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoremoving out-of-date jabber2d patches
erickson [Mon, 26 Nov 2007 15:13:01 +0000 (15:13 +0000)]
removing out-of-date jabber2d patches

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1143 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoadded ability to parse attributes and elements containing no children or data to...
erickson [Mon, 26 Nov 2007 13:33:10 +0000 (13:33 +0000)]
added ability to parse attributes and elements containing no children or data to the xml2object parser

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1142 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoreplaced str() calls with unicode()
erickson [Wed, 21 Nov 2007 22:01:42 +0000 (22:01 +0000)]
replaced str() calls with unicode()

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1141 9efc2488-bf62-4759-914b-345cdb29e865

16 years agorepaired variable name
erickson [Wed, 21 Nov 2007 20:48:50 +0000 (20:48 +0000)]
repaired variable name

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1140 9efc2488-bf62-4759-914b-345cdb29e865

16 years agoremoving some debug logging
miker [Tue, 20 Nov 2007 21:43:12 +0000 (21:43 +0000)]
removing some debug logging

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1139 9efc2488-bf62-4759-914b-345cdb29e865

16 years agopropogate locale from server to client
miker [Tue, 20 Nov 2007 20:22:22 +0000 (20:22 +0000)]
propogate locale from server to client

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1138 9efc2488-bf62-4759-914b-345cdb29e865

16 years agothinko, sorry
miker [Tue, 20 Nov 2007 20:04:28 +0000 (20:04 +0000)]
thinko, sorry

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1137 9efc2488-bf62-4759-914b-345cdb29e865