Bugzilla – Attachment 10031 Details for
Bug 7619
3M self checkout don't work in France
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Revised Patch
0001-Bug-7619-Use-CRLF-as-default-terminator.patch (text/plain), 2.06 KB, created by
Colin Campbell
on 2012-06-09 14:31:19 UTC
(
hide
)
Description:
Revised Patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2012-06-09 14:31:19 UTC
Size:
2.06 KB
patch
obsolete
>From a6697b5c3991ffef52f8a86c89be1314408852eb Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Sat, 9 Jun 2012 15:17:14 +0100 >Subject: [PATCH] Bug 7619 Use CRLF as default terminator > >Most units require or tolerate CRLF as the terminator >Using only \r causes many including 3M units to signal errors >due to delay this resets CRLF to be default but adds a single >constant variable and explanation so that if you have a >"strictly conforming" unit (the 'Baby' is the only I have encountered >you know where to make the change >--- > C4/SIP/Sip.pm | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > >diff --git a/C4/SIP/Sip.pm b/C4/SIP/Sip.pm >index 4e3f299..85253e1 100644 >--- a/C4/SIP/Sip.pm >+++ b/C4/SIP/Sip.pm >@@ -8,6 +8,7 @@ use strict; > use warnings; > use English; > use Exporter; >+use Readonly; > > use Sys::Syslog qw(syslog); > use POSIX qw(strftime); >@@ -38,7 +39,16 @@ BEGIN { > > our $error_detection = 0; > our $protocol_version = 1; >-our $field_delimiter = '|'; # Protocol Default >+our $field_delimiter = '|'; # Protocol Default >+# The message terminator for a SIP message is '\r' in the standard doc >+# However most sip devices in the wild send a CR LF pair >+# This is required by Telnet if that is your carrier mechanism >+# On raw connections it may also be required because the buffer is >+# only flushed on linefeed and its absence causes enough delay for >+# client machines to go into an error state >+# The below works for almost all machines if however you have one >+# which does not like the additional linefeed change value to $CR >+Readonly my $msg_terminator => $CRLF; > > # We need to keep a copy of the last message we sent to the SC, > # in case there's a transmission error and the SC sends us a >@@ -234,10 +244,10 @@ sub write_msg { > > if ($file) { > $file->autoflush(1); >- print $file "$msg\r"; >+ print $file $msg, $msg_terminator; > } else { > STDOUT->autoflush(1); >- print $msg, "\r"; >+ print $msg, $msg_terminator; > syslog("LOG_INFO", "OUTPUT MSG: '$msg'"); > } > >-- >1.7.11.rc0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7619
:
7937
|
10031
|
10456