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

send/recv timeout values interchanged in perl socket lib

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.1
    • Perl - Library
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: