]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix bug in FS Client.pm
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 19 Dec 2008 17:25:52 +0000 (17:25 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 19 Dec 2008 17:25:52 +0000 (17:25 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10884 d0543943-73ff-0310-b7d9-9358b9ac24b2

scripts/socket/FreeSWITCH/Client.pm

index 5244782425b0313ece735a15a275291d03b9fd9f..9e972185807c2ad052537e8fff4575fdbc1cb6e2 100644 (file)
@@ -73,7 +73,7 @@ sub readhash($;$) {
       while(length($h->{body}) < $h->{'content-length'}) {
        my $buf;
        recv $s, $buf, $h->{'content-length'} - length($h->{body}), 0;
-       if (!$buf) {
+       if ($buf eq '') {
          $h->{socketerror} = "yes";
          return $h;      
        }
@@ -152,9 +152,9 @@ sub command($$) {
 
   my $r = $self->sendmsg({ 'command' => "api " . shift });
 
-  if ($r->{body}) {
+  if ($r->{body} ne '') {
     $reply = $r->{body};
-  } elsif ($r->{'reply-text'}) {
+  } elsif ($r->{'reply-text'} ne '') {
     $reply = $r->{'reply-text'};
   } else {
     $reply = "socketerror";