Probably just an oversight.

On 11/13/2010 01:35 PM, Jens Geyer wrote:
> Hello,
> 
> There are two CTORs for TPipedTransport in TTransportUtils. One of them
> has these lines in it which initialize both pipeOnXxx_ flags, but the
> other one has not:
> 
>    // default is to to pipe the request when readEnd() is called
>    pipeOnRead_ = true;
>    pipeOnWrite_ = false;
> 
> Is this by intention? Or is it just missing in the second one?
> 
> Thanks,
> Jens
> 
> 
> ---- full code ---
> 
> 
>  TPipedTransport(boost::shared_ptr<TTransport> srcTrans,
>                  boost::shared_ptr<TTransport> dstTrans) :
>    srcTrans_(srcTrans),
>    dstTrans_(dstTrans),
>    rBufSize_(512), rPos_(0), rLen_(0),
>    wBufSize_(512), wLen_(0) {
> 
>    // default is to to pipe the request when readEnd() is called
>    pipeOnRead_ = true;
>    pipeOnWrite_ = false;
> 
>    rBuf_ = (uint8_t*) std::malloc(sizeof(uint8_t) * rBufSize_);
>    if (rBuf_ == NULL) {
>      throw std::bad_alloc();
>    }
>    wBuf_ = (uint8_t*) std::malloc(sizeof(uint8_t) * wBufSize_);
>    if (wBuf_ == NULL) {
>      throw std::bad_alloc();
>    }
>  }
> 
>  TPipedTransport(boost::shared_ptr<TTransport> srcTrans,
>                  boost::shared_ptr<TTransport> dstTrans,
>                  uint32_t sz) :
>    srcTrans_(srcTrans),
>    dstTrans_(dstTrans),
>    rBufSize_(512), rPos_(0), rLen_(0),
>    wBufSize_(sz), wLen_(0) {
> 
>    rBuf_ = (uint8_t*) std::malloc(sizeof(uint8_t) * rBufSize_);
>    if (rBuf_ == NULL) {
>      throw std::bad_alloc();
>    }
>    wBuf_ = (uint8_t*) std::malloc(sizeof(uint8_t) * wBufSize_);
>    if (wBuf_ == NULL) {
>      throw std::bad_alloc();
>    }
> 
> 

Reply via email to