scottmk [Thu, 8 Jan 2009 20:44:50 +0000 (20:44 +0000)]
Prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1599
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 20:18:33 +0000 (20:18 +0000)]
Rename macro for compilation guard, to avoid conflict with
osrf_hash.h. Prepare for #inclusion in C++.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1598
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 19:01:30 +0000 (19:01 +0000)]
Move nested headers into complation guard;
prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1597
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 18:48:29 +0000 (18:48 +0000)]
Move nested headers into complation guard;
prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1596
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 18:29:33 +0000 (18:29 +0000)]
Move nested headers into complation guard;
prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1595
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 18:23:42 +0000 (18:23 +0000)]
Move nested headers into complation guard;
prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1594
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 18:16:32 +0000 (18:16 +0000)]
Move nested headers into complation guard;
prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1593
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 17:44:05 +0000 (17:44 +0000)]
Move nested headers into complation guard;
prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1592
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 17:27:49 +0000 (17:27 +0000)]
Move nested headers into complation guard;
prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1591
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 17:13:58 +0000 (17:13 +0000)]
Rename macro for compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1590
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 16:56:16 +0000 (16:56 +0000)]
Rename macro for compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1589
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 16:47:01 +0000 (16:47 +0000)]
Rename the macro for compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1588
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 16:31:05 +0000 (16:31 +0000)]
Rename macro for compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1587
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 16:18:01 +0000 (16:18 +0000)]
Rename macro for compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1586
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 15:58:01 +0000 (15:58 +0000)]
Add compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1585
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 15:50:56 +0000 (15:50 +0000)]
Add compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1584
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 15:37:04 +0000 (15:37 +0000)]
Add compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1583
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 15:28:32 +0000 (15:28 +0000)]
Add compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1582
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 15:04:58 +0000 (15:04 +0000)]
Add compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1581
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 14:50:18 +0000 (14:50 +0000)]
Add compilation guard; prepare for #inclusion in C++
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1580
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Thu, 8 Jan 2009 05:38:30 +0000 (05:38 +0000)]
Prepare for #inclusion in C++ programs
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1579
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Wed, 7 Jan 2009 18:28:53 +0000 (18:28 +0000)]
Rewrote the OSRF_MALLOC macro so that it evaluates each
of its arguments only once.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1578
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Wed, 7 Jan 2009 17:40:26 +0000 (17:40 +0000)]
Oops, missed one last instance of osrf_app_session_connect().
Replacing with osrfAppSessionConnect().
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1577
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Wed, 7 Jan 2009 17:34:01 +0000 (17:34 +0000)]
Eliminate the old obsolete function osrf_app_session_connect(), which has
now been completely replaced by the equivalent osrfAppSessionConnect().
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1576
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Wed, 7 Jan 2009 17:20:59 +0000 (17:20 +0000)]
Eliminated the obsolete function osrf_message_free(), which is now
completely replaced by the equivalent osrfMessageFree().
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1575
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Wed, 7 Jan 2009 16:27:06 +0000 (16:27 +0000)]
Eliminated four dead functions that are never called
except by each other:
json_parse_file()
jsonParseFile()
legacy_jsonParseFile()
file_to_string()
The files affected:
utils.h
utils.c
osrf_json.h
osrf_json_tools.c
osrf_legacy_json.h
osrf_legacy_json.c
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1574
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Tue, 6 Jan 2009 20:55:03 +0000 (20:55 +0000)]
1. Make the functions reset_session_buffers() and grab_incoming()
static, since no other source file references them by name.
2. Delete various fragments of dead, obsolete, commented-out code.
3. In init_transport: delete the cleanup code after failure
of previous calls to buffer_init(). It's unreachable, since
buffer_init() can never return NULL.
4. Change transport_session.c so that it uses buffer_add_n()
instead of passing data through an intermediate buffer.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1573
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Tue, 6 Jan 2009 16:01:41 +0000 (16:01 +0000)]
Tinkering with macros.
1. In OSRF_BUFFER_ADD, OSRF_BUFFER_ADD_CHAR, and OSRF_BUFFER_RESET:
eliminated multiple evaluations of macro arguments.
2. In OSRF_BUFFER_ADD: renamed local variable __tl to _tl, since
identifiers beginning with two underscores are reserved.
3. In OSRF_BUFFER_RESET: applied the do/while(0) trick so that the
macro will be work as intended when subject to an "if".
4. Added new macro OSRF_BUFFER_C_STR to return a const pointer to
the internal buffer of a growing_buffer. This new macro will enable
safe and direct access to the buffer contents without violating
encapsulation and without incurring a malloc and free.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1572
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Mon, 5 Jan 2009 17:50:15 +0000 (17:50 +0000)]
This update boosts the performance of the jsonFormatString function.
1. Replaced the old _tabs function, which required the construction and
destruction of a growing_buffer, with a new append_indentation function,
which adds white space to an existing growing_buffer. This change
eliminates a passel of mallocs and frees.
2. Removed the call to strlen() from the loop condition.
3. Replaced calls to buffer_fadd(), a fairly slow function, with calls
to OSRF_BUFFER_ADD_CHAR() and append_indentation(). Also: replaced a
call to buffer_add_char with the corresponding macro.
4. Eliminated a harmless but wasteful bug that sometimes added
indentation to the end of a line.
In my benchmarking, using a moderately complex JSON string 201
characters long, the new version was seven times as fast as the old.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1571
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Mon, 5 Jan 2009 17:36:42 +0000 (17:36 +0000)]
This update restructures the mechanism for queueing incoming transport
messages. In addition, the update to transport_client.c rearranges the
logic a bit in client_recv().
1. A transport_message now carries a pointer to be used in a linked list.
It is initialized to NULL when the message is created. We no longer use
a separately allocated list node to carry the message.
2. The queue of transport_messages no longer starts with a dummy node.
3. Instead of finding the tail of the queue by traversing the list from
the head, we maintain a separate pointer to the tail node. Thus the
enqueuing operation occurs in constant time instead of linear time.
4. In client_recv: we now have the dequeueing code in a single place,
instead of duplicating it.
5. In client_recv: I eliminated some conditional compilation that made
no real difference, since both branches of the #ifdef were effectively
identical.
6. In client_recv: changed both loops from while loops to do-while
loops, since in each case we want to perform at least one iteration.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1570
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Mon, 5 Jan 2009 17:05:45 +0000 (17:05 +0000)]
1. In osrf_stack_transport_handler(): removed the memset() as
pointless.
2. Also in osrf_stack_transport_handler(), in the loop traversing
arr[]: changed the loop condition from "i != num_msgs" to
"i < num_msgs", for hygienic reasons.
3. Eliminated osrf_stack_message_handler(). The first half of it moved
into its caller. The second half moved into the two callees
_do_client() and _do_server(). This refactoring made it easier to
eliminate a memory leak where _do_server() was failing to free the
input osrfMessage. I also eliminated a bug whereby we potentially
tried to access a member of a freed osrfMessage.
4. osrf_stack_application_handler() now returns void instead of int,
since we were ignoring the return value anyway.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1569
9efc2488-bf62-4759-914b-
345cdb29e865
scottmk [Mon, 5 Jan 2009 14:27:39 +0000 (14:27 +0000)]
Add a new function buffer_add_n(), and the corresponding
function-like macro OSRF_BUFFER_ADD_N.
These facilities append a specified number of characters from
an input string to a growing_buffer. They are intended for
situations where the length of the input string is already known,
or where the input string is not nul-terminated in the right
place.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1568
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Tue, 30 Dec 2008 19:22:07 +0000 (19:22 +0000)]
multidomain is required. no use for a static list of allowed services. removed support
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1567
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Mon, 22 Dec 2008 20:43:56 +0000 (20:43 +0000)]
Sync up README with rel_1_0 - cover multidomain configuration
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1565
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Mon, 22 Dec 2008 20:43:15 +0000 (20:43 +0000)]
Sync up the sample bootstrap conf from rel_1_0 - more explicit public vs. private
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1564
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Mon, 22 Dec 2008 20:27:27 +0000 (20:27 +0000)]
handle the case where only one service is registered for a given router
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1561
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Mon, 22 Dec 2008 19:13:45 +0000 (19:13 +0000)]
we neeed to keep router_name so that opensrf clients will know what router_name to use
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1559
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Mon, 22 Dec 2008 16:12:39 +0000 (16:12 +0000)]
running in no-router/single-service mode was checking a config value that is not required to exist. if we still want to support running in no-router mode, let's make it an explicit confuration option
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1557
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Sat, 20 Dec 2008 00:19:30 +0000 (00:19 +0000)]
Broader search'n'replace for LOCALSTATEDIR
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1552
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Fri, 19 Dec 2008 22:52:17 +0000 (22:52 +0000)]
updated to use multidomain by default
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1550
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Fri, 19 Dec 2008 22:19:50 +0000 (22:19 +0000)]
Update README to cover new Makefile.install targets, as well as optional
language support at ./configure time.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1548
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Fri, 19 Dec 2008 21:55:28 +0000 (21:55 +0000)]
libgcrypt-dev and libgdbm-dev are dependencies for XML::LibXSLT
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1546
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Fri, 19 Dec 2008 21:22:29 +0000 (21:22 +0000)]
Cover the developer case for bootstrapping the source
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1545
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Thu, 18 Dec 2008 21:22:23 +0000 (21:22 +0000)]
if we are only connecting, we are still connecting. same with disconnect
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1542
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Thu, 18 Dec 2008 20:49:09 +0000 (20:49 +0000)]
wrap the top case statement in brackets... i guess the macros are confusing things...
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1540
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Thu, 18 Dec 2008 20:17:57 +0000 (20:17 +0000)]
correctly capture the JID of the backend server process for the session cache. only create a session cache if there is a CONNECT message in the batch. be more aggressive about removing session caches
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1539
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Thu, 18 Dec 2008 18:51:14 +0000 (18:51 +0000)]
clear remote id on connec as well
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1537
9efc2488-bf62-4759-914b-
345cdb29e865
sboyette [Thu, 18 Dec 2008 16:56:32 +0000 (16:56 +0000)]
OpenSRF.pm version changes
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1536
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Thu, 18 Dec 2008 14:16:12 +0000 (14:16 +0000)]
clear remote ID on subsequent non-conntected requests and on disconnect
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1534
9efc2488-bf62-4759-914b-
345cdb29e865
miker [Thu, 18 Dec 2008 04:15:35 +0000 (04:15 +0000)]
typo; this fix will precipitate a new release to support connected sessions through the translator
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1533
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Thu, 18 Dec 2008 03:21:02 +0000 (03:21 +0000)]
protect against "null" locale
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1531
9efc2488-bf62-4759-914b-
345cdb29e865
miker [Thu, 18 Dec 2008 03:15:14 +0000 (03:15 +0000)]
force default locale on all messages
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1530
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Mon, 15 Dec 2008 21:42:50 +0000 (21:42 +0000)]
slight re-org of unknown client handling
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1529
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Mon, 15 Dec 2008 21:30:54 +0000 (21:30 +0000)]
protect against unknown clients, except when running in migratable mode
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1528
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Tue, 9 Dec 2008 00:46:52 +0000 (00:46 +0000)]
add support for encoding boolean types to JSON
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1526
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Sun, 7 Dec 2008 21:04:50 +0000 (21:04 +0000)]
Use an explicit shell (bash) to avoid complications on systems with different default shells
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1525
9efc2488-bf62-4759-914b-
345cdb29e865
miker [Sat, 6 Dec 2008 20:37:34 +0000 (20:37 +0000)]
Patch from Scott McKellar:
1. Corrected a few minor typos in the header.
2. Made the client_message_handler function static, since no other source
file references it by name.
3. Moved several things from the header to the implementation file, of
which all are internal details not referenced elsewhere:
-- The macros MESSAGE_LIST_HEAD and MESSAGE_LIST_ITEM
-- The declaration for struct message_list_struct, along with the
associated typedefs
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1524
9efc2488-bf62-4759-914b-
345cdb29e865
miker [Sat, 6 Dec 2008 02:28:54 +0000 (02:28 +0000)]
Patch from Scott McKellar:
These patches eliminate several deprecated identifiers in favor of their
camel case equivalents. All these identifiers have already been
eliminated from elsewhere in the source tree:
string_array ==> osrfStringArray
init_string_array ==> osrfNewStringArray
string_array_add ==> osrfStringArrayAdd
string_array_get_string ==> osrfStringArrayGetString
string_array_destroy ==> osrfStringArrayFree
With these patches I complete my pet project of eliminating redundant and
deprecated identifiers (unless of course I discover others that I hadn't
noticed before).
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1523
9efc2488-bf62-4759-914b-
345cdb29e865
miker [Sat, 6 Dec 2008 02:24:53 +0000 (02:24 +0000)]
Patch from Scott McKellar:
This patch eliminates the deprecated typedef osrf_message, replacing it
with the camel case equivalent osrfMessage. All other occurrences have
slready been eliminated from the source tree.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1522
9efc2488-bf62-4759-914b-
345cdb29e865
miker [Fri, 5 Dec 2008 20:02:35 +0000 (20:02 +0000)]
Patch from Scott McKellar:
1. Move the declaration of osrf_app_request_struct, and its typedef as
osrfAppRequest, out of the header and into osrf_app_session.c.
2. In the declaration of osrf_app_session_struct: remove an obsolete
and commented-out declaration of request_queue.
3. Abolished _osrf_app_session_free(), moving its contents into
osrfAppSessionFree().
4. In osrfAppSessionCleanup(): after freeing the cache, nullify the
pointer to it, in the interests of good hygiene.
5. In _osrf_app_request_free(): free the messages in the result queue.
6. In _osrf_app_request_recv(): Eliminated the useless intermediate
variables tmp_msg used for dequeuing messages.
7. In osrf_app_session_set_locale: If the existing session_locale is
big enough to hold the new locale, use strcpy() instead of free() and
strdup().
8. In osrf_app_session_set_remote: If the existing remote_id is big
enough to hold the new remote_id, use strcpy() instead of free() and
strdup().
9. To eliminate some duplication of code, call
osrf_app_session_set_locale() amd osrf_app_session_set_remote() in
_osrf_app_request_recv() and osrf_app_session_reset_remote(),
respectively.
10. Performance tweak: in osrfAppRequestRespondComplete: don't create
the payload message unless we're actually going to use it.
11. Make osrfAppSessionCache static, since no other source file
references it.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1521
9efc2488-bf62-4759-914b-
345cdb29e865
miker [Fri, 5 Dec 2008 19:32:28 +0000 (19:32 +0000)]
Patch from Scott McKellar:
I stumbled across another redundant and deprecated identifier. This
patch replaces osrf_app_session_connect with osrfAppSessionConnect.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1520
9efc2488-bf62-4759-914b-
345cdb29e865
miker [Fri, 5 Dec 2008 19:29:27 +0000 (19:29 +0000)]
Patch from Scott McKellar:
-- Adds a new macro buffer_length to return the n_used member of a
growing buffer.
-- Changed buffer_chomp() to return the character removed instead of
the new string length.
-- Removed the newly obsolete buffer_append_uescape function.
-- In utils.c: removed a commented-out version of the
OSRF_BUFFER_ADD_CHAR macro, which has long resided in utils.h.
-- In the OSRF_BUFFER_ADD macro: replaced strcat() with strcpy(), as
I had done earlier in the corresponding function buffer_add().
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1519
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Thu, 4 Dec 2008 17:59:07 +0000 (17:59 +0000)]
wlayton found a bad search and replace for ibex -> intrepid - thanks!
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1518
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Thu, 4 Dec 2008 02:40:32 +0000 (02:40 +0000)]
It's so alluring to install packages instead of compiling from source, except when the packaged versions are broken in crucial ways. Argh.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1517
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Sun, 30 Nov 2008 05:30:44 +0000 (05:30 +0000)]
Merge patch from Scott McKellar for better Unicode handling
The attached files contain a drop-in replacement for the
buffer_append_uescape function that I submitted a few days ago. I regard
this new one as experimental, at least for now.
They also offer some byte-testing functions, and the equivalent macros,
that may be useful in other code that deals with UTF-8 strings.
The new function buffer_append_utf8() differs from buffer_append_uescape()
in the following ways:
1. It treats 0xF7 as a control character, which it is.
2. It is more finicky about recognizing the header byte of multibyte
characters. For example 0xF6 is not a valid UTF-8 header byte.
3. When it sees a nul byte in the middle of a multibyte character, it
stops. In the same situation, the older buffer_append_uescape() and
uescape() functions accumulate the nul byte into the hex codes they
build and then keep going, risking not only misbehavior but undefined
behavior.
4. When it finds invalid UTF-8 characters in the input string, it skips
over the invalid UTF-8 until it finds a valid character, and then
continues to translate the rest. In other words it excises the garbage
and translates the rest intact.
---------
The file osrf_utf8.c includes an array of bitmasks that it uses to look
up the characteristics of each byte. Not trusting myself to do that
much tedious typing by hand, I wrote a program to write the list of
bitmasks. The macros are broadly similar to the standard C functions
isprint(), isalpha(), and so forth.
There is also a collection of functions, equivalent to the macros, with
the same names except using double underscores. These may never find a
use, but they're there in case anyone ever needs a function pointer for
some reason.
The logic uses a finite state machine (FSM) to examine and dispatch each
byte in the input stream. Because it needs to branch on the current
state as well as the type of each character, this logic is a little
slower than buffer_append_uescape(). However pretty much any
implementation of the same behavior would probably incur some such extra
overhead in some form.
-------------
(Regarding the second version of osrf_utf8.c):
When it encounters a code point too big to fit into 16 bits (after
stripping out the packaging bits), it formats it into a surrogate pair
of four hex digits each, rather than a single set of five or six hex
digits.
In addition, this new version no longer uses buffer_fadd() to format
hex values.
The code for constructing surrogate pairs is a slightly simplified version
of a code snippet found at:
http://www.unicode.org/faq/utf_bom.html
The code snippet seems to come from a pretty authoritative source. and
my modifications were minimal, consisting mostly of collecting a couple
of constant expressions into constant values.
In the case of the G clef character (U+1D11E), I verified that my code
translates it to the correct surrogate pair ("\uD834\uDD1E").
Scott McKellar
http://home.swbell.net/mck9/ct/
Developer's Certificate of Origin 1.1 By making a contribution to
this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license indicated
in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source license
and I have the right under that license to submit that work with
modifications, whether created in whole or in part by me, under the
same open source license (unless I am permitted to submit under a
different license), as indicated in the file; or
(c) The contribution was provided directly to me by some other person
who certified (a), (b) or (c) and I have not modified it; and
(d) In the case of each of (a), (b), or (c), I understand and agree
that this project and the contribution are public and that a record
of the contribution (including all personal information I submit
with it, including my sign-off) is maintained indefinitely and may
be redistributed consistent with this project or the open source
license indicated in the file.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1516
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Sun, 30 Nov 2008 04:37:52 +0000 (04:37 +0000)]
Refer to Intrepid, not Ibex (to be consistent with Gutsy and Hardy)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1515
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Wed, 26 Nov 2008 17:56:42 +0000 (17:56 +0000)]
Two patches from Scott McKellar:
In some earlier patches I eliminated the old osrf_app_client_session_init
function in favor of its camel-case equivalent. Unfortunately I didn't
notice that the new function now puts the old function's name into an
error message. Here's the fix for that little oversight.
---
These patches replace a couple of deprecated identifiers with their
camel-case equivalents:
osrf_message ==> osrfMessage
string_array ==> osrfStringArray
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1514
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Tue, 25 Nov 2008 17:48:31 +0000 (17:48 +0000)]
Let's remove one step from getting OpenSRF running out of the box;
give the persistence database a real default location
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1513
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Tue, 25 Nov 2008 03:21:16 +0000 (03:21 +0000)]
Continue factoring out the Evergreen prerequisites from OpenSRF prereq installer
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1512
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Tue, 25 Nov 2008 03:16:13 +0000 (03:16 +0000)]
Cheap hack to enable OpenSRF to build on recent glibc systems
(already in use in src/libopensrf/osrf_system.c)
Seems to stem from HOST_NAME_MAX moving from /usr/include/sys/param.h
to /usr/include/bits/local_lim.h
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1511
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Tue, 25 Nov 2008 02:47:31 +0000 (02:47 +0000)]
Minor typo fix
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1510
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Sun, 23 Nov 2008 03:50:57 +0000 (03:50 +0000)]
Minor updates for prereq makefile
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1509
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Thu, 20 Nov 2008 21:37:32 +0000 (21:37 +0000)]
in the interest of clearing some log cruft, move two highly repetitive messages from INFO to DEBUG level logging
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1508
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Thu, 20 Nov 2008 01:40:29 +0000 (01:40 +0000)]
Correct syntax for forcing Perl modules
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1503
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Thu, 20 Nov 2008 01:27:16 +0000 (01:27 +0000)]
Force Class::DBI install, as dependencies have started making test t/11 (triggers) fail;
We don't use trigger support in Class::DBI, so forcing the install should be okay.
Also, stop installing the syslog-ng package
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1500
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Thu, 20 Nov 2008 00:37:14 +0000 (00:37 +0000)]
Add notes about CPAN configuration, per wlayton's recommendation
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1499
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Tue, 18 Nov 2008 22:23:29 +0000 (22:23 +0000)]
2 Patches from Scott McKellar, with slight modification:
This patch adds a new function buffer_append_uescape(), a streamlined
replacement for uescape(). The optimizations are as follows:
1. As described in an earlier post, the new function appends the uescaped
text to an existing growing_buffer, rather than into an internal one that
it must create and destroy. It thereby saves two mallocs and two frees.
In addition, the calling code doesn't have to do a buffer_add().
2. Because it doesn't create an internal growing_buffer, it doesn't need
to do a strlen() to determine how big a buffer to allocate.
3. Since the new version doesn't have a boolean parameter, it doesn't have
to test the boolean.
4. For characters < 128 (i.e. ASCII characters), I rearranged the order of
the tests so that non-control characters are recognized immediately. In
uescape() we first go through a switch/case looking for several specific
control characters like '\b' and '\n'. In practice most characters are
not control characters, so this rearrangement saves a few CPU cycles.
5. For control characters, uescape() uses buffer_fadd() to format the
character into hex. Now, buffer_fadd is slow because it uses vsnprintf()
twice, once to determine a buffer size and once to do the formatting. In
turn vsnprintf() is slow because it has to parse the format string. In
this case we don't need vsnprintf() because we already know exactly how
big the buffer needs to be, and the formatting is simple. I eliminated
buffer_fadd() and formatted the hex manually with a little bit-twiddling.
Some of these optimizations could be applied to uescape(), but I haven't
bothered, partly because I wanted a clean comparison for benchmarking
purposes and partly because I expect uescape() to disappear from use
(though I am leaving it available).
=====
This patch is a rewrite of the jsonObjectToJSON and jsonObjectToJSONRaw functions. It is dependent on my previous patch to utils.c and utils.h,
adding the new buffer_append_uescape function.
One purpose is to replace a call to the uescape function with a call to
the faster buffer_append_uescape function. The other purpose is to
introduce a faster way to translate a jsonObject into a string.
(Also in one spot I broke up a very long string literal into several
smaller pieces so that it wouldn't wrap around in the editor.)
In the existing jsonObjectToJSON function, we receive a pointer to a
jsonObject and return a string of JSON. However we don't translate the
original jsonObject directly. Instead, we create a modified clone of the
original, inserting an additional JSON_HASH node wherever we find a
classname. Then we translate the clone, and finally destroy it.
It always struck me as an egregious waste to create and destroy a whole
parallel object just so that we could turn it into a string. So I looked
for a way to eliminate the cloning.
The result is a modification of add_json_to_buffer(), a local function
that recursively traverses and translates the jsonObject. When it sees a
classname (and it has been asked to expand classnames), the new version
inserts additional gibberish into the output text and then continues the
traversal, without modifying or copying the original jsonObject at all.
In my benchmark, this new approach was faster than the original by a
factor of about 5. When I combined this change with the use of the new
buffer_append_uencode function, it was faster by a factor of about 7.2.
The benchmark used a moderately complex jsonObject about 5 or 6 levels
deep, with both hashes and arrays, with classnames at several levels.
The performance gain will no doubt depend on the contents of the
jsonObject,but I haven't tried to isolate the variables.
The new version is a bit trickier and harder to read than the old. In my
opinion the speedup is worth the obscurity, because a lot of places in
Evergreen will benefit.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1498
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Mon, 17 Nov 2008 03:17:50 +0000 (03:17 +0000)]
Patch from Scott McKellar:
This patch is mostly a couple of tweaks to the growing_buffer code, loosely
related to my previous patch to utils.h. There is also a small tweak to
uescape().
1. in buffer_add() I replaced strcat() with strcpy() for appending the new
string. Since we already know where the end of the old string is, we don't
need to ask strcat() to find it for us.
2. In buffer_reset(), the old code contains the following:
osrf_clearbuf( gb->buf, sizeof(gb->buf) );
The evident intent is to clear the buffer. However sizeof(gb->buf) is not
the size of the buffer, it's the size of the pointer to the buffer. We
were clearing only the first four bytes or so. I changed the line to:
osrf_clearbuf( gb->buf, gb->size );
3. Also in buffer_reset(), I added a line to populate the first byte of
the buffer with a nul, to ensure that the length of the (empty) string matches the n_used member.
4. In uescape(), we were examining the contents of string[] without first
verifying that string was not NULL. The result would be undefined
behavior if string were ever NULL. I added a couple of lines to treat
a NULL pointer as if it were a pointer to an empty string.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1496
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Mon, 17 Nov 2008 02:56:40 +0000 (02:56 +0000)]
Patch from Scott McKellar:
This patch fixes a bug in the OSRF_BUFFER_ADD_CHAR macro.
Like the corresponding buffer_add_char function, this macro appends a
specified character to a growing_buffer. Unlike the function, however, the
existing version of the macro does not also append a terminal nul.
This bug had gone unnoticed because, most of the time, the rest of the
buffer is already filled with nuls, left over from the initial creation of
the growing_buffer. I stumbled across the problem when, in the course of
writing a test harness for some other changes, I called buffer_reset()
in order to reuse an existing growing_buffer instead of destroying and
re-creating it.
With debugging turned on, buffer_reset() fills the buffer with exclamation
points, leaving a nul only in the very last byte. Later, if we use
buffer_add() or buffer_fadd() to extend the string stored in the
growing_buffer, it uses strcat() to append the new characters. The result
is a buffer overflow.
Actually buffer_reset() should place a nul in the first byte of the buffer.
Tomorrow I shall submit a patch to that effect.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1494
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Tue, 11 Nov 2008 20:49:52 +0000 (20:49 +0000)]
in trunk, go ahead and run the perl control script with verbose flag on
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1493
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Wed, 5 Nov 2008 20:03:49 +0000 (20:03 +0000)]
dokuwiki-doc-stubber.pl is generated rather than modified in place
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1489
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Tue, 4 Nov 2008 03:02:47 +0000 (03:02 +0000)]
Replace in-place modification with built files; enables one to re-run configure multiple times
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1487
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Mon, 27 Oct 2008 05:07:06 +0000 (05:07 +0000)]
Clean up the source tree a little more:
* Delete setup.py.in (as we're not modifying it)
* Make math_client.py be modified with SYSCONFDIR location per other scripts
(although slightly longer term we'll need to stop modifying all of these
in place, because that doesn't work after the first ./configure run)
* Add a few files to automake's tracking so that make dist is a little happier
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1484
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Mon, 27 Oct 2008 04:31:26 +0000 (04:31 +0000)]
Flesh out README with standalone install instructions
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1483
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Mon, 27 Oct 2008 03:25:12 +0000 (03:25 +0000)]
Add a prerequisite installer for OpenSRF (carved out of the Evergreen installer)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1481
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Sat, 25 Oct 2008 17:29:19 +0000 (17:29 +0000)]
Add a basic Python client example
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1479
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Sat, 25 Oct 2008 17:25:47 +0000 (17:25 +0000)]
Fix build of OpenSRF Python support:
we cannot use a fully-qualified pathname for packages and scripts vars
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1477
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Fri, 24 Oct 2008 16:36:06 +0000 (16:36 +0000)]
disable the new internal logging of sent data by default.
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1475
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Fri, 24 Oct 2008 16:31:07 +0000 (16:31 +0000)]
the pool cleanup handler which was thought to only run on top-level child process exit is running on cloned processes cleanup. this is how mod_cgi runs scripts. disabling cleanup for now. note: this cleanup is new to 1.0
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1474
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Fri, 24 Oct 2008 15:37:35 +0000 (15:37 +0000)]
Libraries are currently built as osrf_math.so and osrf_dbmath.so rather than lib*
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1472
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Fri, 24 Oct 2008 15:07:33 +0000 (15:07 +0000)]
opensrf.settings needs to be stateless for a stock install
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1471
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Fri, 24 Oct 2008 14:42:20 +0000 (14:42 +0000)]
Document the canonical hostname determination method for Linux
(And fix a couple of annoying typos to boot)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1470
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Fri, 24 Oct 2008 14:25:52 +0000 (14:25 +0000)]
Use the standard memcached port in example config
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1469
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Fri, 24 Oct 2008 14:21:44 +0000 (14:21 +0000)]
Minor typo (remove redundant "change this")
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1468
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Sun, 19 Oct 2008 21:21:49 +0000 (21:21 +0000)]
Hey, we need to adjust the system's dynamic library path here
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1466
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Sun, 19 Oct 2008 20:45:42 +0000 (20:45 +0000)]
Correct configure options in install README
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1465
9efc2488-bf62-4759-914b-
345cdb29e865
miker [Fri, 17 Oct 2008 16:44:46 +0000 (16:44 +0000)]
need to copy automake files instead of linking
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1464
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Mon, 13 Oct 2008 20:44:50 +0000 (20:44 +0000)]
io::socket::inet, somewhere between version 1.29 and 1.31, requires the peerport to be explicitly cast to an int. also updated error handling to use correct error var
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1452
9efc2488-bf62-4759-914b-
345cdb29e865
erickson [Fri, 10 Oct 2008 22:16:36 +0000 (22:16 +0000)]
added verbose option to print which services/pids are being stopped/started
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1451
9efc2488-bf62-4759-914b-
345cdb29e865
dbs [Tue, 7 Oct 2008 14:38:29 +0000 (14:38 +0000)]
Make the option help tell the truth
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1450
9efc2488-bf62-4759-914b-
345cdb29e865