config file, context, and cache server now have apache config settings. keeping a static version of the translator on hand to reduce a layer of malloc/free
This script provides per-service control of OpenSRF Perl processes. In other words, you can
stop/start/restart individual services. Note that you can only stop services that have
been started with this script.
TODO
Add start_all, stop_all, and restart_all to manage all host-specific Perl services
Give Apache modules the support they need to work
Push the apxs compile stage into the local install steps as it seems to require root privileges to write during build
Commit autotools patch from Kevin Beswick
(adjusted slightly for Bill's objson API compatibility layer removal)
Enclosed is a patch to update the OpenSRF autotools implementation. It
fixes most bugs such as:
-correctly replacing hardcoded directory paths in various files
-correctly implementing clean, and uninstall make targets
-fixes building src/c-apps modules without the lib prefix
-builds the src/gateway apache modules with apxs
-fixed the naming of the opensrf-c binary
Also, it implements more of the autotools features:
-rolling a tarball with make dist
-enables VPATH (parallel) builds
-checking a distribution with make distcheck
-------------------------------------------
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.
(d) 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(s) involved.
Merge the following patches from Kevin Beswick:
* fixed location to copy apachetools.h from ...
* another typo...
* fixed directory error in copying of header file.
* move one more copy instruction for a header file.
* create the perldir and jsdir
* changed the place where headers are copied... fixed an error which caused them to be copied wrong.
* fixed a capitalization typo issue in src/Makefile.am
* updated opensrf.xml.example to use C math and dbmath implementation rather than Perl
* fixed make distcheck problems -- builddir needed to be changed to srcdir
* fixed directory replacement in .c file problem stopped the command added in the previous revision from running multiple times, fixed the location of the file to execute the command on.
* changed where the directory replacement happens for osrf_json_gateway.c (it was after it was compiled rather than before)
* corrected another error with installing header files ( can't install directories recursively through the 'prefix_PRIMARY = files' apparently)
* went back to old way of copying perlmods and javascript. it will still be included in dist due to EXTRA_DIST in root makefile
* fix install of src/javascript and src/perlmods
* nobase_dist_lib_DATA defined twice... oops!
* fixed problem with order of execution of targets (install-data-local was being executed before files were copied. resulted in an error)
* fixed make dist, and changed ways that files are copied to their installed locations
* fixed path substitution for the rest of the files with hardcoded paths to ensure correct default functionality of opensrf
A little more autotools love:
* Avoid the use of tmp dir by using noinst_ prefix for timejson
* Remove DEF_LDLIBS usage (it enabled compiling, but did not link to the
libraries) and replace with specific LDADD and LIBADD options
dbs [Mon, 30 Jun 2008 19:46:08 +0000 (19:46 +0000)]
Patch from Kevin Beswick (kbeswick00@gmail.com) to address various problems with the autotools:
* src/libopensrf/Makefile.am:
* Fix typo for -I (includes) vs. -L (linking libraries) compile option
* src/Makefile.am:
* Propagate NDEBUG compile flag to all other makefiles
* Create target directories
* Set directories in example config files to match configured options
* configure.ac:
* Set default prefix to /opensrf/ instead of /openils/
* bin/osrf_config.in:
* Add --localstatedir option for osrf_config
* Correct output value for --apxs
* bin/osrf_ctl.sh
* Set default PID dir to localstatedir rather than sysconfdir
* Makefile.am:
* Propagate NDEBUG compile flag to all other makefiles
* Remove explicit rpath option, automake will figure that out for us (supposedly)
* examples/opensrf_core.xml.example, examples/opensrf.xml.example, examples/srfsh.xml.example:
* Set directories in example config files to match configured options
dbs [Wed, 25 Jun 2008 18:50:00 +0000 (18:50 +0000)]
Patch from Kevin Beswick to use autotools for OpenSRF configuration and build
Included is a patch for a working implementation of the GNU Autotools
to OpenSRF. Some of the perks of this system are: the user is given
the ability to install OpenSRF to non-standard locations,
dependency/library checking, gives a user the ability to only install
certain components, more portable to other operating systems, etc.
To test, simply run:
autogen.sh
configure
make
make install
Options for configure can be found using:
./configure --help
Also, the patch contains a new file, osrf_config, which is generated
by running the configure script. Running this file will print all
build options a user has chosen when compiling/installing Opensrf.
Command line arguments can be added to return each single build option
as well. This is useful to developers in that they are able to locate
a certain installation directory on a non-standard installation of
OpenSRF. To see the available command line options, run: osrf_config --help
erickson [Tue, 20 May 2008 19:43:13 +0000 (19:43 +0000)]
added new disconnected exception. added some error condition logging. no longer disconnecting on network handle clear, because parent process may be using the handle.
erickson [Sun, 18 May 2008 23:42:17 +0000 (23:42 +0000)]
No longer globally setting the network recv_callback handler to None
because it clobbers the callbacks of other python clients running
in the same within the same process. Now we capture the existing
callback and replace it after the request has been processed
erickson [Fri, 16 May 2008 12:45:11 +0000 (12:45 +0000)]
Patch from Scott McKellar:
These patches provide a new and more efficient implementation of
osrfHash, using a hash table for random lookups and a doubly linked
list for iterations.
It is more efficient for two main reasons. First, for iterations
it doesn't maintain a separate copy of the keys, that then have to go
through the hashing algorithm. Second, when updating an existing
item, it updates it in place rather than deleting it and creating
a new one.
erickson [Thu, 15 May 2008 20:55:02 +0000 (20:55 +0000)]
Patch from Scott McKellar:
This patch tweaks a few things.
1. In json_parse_json_string() we declare a character array buff[],
fill it with nuls, and never refer to it again. I eliminated it.
2. A few lines below that, we use memset() to clear a three-character
buffer. I replaced the memset() with an initializer clause.
3. in json_handle_error() we were relying on the osrf_clearbuf macro
to add a terminal nul. However the plan is for this macro to become
a no-op someday. I added the nul manually.
erickson [Thu, 15 May 2008 20:46:15 +0000 (20:46 +0000)]
Patch from Scott McKellar:
This patch tweaks the jid_get_* functions, which copy various
fragments of an jabber id into a buffer supplied by the caller.
If these functions don't find the fragments they're looking for, they
now return an empty string in the buffer. Earlier they would leave
the buffer unchanged, leaving it to the calling code to initialize
the buffer.
erickson [Thu, 15 May 2008 13:36:32 +0000 (13:36 +0000)]
Patch from Scott McKellar:
This patch is mostly a performance tweak, but also tidies up a few
things.
In apacheParseParms() we load POST data and GET data into the same
buffer, with the GET data coming first. However the old code loads
the POST data first. If there is also some GET data, we juggle some
buffers in order to get the GET and POST data into the right order.
The new code loads the GET data first, and then appends the POST
data onto it. Besides being simpler, the new code avoids a layer
of copying, as well as and two round trips through malloc() and
free().
Other details:
1. I rearranged the declarations of the variables sarray, buffer,
key, and val, so as to narrow their scope. In the case of sarray
this rearrangement avoids a potential memory leak in the case of an
error exit (where the POST data is excessive).
2. I append a terminal null to the input buffer instead of using
memset() to fill the entire buffer.
3. Since the bread variable is a long rather than an int, I corrected
the format specifier accordingly in one of the debug messages.
4. I eliminated some redundant casts in a couple of calls to
ap_unescape(), since the variables so cast are already the right
types.
5. The final debug message was being issued only when sarray was
not NULL. However at this spot sarray cannot be NULL anyway, so I
eliminated the test of sarray.
At long last, removing old objson sources. This will not affect the legacy
libobjson.so support, since that's all handled by libopensrf/osrf_legacy_json.c
These patches add two new functions to the osrfHash routines, and
apply them in several modules. THe purpose is to eliminate the
access of an osrfHash's internals by the client code, so that the
internals can be replaced more readily.
Those internals haven't changed yet, but they will.
This patch adds a new function so that code outside of osrf_hash.c
doesn't have to directly access the "current" member of an
osrfHashIterator. This bit of encapsulation will make it easier
to refactor the osrfHash code.
This patch boosts the performance of an osrfHashIterator a bit, by
reusing the "current" buffer whenever possible instead of freeing and
reallocating it on every iteration.
I wrote a benchmark that repeatedly traverses a 27-item hash table.
The new version is about 10% faster. This improvement is not as
dramatic as I had hoped for, but it's easy to get, and it won't hurt.