]> git.evergreen-ils.org Git - OpenSRF.git/log
15 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

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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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

15 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.


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:


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

   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

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

16 years agoCleaned up exception messages so they will not be bloated with newlines
erickson [Tue, 20 Nov 2007 20:01:13 +0000 (20:01 +0000)]
Cleaned up exception messages so they will not be bloated with newlines
(which are rendered as '\n' in syslog and local apache logs, anyway) and
layers of "Mess:" tags.  Logging the ISO timestamp instead of the default
output of Perl's localtime()

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

16 years agodebug logging
miker [Tue, 20 Nov 2007 20:00:53 +0000 (20:00 +0000)]
debug logging

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

16 years agothinko, sorry
miker [Tue, 20 Nov 2007 19:51:17 +0000 (19:51 +0000)]
thinko, sorry

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

16 years agostill working on the perl locale stuff
miker [Tue, 20 Nov 2007 19:49:03 +0000 (19:49 +0000)]
still working on the perl locale stuff

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

16 years agofor-loop initial declaration issue; realigned some const-ification
miker [Tue, 20 Nov 2007 18:57:16 +0000 (18:57 +0000)]
for-loop initial declaration issue; realigned some const-ification

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

16 years agopushing locale through in the perl
miker [Tue, 20 Nov 2007 18:46:25 +0000 (18:46 +0000)]
pushing locale through in the perl

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

16 years agouber-patch from Scott McKellar cleans up large amounts of const-correctness issues...
miker [Mon, 19 Nov 2007 03:19:09 +0000 (03:19 +0000)]
uber-patch from Scott McKellar cleans up large amounts of const-correctness issues and static-ifies several areas of unused header-based code; several cleanups to use simpler APIs such as buffer_release

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

16 years agoremoved hard-coded reference to python 2.4
erickson [Thu, 15 Nov 2007 16:21:32 +0000 (16:21 +0000)]
removed hard-coded reference to python 2.4

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

16 years agoadded ability to log to a file
erickson [Mon, 12 Nov 2007 22:43:06 +0000 (22:43 +0000)]
added ability to log to a file

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

16 years agochanged imports to be fully qualified
erickson [Sun, 11 Nov 2007 17:42:09 +0000 (17:42 +0000)]
changed imports to be fully qualified

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

16 years agoAnd let's not double-log messages. Sigh.
dbs [Thu, 8 Nov 2007 20:39:18 +0000 (20:39 +0000)]
And let's not double-log messages. Sigh.

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

16 years agoFormat the date and time with leading zeroes to be easy on the eyes, and easier to...
dbs [Thu, 8 Nov 2007 20:36:16 +0000 (20:36 +0000)]
Format the date and time with leading zeroes to be easy on the eyes, and easier to parse.

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

16 years agoCorrect name of prototype for osrf_message_get_last_locale()
dbs [Tue, 6 Nov 2007 22:45:19 +0000 (22:45 +0000)]
Correct name of prototype for osrf_message_get_last_locale()

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

16 years agoEnable srfsh.py to load with the standard .srfsh.xml (no plugins)
dbs [Tue, 6 Nov 2007 19:33:49 +0000 (19:33 +0000)]
Enable srfsh.py to load with the standard .srfsh.xml (no plugins)

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

16 years agomake the perl local support match the C version
miker [Tue, 6 Nov 2007 14:40:08 +0000 (14:40 +0000)]
make the perl local support match the C version

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

16 years agoAvoid an "undefined variable" Perl warning when we receive no parameters.
dbs [Sun, 4 Nov 2007 11:38:50 +0000 (11:38 +0000)]
Avoid an "undefined variable" Perl warning when we receive no parameters.

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

16 years agoConvert a few routine log messages from error to info level.
dbs [Sat, 3 Nov 2007 17:52:29 +0000 (17:52 +0000)]
Convert a few routine log messages from error to info level.

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

16 years agoMake Logger a little more robust by setting a default loglevel
dbs [Tue, 30 Oct 2007 22:26:11 +0000 (22:26 +0000)]
Make Logger a little more robust by setting a default loglevel
and ensuring that we don't try to regex an undefined value.

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

16 years agofixed infinite loop bug by hopping out of the loop if timeout gets down to 0, but...
erickson [Mon, 29 Oct 2007 12:23:31 +0000 (12:23 +0000)]
fixed infinite loop bug by hopping out of the loop if timeout gets down to 0, but the code still allows the the loop to occur once if timeout is initially 0

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

16 years agoPatch from Scott McKellar to provide more const correctness to functions using osrfJS...
miker [Sat, 27 Oct 2007 01:48:03 +0000 (01:48 +0000)]
Patch from Scott McKellar to provide more const correctness to functions using osrfJSON objects

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

16 years agoAdd a top-level javascript-install target
dbs [Thu, 25 Oct 2007 15:50:39 +0000 (15:50 +0000)]
Add a top-level javascript-install target

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

16 years agoPatch from Scott McKellar to increase const correctness in the JSON parser.
miker [Thu, 25 Oct 2007 12:20:16 +0000 (12:20 +0000)]
Patch from Scott McKellar to increase const correctness in the JSON parser.

Also made the top level legacy_jsonParseString[Fmt] API const-correct, though this is removed within those wrapper calls to avoid potentially breaking the legacy code.

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

16 years agoPatch from Scott McKellar to clean up some const qualification and initialize a point...
miker [Thu, 25 Oct 2007 12:04:05 +0000 (12:04 +0000)]
Patch from Scott McKellar to clean up some const qualification and initialize a pointer to NULL.

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

16 years agoadded new constructor to build from class hints
erickson [Tue, 23 Oct 2007 15:36:45 +0000 (15:36 +0000)]
added new constructor to build from class hints

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

16 years agoPatches from Scott McKellar covering:
miker [Fri, 19 Oct 2007 23:43:59 +0000 (23:43 +0000)]
Patches from Scott McKellar covering:

1. Eliminating a const-removing cast from jsonObjectToJSON().  This
cast is no longer necessary now that a recent patch has changed the
signature of jsonObjectEncodeClass().

2. Moving the JSON_INIT_CLEAR macro out of the header file and into
the implementation file.  No other file invokes this macro -- nor
could it, since the macro refers to two static functions within
osrf_json_object.c.  Strictly speaking another file could provide
other functions with the same signatures, but I doubt that any such
usage was ever intended.

3. Adds some sanity checking to prevent undefined behavior when
a floating point payload is not representable as an int.

4. Streamlines the serialization of hashes and arrays by
eliminating a layer of allocation and deallocation.

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

16 years agoDeliberately break applications relying on pre-OpenSRF 1.0 behaviour.
dbs [Thu, 18 Oct 2007 03:08:38 +0000 (03:08 +0000)]
Deliberately break applications relying on pre-OpenSRF 1.0 behaviour.
JSON_v0.js represents "legacy" JSON format, while JSON_v1.js represents "modern" JSON format.

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

16 years agoStart installing the Python libraries as well.
dbs [Thu, 18 Oct 2007 02:38:51 +0000 (02:38 +0000)]
Start installing the Python libraries as well.
Destination directory is named python25 because
Python3000 is just around the corner...

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

16 years agoreturning explicit true/false on data received
erickson [Thu, 18 Oct 2007 02:22:22 +0000 (02:22 +0000)]
returning explicit true/false on data received

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

16 years agoInstall the JavaScript libraries into an OpenSRF library,
dbs [Thu, 18 Oct 2007 01:11:10 +0000 (01:11 +0000)]
Install the JavaScript libraries into an OpenSRF library,
in prepration for OpenSRF applications being able to use
one known good JavaScript library for OpenSRF communication.
(I'm looking at you, EG, and your two copies of JSON.js)

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

16 years agoI'm pretty sure we want $log here, as in all the other calls.
dbs [Tue, 16 Oct 2007 03:58:05 +0000 (03:58 +0000)]
I'm pretty sure we want $log here, as in all the other calls.
Perhaps we can get rid of the $logger import in the header?

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

16 years agoEnable -l flag to work without an argument
dbs [Wed, 10 Oct 2007 21:51:18 +0000 (21:51 +0000)]
Enable -l flag to work without an argument

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

16 years agoMore typos, as I read through logs.
dbs [Wed, 10 Oct 2007 20:58:39 +0000 (20:58 +0000)]
More typos, as I read through logs.

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

16 years agoadding -l for localhost support
miker [Wed, 10 Oct 2007 20:38:14 +0000 (20:38 +0000)]
adding -l for localhost support

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

16 years agoAdd -D_LARGEFILE64_SOURCE flag to CGLAGS to avoid compile problems on 32-bit platforms.
dbs [Wed, 10 Oct 2007 20:10:19 +0000 (20:10 +0000)]
Add -D_LARGEFILE64_SOURCE flag to CGLAGS to avoid compile problems on 32-bit platforms.

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

16 years agoFix some typos found while trying to improve osrf error messages.
dbs [Wed, 10 Oct 2007 18:47:42 +0000 (18:47 +0000)]
Fix some typos found while trying to improve osrf error messages.

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

16 years agoprovide a warning-level default logger if none is defined
erickson [Fri, 5 Oct 2007 20:24:09 +0000 (20:24 +0000)]
provide a warning-level default logger if none is defined

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

16 years agoPatch that:
miker [Mon, 1 Oct 2007 02:47:44 +0000 (02:47 +0000)]
Patch that:

1) Creates safe_calloc, suggested by Scott McKellar which includes
memset, as calloc does.  safe_malloc will eventually lose its call
to memset.

2) Creates a macro in utils.h called osrf_clearbuf which

 * under CLFAGS=-DNDEBUG fills the buffer with !s and a trailing nul
 * otherwise (currently) uses memset to fill with nuls

The secondary behavior should be changed to a no-op after no more
problems arise under NDEBUG mode.  I reversed the suggested semantics
because I'm not ready to completely break trunk.  To break everything
(AKA find where we should be providing a terminal nul) just compile
like this:

 $ CLFAGS=-DNDEBUG make clean all

3) replaces all memsets (excepting the ones in safe_?alloc) that act
on char bufs with said macro, so they can be spotted and improved to
deal with nul terminators where needed.  I didn't touch any memsets on
struct pointers.

4) made jid_get_*() from src/libopensrf/transport_message.c safe for
use with NDEBUG mode.  They were depending on the target buffer that
the caller passes in to be nul-filled (they use strncpy/memcpy which
don't guarantee terminal nul) -- now they provide their own terminal

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

16 years agoBroad patch from Dan Scott to move towards better memory management:
miker [Sun, 30 Sep 2007 19:14:26 +0000 (19:14 +0000)]
Broad patch from Dan Scott to move towards better memory management:

 * bzero->memset (with sizeof) - except when followed immediately by
   snprintf(), in which case the call was deleted completely
 * sprintf->snprintf (with sizeof) - for the C99-guaranteed
   null-terminated string and avoidance of overwrites
 * fgets (with sizeof) - because in at least one case "len - 1" was
   being used for the length, even though fgets is defined to retrieve 1
   byte less than the requested length - so the code was effectively
   retrieving 2 bytes less than the allocated buffer
 * in 2 places in srfsh.c, increased buffer size by 1 to allow for
   null terminator
 * various typo fixes

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

16 years agoPatch from Dan Scott to:
miker [Sun, 30 Sep 2007 18:53:17 +0000 (18:53 +0000)]
Patch from Dan Scott to:

1) fix typos and output alignment
2) include _LARGEFILE64_SOURCE in the makefile to make 32b linux happy

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

16 years agoUse of const-correct osrfObjectGetKeyConst() from Scott McKellar:
miker [Sun, 30 Sep 2007 17:56:45 +0000 (17:56 +0000)]
Use of const-correct osrfObjectGetKeyConst() from Scott McKellar:

1. It replaces jsonObjectGetKey() with jsonObjectGetKeyConst().

2. It uses const pointers, instead of non-const pointers, to capture
the return values of jsonObjectGetIndex() and jsonObjectGetString().

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

16 years agoContinued const-correctness improvement from Scott McKellar:
miker [Sun, 30 Sep 2007 17:54:25 +0000 (17:54 +0000)]
Continued const-correctness improvement from Scott McKellar:

1. I changed the signature of jsonObjectDecodeClass so that it accepts
a non-const pointer parameter.  Since it doesn't change the contents
of the jsonObject, there's no need to confine it to non-const

2. I replaced jsonObjectGetKey() with jsonObjectGetKeyConst().

3. In one spot I captured the return value of jsonObjectGetIndex()
with a const pointer instead of a non-const pointer.

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