Jason Boyer [Thu, 15 Dec 2022 20:59:48 +0000 (15:59 -0500)]
LP1999823: Bump libtool library version
Increasing Current, resetting Revision, and increasing Age, which should
mean that binaries built against the previous version can still use this
version.
Signed-off-by: Jason Boyer <jboyer@equinoxOLI.org> Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop> Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Jason Boyer [Thu, 15 Dec 2022 20:55:47 +0000 (15:55 -0500)]
LP1999823: Additional growing_buffer function names
If mod_shib is installed on Ubuntu our apache modules will crash
because of a function name collision with libssh. This patch adds
additional names for our growing_buffer manipulation functions so
the modules can use them but the old names are still available for
other users.
Signed-off-by: Jason Boyer <jboyer@equinoxOLI.org> Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop> Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Jason Stephenson [Fri, 23 Jun 2023 16:23:08 +0000 (12:23 -0400)]
Fix error in README
The suggestion to copy the websocketd-osrf.service.example file was
missing the 'd' in the source file. Someone copying and pasting from
the README would encounter an error when copying the file. This
commit adds the missing 'd' so a copy and paste will work.
Processone removed the setting of the legacy XMPP error code from the
Erlang XMPP package with release 1.5.6 in November 2021. Using
OpenSRF with any version of Ejabberd released since the 1.5.6 XMPP
package will cause OpenSRF processes to segfault when a XMPP error
message is processed. This was specifically noticed with Ejabberd
21.12 on Ubuntu 22.04.
To verify the bug, you may install OpenSRF on any system running
Ejabberd 21.12 (or any later version) and make a request to a
non-existent service. The following srfsh request should suffice to
cause a segfault:
request math add 2,2
NOTE: The request is to the non-existent "math" service.
After applying this patch, instead of a segfault in srfsh, you should
see an error message.
OpenSRF should continue to function normally with earlier releases of
the Erlang XMPP library and Ejabberd.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
LP1970667: Add Installation Support for Ubuntu 22.04 (Jammy Jellyfish)
Update the prerequisite installation, C unit tests, and README for
Ubuntu 22.04 LTS (Jammy Jellyfish).
Update configure.ac for recent autoconf/libtool changes
Suggest disabling apparmor for ejabberd in README
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
This patch fixes a memory leak that can occur when
a C app does the following:
- send a non-chunked response
- add a response to a bundle to send later
- send a request complete status message
The leak could add up for long-lived C apps.
To test
-------
[1] Set a up C app such as Evergreen's open-ils.pcrud and
send a lot of requests to it whose responses would not be
large enough to be chunked, but not so many as to go over
max_requests. It may be helpful to limit the service to
just a single child.
[2] Check memory usage of the child after the requests are
processed.
[3] Apply the patch and repeat step 1. This time, memory
usage should be less.
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org> Signed-off-by: Jason Stephenson <jason@sigio.com>
LP#1970469: fix responses streamed out of order due to chunking
If a streaming method starts off sending a couple small responses
followed by a large one, the responses can end up received out of
order under this scenario:
- The initial small responses get stashed to be sent out as a bundle
- The large response, if big enough to require chunking, gets sent
out as a set of partial responses. However, any messages queued
up to go out as a bundle remain in the queue.
- When the method completes, or if further responses result in
exceeding the maximum bundle size, the queued messages get sent
_after_ the chunked response.
This affects services written in C and Perl.
To test
-------
C service
=========
[1] Add the following stored procedure to an Evergreen database:
CREATE OR REPLACE FUNCTION public.lp1970469_sample() RETURNS SETOF TEXT AS $$
BEGIN
RETURN NEXT 'abc';
RETURN NEXT 'def';
RETURN NEXT rpad('long', 65000, 'x');
RETURN NEXT 'xyz';
RETURN;
END;
$$ LANGUAGE PLPGSQL IMMUTABLE;
[3] Note that longxxxxx* response is returned first, followed by abc,
def, and xyz.
[4] Apply the patch and repeat step 2. This time, the responses should
be returned in the expected order.
Perl service
============
[1] In an Evergreen database, attach a couple hundred items to
a record.
[2] Run the following srfsh command:
[3] If enough items were attached, the first response streamed will
start with a <volume> element rather than the <holdings> element
and the overall response will not be well-formed XML.
[4] Apply the patch and repeat step 2. This time, the parts of the
response should be in the expected order.
Note that this test scenario models an Evergreen glitch seen in the
wild that causes requests for
When the request backlog contains items in the C forking code, attempts
to process the request run in a tight loop without stopping until the
backlog is once again empty. This can lead to spewing "Could not launch
a new child" warning messages at a high rate, saturating log files.
This commit adds a 1 second speed bump between backlog processing loops
to allow time for drones to complete their task and start processing the
remaining queued requests. The delay has a secondary affect of limited
the speed of the warning log spewing.
This 1-second speedbump logic matches that of the Perl code.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop> Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Jason Boyer [Tue, 17 Aug 2021 18:01:55 +0000 (14:01 -0400)]
Remove XUL opensrf.math Client
Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Jason Boyer [Tue, 17 Aug 2021 18:00:20 +0000 (14:00 -0400)]
LP1940146: Update documentation
Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Jason Boyer [Tue, 17 Aug 2021 17:46:11 +0000 (13:46 -0400)]
LP1940146: Debian Bullseye Installation Support
This commit also addresses LP 1940145: Remove Installation
Support for Debian Jessie. The individual distribution-specific
targets (stretch, buster, etc.) have also been removed since
they are now all the same, much like both Ubuntu targets just
call ubuntu_generic. The two generic targets have been left
in case they're necessary again in future.
Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
When presented with an error message that has more than 32 characters
that need to be escaped, the gateway fails to reserve enough space in
the memory allocation it uses to build the JSON message. Instead of
guessing at how much space will be needed, and failing for some
messages, this commit uses growing_buffer to build the JSON.
growing_buffer is limited to 10Mb, so while large messages could be
generated, they won't cause an OOM on the server side.
Signed-off-by: Ken Cox <kenstir@gmail.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
Java support in OpenSRF does not build and is out of date with current
OpenSRF features. No one has the intention to fix it, so this commit
removes Java from the code, build files, and documentation.
To test that Java is indeed broken, configure OpenSRF with the
--enable-java option and then watch the make fail as it tries to pull
in missing dependencies.
To test this branch, simply apply it and see that the option to enable
Java is gone along with all of the obsolete code and build instructions.
Bill Erickson [Mon, 26 Oct 2020 15:27:00 +0000 (11:27 -0400)]
LP1827055 Remove Python libs, install bits, and docs
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Indicate that the mod_legacy_auth directive is foudn in the modules
section of the ejabberd configuration (ejabberd.yml) for Debian Buster
and/or Ubuntu Bionic.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Bill Erickson [Thu, 23 Apr 2020 19:32:50 +0000 (15:32 -0400)]
LP1874510 libopensrf recv timeout cal repair
Fixes the message receive timeout calculation logic in OpenSRF C client
code. The calculation is performed when multiple calls to receive are
needed to piece together a response message.
The logic previously calculated the time remaining as the time remaining
minus the total time taken for all iterations with each loop iteration,
leading to exhausting the timeout too quickly. Now it calculates the
value as time remaining minus the time taken for the only most recent
loop iteration.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com>
Bill Erickson [Wed, 29 May 2019 16:36:24 +0000 (12:36 -0400)]
LP1830642 Remove variable args from md5sum()
Remove support for passing variable args to the md5sum() function, since
no code currently uses this, and it causes problems processing strings
with '%' characters.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Jason Boyer [Tue, 9 Jul 2019 12:23:51 +0000 (08:23 -0400)]
LP1834208 Rearrange proxy instructions to reduce repetition
The instructions for Apache configuration changes were repeated
multiple times throughout the README. This pulls them together,
allowing the Nginx and HAProxy sections to focus specifically on
the configuration of those packages.
Signed-off-by: Jason Boyer <jboyer@library.in.gov> Signed-off-by: Ben Shum <ben@evergreener.net>
LP1834208 Update proxy example configuration files
The examples/haproxy/osrf-ws-http-proxy file needed a syntax
correction with the listen directive.
Remove X-Real-IP lines from the examples/nginx/osrf-ws-http-proxy
configuration, and remove the X-Client-IP line from the
examples/haproxy/osrf-ws-http-proxy configuration. These entries are
redundant when X-Forwarded-For is being used.
This latter change also suggests changes in the Evergreen Apache 2
configuration examples.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Jason Boyer <jboyer@library.in.gov> Signed-off-by: Ben Shum <ben@evergreener.net>
Bill Erickson [Tue, 25 Jun 2019 15:03:36 +0000 (11:03 -0400)]
LP1834208 Removing apache2-websockets
Remove code and build components for apache2-websockets. Update
documentation to reflect the use of websocketd as the only supported
OpenSRF websockets implementation.
Add a note to the install documentation indicating websocketd does not
offer a configurable inactivity timeout, but this can be accomplished
by running it behind a proxy.
Update NGINX and HAPROXY example configs to reflect the assumption that
websocketd is runs locally without SSL by default.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Jason Boyer <jboyer@library.in.gov> Signed-off-by: Ben Shum <ben@evergreener.net>
John Merriam [Wed, 10 Apr 2019 15:06:14 +0000 (11:06 -0400)]
LP#1824184: Change potentially slow log statements to subroutines
The OpenSRF code was searched for potentially slow logging statements at
log level info or above. We then changed those logging statements to be
delayed execution subroutines. This is in reaction to LP1823338 where a
slow debug logging statement was slowing down SIP checkins even though
debug logging was not turned on.
Here is some pseudocode that shows what is being done here:
$log->debug("Some text " . $some->slow_method);
would be changed to:
$log->debug(sub{return "Some text " . $some->slow_method });
With this change, an unnamed sub is passed to the OpenSRF logger module
and it will not be executed unless the global logging level is set to
debug or higher (the slow_method will not be called unless it is needed
for that logging level).
********
If/when this is committed, please use delayed execution subroutines for
any logging statements that could be slow in the future. It is recommend
that any logging statements that do not consist entirely of quoted text
and/or already available scalar variables use delayed execution
subroutines.
********
Testing notes
-------------
[1] This patch reduced the duration of open-ils.storage.actor.user.total_owed
calls on a test system from an average of 0.13 seconds to an overage
of 0.009 seconds.
[2] It didn't materially affect the duration of calls to
open-ils.actor.user.opac.vital_stats.
[3] This make sense: open-ils.storage has far more generated methods
than open-ils.actor.
[4] There are enough instances in Evergreen of using method_lookup to find
routines in open-ils.storage that the speed improvement may well be
perceptible to humans, not just SIP sorters.
Signed-off-by: John Merriam <jmerriam@biblio.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
John Merriam [Wed, 10 Apr 2019 13:51:54 +0000 (09:51 -0400)]
LP#1824181: Allow 1st arg to logger to be string or subroutine
This simple change allows the $msg passed to _log_message in Logger.pm
to be either a regular string or a delayed exec subroutine. This is in
reaction to LP1823338 where a slow debug logging statement was slowing
down SIP checkins even though debug logging was not turned on.
This patch extends the notion of a backlog queue to C apps and
offers the same functionality as the Perl side of the patch series:
- max_backlog_queue configuration setting
- ability to queue messages up to the configured limit
- ability to drop requests that would overflow the backlog
queue and send status 503 exceptions back to the client.
This patch also adds a new service, opensrf.cslow, that implements
a opensrf.cslow.wait method similar to the Perl opensrf.slooooooow
service.
To test
-------
[1] Set a low max_backlog_queue for opensrf.cslow and a low
max_children.
[2] Arrange for srfsh to fire off a bunch of opensrf.cslow.wait
requests.
[3] Verify that requests that come in after the backlog queue fills
up immediately get 503 exceptions.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
Galen Charlton [Wed, 7 Nov 2018 17:03:17 +0000 (12:03 -0500)]
LP#1729610: return new OpenSRF status if backlog queue fills up
This patch teaches Perl services how to return a new OpenSRF status,
OSRF_STATUS_SERVICEUNAVAILABLE (code 503) if the backlog queue
for a service gets full.
To test
-------
[1] Set a low max_backlog_queue for opensrf.sloooow and a low
max_children.
[2] Arrange for srfsh to fire off a bunch of opensrf.sloooow.wait
requests.
[3] Verify that requests that come in after the backlog queue fills
up immediately get 503 exceptions.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
Mike Rylander [Tue, 24 Oct 2017 17:27:37 +0000 (13:27 -0400)]
LP#1729610: Allow queuing (for a while) during child backlog
This patch teaches OpenSRF listeners for Perl services how to maintain
a queue of requests in case no drone process is immediately available
to process a requeust.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
Give websocketd clients a chance to complete any requests that are
in-process at time of shutdown.
Graceful shutdown is initiated by sending a SIGUSR1 signal to the
websocket-osrf child processes or to the parent process group.
This can be done directly via:
$ kill -s USR1 -$websocketd_parent_pid
Or via systemd for systemd users:
$ sudo systemctl kill -s USR1 websocketd-osrf
Note the websocketd parent process ignores SIGUSR1.
Once initiated, the websocketd backend goes into shutdown mode polling
for a graceful shutdown window, which occurs when all request up to now
have been completed. Once that moment arrives, the client is kicked off
and must connect to a new websocketd instance to issue any new requests.
The polling period lasts for SHUTDOWN_MAX_GRACEFUL_SECONDS seconds (in
osrf-websocket-stdio.c), which currently defaults to 2 minutes.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Creates an API-level option to inform the OpenSRF drone management code
that the running drone should be recycled upon completion of the current
OpenSRF session. This allows for quicker release of resources consumed
by the drone.
To use:
sub some_api_method {
my ($self, $client, ...) = @_;
$self->session->force_recycle(1);
...
}
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Bill Erickson [Mon, 27 Aug 2018 14:12:57 +0000 (10:12 -0400)]
LP#1684970 Translator compatible with mod_remoteip
Teach the OSRF Translator to request the IP address of the user agent
(e.g. web browser) instead of the IP address of the up stream client,
which may be a proxy, using the Apache 2.4 request_rec->useragent_ip
value.
* Adds security recommendations from
https://mozilla.github.io/server-side-tls/ssl-config-generator/
* Enables http2
* Apply a 5-minute proxy read timeout to avoid too-short timeouts on
long API calls.
* Adds a (commented) section on sending nginx logs to syslog
Includes INSTALL notes on generating the dhparam file.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Teach the websocket client code to look for the transport_error flag
applied to the websocket wrapper message by the websocket gateway when a
request for an unavilable service is made.
When encountered, fire the transport or generic error handler callbacks,
if available. Avoid any attempts to further process the message.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
* Message template typo repair -- missing "'"
* XPath repair on path to opensrf sub-element for Perl
* Move 'type' attribute get/set back up to the <message> for Perl.
* Clean up code duplication in the C message building libs.
* Squash a centuries-old memory leak where xmlFree(sender) was only
called if a router_from was not supplied.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
Modern versions of Ejabberd strip custom XML attributes which appear
outside of custom elements. To support OpenSRF's custom router and
osrf_xid commands, move these attributes into a new custom XML element
<opensrf>.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com>
Adds a new OpenSRF binary/program for relaying websockets messages
to and from a websocketd instance. The new binary
(osrf-websocket-stdio) performs the same tasks as the
osrf_websocket_translator.c Apache module, minus the Apache module glue
and the extra threading required to run within the Apache module.
Commit includes 2 test scripts (tester.pl and test-stateful.pl) for
generating large series of test messages to send to a websockets
instance. tester.pl sends echo requests only, test-stateful.pl sends
connect->echo-request->disconnect batches across a configurable number
of forked processes.
INSTALL document updated to include websocketd setup as an alternative
to Apache websockets.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Ben Shum <ben@evergreener.net>
Mike Rylander [Fri, 7 Jul 2017 19:22:21 +0000 (15:22 -0400)]
LP#1702978: memcache Get methods use key as va_list format
And, when a key (composed of, say, a username or barcode) has a % in it,
bad things happen. We will stop acting as if these are variadic functions
now, and also update Evergreen so that it does not do that either.
TODO: Make these actually non-variadic, but that breaks ABI.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org> Signed-off-by: Jason Stephenson <jason@sigio.com>
Galen Charlton [Mon, 7 May 2018 20:03:16 +0000 (16:03 -0400)]
LP#1243841: quiet a misleading indentation warning
Adjusts a spaces-vs-tabs issue to fix the following compilation
warning:
osrf_prefork.c: In function ‘check_children’:
osrf_prefork.c:1067:5: warning: this ‘if’ clause does not
guard... [-Wmisleading-indentation]
if( select_ret <= 0 ) // we're done here
^~
osrf_prefork.c:1072:2: note: ...this statement, but the latter is
misleadingly indented as if it is guarded by the ‘if’
cur_child = forker->first_child;
^~~~~~~~~
LP#1243841 - Quiet additional Make warnings and some code cleanup.
We make the following warnings go away:
osrf_legacy_json.c:607:6: warning: variable ‘fourth_dash’ set but
not used [-Wunused-but-set-variable]
osrf_legacy_json.c:836:5: warning: passing argument 3 of ‘makeNode’
discards ‘const’ qualifier from pointer target type [enabled by
default]
utils.c:133:2: warning: format not a string literal and no format
arguments [-Wformat-security]
We also cleanup the while block nested in a do while block around line
63 of osrf_cache.c to be more readable by adding braces and breaking
it across 3 lines.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Using advice given here: https://stackoverflow.com/a/13999461, "The
only good (if ugly) way to suppress these is to convert the return
value into something that the compiler agrees that you can ignore."
Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Chris Sharp [Tue, 19 Sep 2017 22:10:00 +0000 (18:10 -0400)]
LP#1243841 - Wrap truth test using "=" in an extra set of parens.
Referring to https://stackoverflow.com/questions/5476759/compiler-warning-suggest-parentheses-around-assignment-used-as-truth-value,
it is recommended to wrap variable assignments that are used as a truth
test within an extra set of parentheses.
Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Jason Stephenson [Sun, 18 Feb 2018 17:12:13 +0000 (12:12 -0500)]
LP1340982: Ignore both 'comment' and '#comment' nodes in Settings Parse.
Modify the XML2perl helper function in OpenSRF::Utils::SettingsParser
to ignore comment nodes that have names of comment and #comment.
To reproduce the bug:
1. Stop OpenSRF services.
2. Add a XML comment, any text betwen <!-- and -->, in the list of
MARC templates in the opensrf.xml file.
3. Restart OpenSRF services.
4. In the staff client, go to Cataloging->Create New MARC Record.
5. In the list of templates, you will #comment where you added the
comment. (NOTE: I only tested with 1 comment. Things may get worse
with more than 1 comment.)
6. There will be an error like the following in the
open-ils.cat_stderr.log if you attempt to choose the #comment entry:
Caught error from 'run' method: Exception: OpenSRF::EX::ERROR
2018-02-18T11:24:30 OpenSRF::Application
/usr/local/share/perl/5.22.1/OpenSRF/Application.pm:240 System
ERROR: Unable to open MARC template file: HASH(0x2249928) :
To test the fix:
1. Leave the comments in the opensrf.xml file from before.
2. Apply this commit, do make and make install for OpenSRF.
3. Just to make sure, do make and make install for Evergreen.
4. Repeat steps 3 and 4 from above.
5. You should NOT see any templates named #comment.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Bill Erickson [Tue, 10 Apr 2018 19:06:56 +0000 (15:06 -0400)]
LP#1762815 Empty client TZ defaults to server TZ (Perl)
Fixes an issue in the Perl client time zone handling that resulted in
the server defaulting to UTC time instead of the server time zone when
no time zone value was received from the client.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com>
Bill Erickson [Wed, 24 Jan 2018 20:16:14 +0000 (15:16 -0500)]
LP#1744158 Websocket proc exits on ejabberd disconnect
Any errors relaying websocket messages to OpenSRF now result in the WS
client being disconnected, allowing the WS process to exit. This
prevents the WS gateway from accepting requests it cannot process and
allows the client to connect to a new WS process.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com>
Bill Erickson [Wed, 31 Jan 2018 18:07:41 +0000 (13:07 -0500)]
LP#1746577 Websocket responder exits on jabber disconnect
Regularly check for Jabber socket disconnects in the websocket gateway
"responder" thread (that relays messages from opensrf to the WS client)
and force a client disconnect when a broken jabber socket is detected.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Jason Stephenson <jason@sigio.com>
LP#1717350: fix chunking messages sent from Perl services
The chunk size adjustments introduced by the patches for bug 1709710
could result in calculating non-integral chunk sizes for Perl services.
This in turn led to fractional offsets and lengths being passed to
Perl's substr() function; rounding in turn can lead to characters
in the response getting silently dropped, which in turn broke
parsing the reconstituted response.
To test
-------
The problem can be reproduced by invoking
Mike Rylander [Fri, 18 Aug 2017 15:43:31 +0000 (11:43 -0400)]
LP#1709710: Make chunk sizing smart about XML quoting
XML inside JSON as a quoted string that's itself inside XML causes quite the
pile up of nested excaping of certain characters in OpenSRF PARTIAL_RESPONSE
messages. Here we check for the worst offenders (<, >, &, and ") and account
for the cost of escaping them in chunked response stanzas.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Chris Sharp [Thu, 11 May 2017 18:47:32 +0000 (14:47 -0400)]
LP#1690206 - remove check of httpd.conf from OpenSRF Makefile.install
The original src/extras/Makefile.install included a grep of the
file /etc/apache2/httpd.conf, which is no longer installed by default
on supported Debian and Ubuntu releases. As this check results in
an error message, it makes sense to remove the check altogether.
Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Confirm that a child process is alive just before attempting to write to
its pipe. If the child process is dead, log the error, then drop the
message and move on. This allows the parent to continue servicing
future requests.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Under some circumstances, osrf_control --diagnostic may not
be able to deduce the correct max_children setting for a service,
e.g., if it's run without --localhost on a system that doesn't
have a opensrf.xml config section specifying active apps for a
specific hostname. When that happens, just display the count
of running drones rather than displaying error messages about
undefined $dmax values and divisions by zero.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Bill Erickson <berickxx@gmail.com>
--diagnostic output shows the maximum number of allowed drones per
service along with the active drone count. Additionally, a usage
percentage value is displayed.
Dan Wells [Fri, 21 Jul 2017 18:17:34 +0000 (14:17 -0400)]
LP#1635737 Add optional context to interval_to_seconds
Any given interval (e.g. "1 month") can be a different amount of
seconds depending on the context (i.e. "1 month" after February 1 is
March 1, but "1 month" after March 1 is April 1, yet March is longer
than February). This affects months all the time, but also can affect
days, hours, and even seconds once you consider DST and "leap" times.
By giving an optional context to interval_to_seconds, you can find the
true number of seconds in, for example, "1 month", when starting from
"February 1" (the context).
Signed-off-by: Dan Wells <dbw2@calvin.edu> Signed-off-by: Mike Rylander <mrylander@gmail.com>
Jason Stephenson [Wed, 12 Jul 2017 19:24:48 +0000 (15:24 -0400)]
LP 1703958: Update Websockets Intructions for Debian Jessie
Modify the Websockets installation instructions so that users will
have a working installation on Debian Jessie. We change the "Debian"
instructions to say "Debian Wheezy" and add "Debian Jessie" to the
list with "Ubuntu Trusty / Xenial" where necessary.
Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Previously, following the optional Nginx server setup
instructions resulted in failure for nginx to install
because Apache is already using ports 80 and 443. Switch
the steps so that we change Apache's listening ports before
APT installation.
Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Ben Shum <ben@evergreener.net>
All WebSockets communication occurs via SSL in the sample configuration
files. Non-SSL communication is still an option if required with local
configuration.
Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
This patch adds the ability to specify the WebSockets
port as a configure option, avoiding the need to manually
edit a couple JavaScript files if one chooses to proxy
WS traffic.
This patch also cleans up the set of JavaScript files that
are installed so that some test case files are not installed
by default.