Jason Stephenson [Tue, 23 Oct 2012 14:52:21 +0000 (10:52 -0400)]
LP#1070466: Print to STDERR in Sip/Checksum::debug_split_print.
debug_split_print was printing to STDOUT, which goes to the client. This
causes the client to hang up because it is not receiving the expected
response from the server. Explicitly printing to STDERR in this
function resolves this and you can continue your session while also
debugging checksum calculations.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bill Erickson [Wed, 26 Dec 2012 18:53:39 +0000 (13:53 -0500)]
Set langauge value for patron info response
Ensure the 3-char language field has a value (defaulting to '000') in
the patron info response. Without the value, there is a 3-char offset
in the response message fixed fields.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Dan Scott [Tue, 21 Jun 2011 02:11:38 +0000 (22:11 -0400)]
Convert checksum to hex value inside checksum() function
Rather than returning the integer value of the checksum and converting
that to a hex value only when it is appended to the returned message,
return the hex value from checksum() itself. This enables the unit tests
for Sip::Checksum to be run meaningfully.
Dan Scott [Wed, 15 Jun 2011 19:22:09 +0000 (15:22 -0400)]
Restore Unicode checksum algorithm
This checksum algorithm was verified to work with
3M V-series self-check machines running with encoding
Unicode, which is important to sites with large
collections of non-English materials.
Dan Scott [Fri, 17 Jun 2011 17:50:26 +0000 (13:50 -0400)]
encode to UTF8 consistently
In read_SIP_packet(), we decode the incoming packet as UTF8 and then
encode it again before writing to the log, but not before returning the
message. We were instead encoding the incoming message in a subsequent
call, which is not the recommended Perl practice of decoding input and
encoding output.
Dan Scott [Wed, 15 Jun 2011 19:17:31 +0000 (15:17 -0400)]
Prevent corruption of SIP messages in logs
Non-ASCII characters were not being decoded before being
written to the logs, thus resulting in heinous corruption
in the logs. decode_utf8() is our friend.
Signed-off-by: Dan Scott <dscott@laurentian.ca> Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Joe Atzberger [Thu, 7 Oct 2010 19:48:56 +0000 (19:48 +0000)]
Allow whitespace "lines" to be skipped during login
This keeps clients who might have bad line-endings in the game.
In particular, this would help systems where an expect-driven login
process might be different than the rest of the client interaction.
Joe Atzberger [Thu, 7 Oct 2010 19:40:38 +0000 (19:40 +0000)]
Die if no listeners in config, give better log messages
Also tighten debug messages: one warning at the end listing all failed is good enough.
Certainly better than just throwaway debug messages listing what we are going to try.
Otherwise if we succeeded, we don't need to know about the ones that failed, just
report the successful one.
Joe Atzberger [Mon, 24 May 2010 22:52:21 +0000 (22:52 +0000)]
Checksum computation overhaul
This adds advanced debugging of checksum computation.
Note: good sample data is lacking. I think most of the actual
checksum lines included in the test are questionable. The only
one that computes accurately seems to be the example from the
3M SIP Developers Guide that specifically addresses checksum
computation. The others from the same guide seem invalid!
I think the debugging output suggests the implementation is
consistent with the specified instructions, despite unavailability
of sample data to confirm.
Joe Atzberger [Tue, 11 May 2010 01:56:37 +0000 (01:56 +0000)]
Get rid of weird evals, useless use's
There are no scripts committed that use DATA handles, so those
eval blocks are not part of a known application. And that
behavior is super sketchy, especially with multiple scripts, likely
in combination!
djfiander [Wed, 13 Jan 2010 01:39:30 +0000 (01:39 +0000)]
Dan Scott's patch:
Item status response 18 was returning CJ0|CM0| which are invalid
according to the SIP2 specification; they should either be
18-char fixed fields or not there at all (as they're optional).
It looks like it was just a reversed test. In looking through
Sip/MsgType.pm in that area, I put together a patch which
prevents those fields from being generated if the incoming value
is 0 - and separates out the value assignment & test into
separate statements, which should make the code a bit easier to
read.
As an aside, I believe the same problem was preventing the due
date (AH) from being returned in the item status response.
Force the key to the 'listeners' hash to be all lowercase, and
force the key for which we search at runtime to be lowercase, so
that searches of the hash are case-insensitive.
Fix code so that it will run with Net::Server 0.96. This is just
eliminating a dependency on the internals of the Net::Server
object, so this code will continue to run with older versions of
Net::Server as well.
Apply Bill Erickson's patch to clean up matching an incoming
connection against the configuration file. There's no longer a
special case for 127.0.0.1, so it will not longer match
'localhost', but it doesn't match any other hostnames anyway.
Move code that connects to ILS back end out of
sip_protocol_loop() and into handle_login(). This way, if
there's a problem loading or initializing the ILS implementation,
the client will be told that login failed, rather than
"successfully" logging in and then having the server die later.
djfiander [Sat, 26 Aug 2006 18:50:42 +0000 (18:50 +0000)]
Go back to using unpack to generate the checksums, except that
I'm using the 'U'TF encoding instead of the 'C'har encoding.
This seems to work, at least in my test environment.