Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-590

send/recv timeout values interchanged in perl socket lib

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1
    • Component/s: Perl - Library
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      In current version of code, sendTimeout is used in read() and recvTimeout is used in write(). Should be the other way around.

      Simple fix:

      Index: lib/perl/lib/Thrift/Socket.pm
      ===================================================================
      — lib/perl/lib/Thrift/Socket.pm (revision 818395)
      +++ lib/perl/lib/Thrift/Socket.pm (working copy)
      @@ -196,7 +196,7 @@
      return unless defined $self->

      {handle};

      #check for timeout
      - my @sockets = $self->{handle}

      >can_read( $self>

      {sendTimeout} / 1000 );
      + my @sockets = $self->{handle}>can_read( $self>{recvTimeout} / 1000 );

      if(@sockets == 0){
      die new Thrift::TException('TSocket: timed out reading '.$len.' bytes from '.
      @@ -236,7 +236,7 @@


      #check for timeout
      - my @sockets = $self->{handle}->can_write( $self->{recvTimeout} / 1000 );
      + my @sockets = $self->{handle}->can_write( $self->{sendTimeout}

      / 1000 );

      if(@sockets == 0){
      die new Thrift::TException('TSocket: timed out writing to bytes from '.

        Attachments

          Activity

            People

            • Assignee:
              jjschutz Jon Schutz
              Reporter:
              jjschutz Jon Schutz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: