~bshum/opensrf:master

Last commit made on 2016-02-04
Get this branch:
git clone -b master https://git.launchpad.net/~bshum/opensrf
Only Ben Shum can upload to this branch. If you are Ben Shum please log in for upload directions.

Branch information

Name:
master
Repository:
lp:~bshum/opensrf

Recent commits

b6cf3eb... by Galen Charlton

LP#1350457: add test case for perl2JSONObject change

Signed-off-by: Galen Charlton <email address hidden>

e1581d4... by Mike Rylander

LP#1350457: Pass caller's session to subrequests called via method_lookup

In the process of looking up a method for an internal subrequest, we lose
session info. This is a problem when the subrequest makes a remote request,
because then the subrequest can't look up the proper locale, among other
things. The forthcoming branch passes the caller's session to the subrequest.

This patch also teaches OpenSRF object registration how to strip certain
object members -- in particular, the session -- so that introspection
continues to work.

Signed-off-by: Mike Rylander <email address hidden>
Signed-off-by: Galen Charlton <email address hidden>

69cbe80... by Jason Etheridge <email address hidden>

LP#1474507: fix interval_to_seconds for weeks and seconds

This patch fixes an issue where OpenSRF::Utils::interval_to_seconds()
was not recognizing intervals expressed as seconds or weeks.

Signed-off-by: Jason Etheridge <email address hidden>
Signed-off-by: Galen Charlton <email address hidden>

7a714ae... by Jason Etheridge <email address hidden>

LP#1474507: tests for interval_to_seconds

Signed-off-by: Galen Charlton <email address hidden>

5580724... by Mike Rylander

LP#1494486: Limit damage caused by dropped drone XMPP sockets

It is apparently possible for drones to get into a state where their XMPP
socket is closed but they don't notice. This is bad because the drone can
continue to receive requests from its listener but can no longer respond
to them. To limit the pain this can cause, we should kill the drone as soon
as we notice this condition.

To avoid overhead, this commit notices when the socket returns an error (or
raises a signal, in Perl) upon write, and exits immediately. One message
will be lost, but the drone will no longer be a black hole that does nothing
but absorb requests it can never fill.

To test
-------
[1] Start an OpenSRF stack and look for a drone process.
[2] Use lsof to identify which socket that drone is using
    to talk to XMPP.
[3] Use gdb to attach to the process and close the socket, e.g.,

    $ gdb -p $PID
    (gdb) p close(11) # or whatever the socket number was
    (gdb) c

[4] Use srfsh to make requests of that service. Eventually, one
    of them will hit the drone.
[5] Sans patch, the request will get handled by the drone, but
    the results will never get sent, and the drone will remain
    available to handle other requests.
[6] With the patch, the drone will exit when it discovers that it
    can no longer write to the XMPP socket.

Signed-off-by: Mike Rylander <email address hidden>
Signed-off-by: Galen Charlton <email address hidden>

33a5e60... by Galen Charlton

LP#1152272: do not log batch invocation of srfsh in .srfsh_history

When running srfsh to process a script, do not log
the requests in .srfsh_history.

To test
-------
[1] Run the following command:

    echo 'request opensrf.math opensrf.system.echo "foo"' | srfsh

[2] Note that the last line of ~/.srfsh_history should be
    'request opensrf.math opensrf.system.echo "foo"'

[3] Apply the patch, compile, and run

    echo 'request opensrf.math opensrf.system.echo "bar"' | srfsh

[4] This time, no additional line should have been added to
    ~/.srfsh_history

[5] Another variation to try:

    srfsh test.srfsh

Signed-off-by: Galen Charlton <email address hidden>
Signed-off-by: Mike Rylander <email address hidden>

6f1daba... by Galen Charlton

LP#1461625: ensure srfsh doesn't close STDOUT prematurely

Ensure that when running srfsh in non-interactive mode
that reads commands directly from a file, (i.e.,
"srfsh script.srfsh" or as a shebang script), it does
not close STDOUT after handling the first request.

To test
-------
[1] Create a srfsh script containing:

    request opensrf.math opensrf.system.echo "foo"
    request opensrf.math opensrf.system.echo "bar"

[2] Run "srfsh script.srfsh". Note that only the
    results of the first echo request are output.
[3] Apply the patch and recompile, then run
    "srfsh script.srfsh" again. This time, the
    output of both requests is displayed.

Signed-off-by: Galen Charlton <email address hidden>
Signed-off-by: Mike Rylander <email address hidden>

cc1f6ee... by Dan Scott <email address hidden>

LP#1409055 Support specific protocols for OpenSRF gateway requests

If the user passes in a gateway hostname that contains a specific HTTP or HTTPS
protocol, let's just use that.

Signed-off-by: Dan Scott <email address hidden>
Signed-off-by: Bill Erickson <email address hidden>

42f14c9... by Galen Charlton

LP#1436047: make srfsh --safe act as if "! command" doesn't exist

This patch make srfsh treat attempting to run an external
command via "! command" as a parsing error if --safe is
supplied. It also suppress mention of "! commands" from
the internal help.

Signed-off-by: Galen Charlton <email address hidden>
Signed-off-by: Mike Rylander <email address hidden>

d9cbdfd... by Mike Rylander

LP#1436047: Allow disabling of "bang commands" in srfsh

srfsh has the ability to execute commands via system() calls using
the common "!command" syntax. This is very useful, but it would
be nice to be able to turn that functionality off in some cases.

This branch adds argument parsing to detect a new '--safe' command
line parameter, which disables the "!command" syntax.

Signed-off-by: Mike Rylander <email address hidden>
Signed-off-by: Galen Charlton <email address hidden>