Thrift-1393: TTransportException's thrown from THttpClient contain superfluous slashe...
authorJake Farrell <jfarrell@apache.org>
Tue, 18 Oct 2011 15:31:17 +0000 (15:31 +0000)
committerJake Farrell <jfarrell@apache.org>
Tue, 18 Oct 2011 15:31:17 +0000 (15:31 +0000)
Client : php
Patch: Nick Jones

The THttpClient class ensures the $uri_ property has a slash prefixed by appending one if needed in the constructor. However in THttpClient::read, there are 2 exceptions thrown where a slash is concatenated between the port and uri. This results in a superfluous slash in the TTransportException message.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1185723 13f79535-47bb-0310-9956-ffa450edef68

lib/php/src/transport/THttpClient.php

index 102dbbb..880011a 100644 (file)
@@ -144,9 +144,9 @@ class THttpClient extends TTransport {
     if ($data === FALSE || $data === '') {
       $md = stream_get_meta_data($this->handle_);
       if ($md['timed_out']) {
-        throw new TTransportException('THttpClient: timed out reading '.$len.' bytes from '.$this->host_.':'.$this->port_.'/'.$this->uri_, TTransportException::TIMED_OUT);
+        throw new TTransportException('THttpClient: timed out reading '.$len.' bytes from '.$this->host_.':'.$this->port_.$this->uri_, TTransportException::TIMED_OUT);
       } else {
-        throw new TTransportException('THttpClient: Could not read '.$len.' bytes from '.$this->host_.':'.$this->port_.'/'.$this->uri_, TTransportException::UNKNOWN);
+        throw new TTransportException('THttpClient: Could not read '.$len.' bytes from '.$this->host_.':'.$this->port_.$this->uri_, TTransportException::UNKNOWN);
       }
     }
     return $data;