projects
/
Biblio-RFID.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39a86ab
)
retry sip response
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 20 Mar 2015 12:30:25 +0000
(13:30 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 20 Mar 2015 12:30:25 +0000
(13:30 +0100)
scripts/RFID-JSONP-server.pl
patch
|
blob
|
history
diff --git
a/scripts/RFID-JSONP-server.pl
b/scripts/RFID-JSONP-server.pl
index
4bec23e
..
3e1d4fd
100755
(executable)
--- a/
scripts/RFID-JSONP-server.pl
+++ b/
scripts/RFID-JSONP-server.pl
@@
-92,14
+92,18
@@
sub sip2_message {
my $expect = substr($send,0,2) | 0x01;
- my $in = <$sock>;
- $in =~ s/^\n//;
- warn "SIP2 <<<< ",dump($in), "\n";
+ my $in = '';
+ my $repeat = 1;
+ while ( $in eq '' && $repeat < 10 ) {
+ $in = <$sock>;
+ $in =~ s/^\n//;
+ $in =~ s/\r$//;
+ warn "SIP2 <<<< ",dump($in), " repeat: $repeat\n";
+ $repeat++;
+ }
die "expected $expect" unless substr($in,0,2) != $expect;
- $in =~ s/\r$//;
-
my $hash;
if ( $in =~ s/^([0-9\s]+)// ) {
$hash->{fixed} = $1;