Question on receive_http_data() in rgw_http_client.cc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

According to Ceph 0.94.7, when client->receive_data() encounters some
errors, receive_http_data() just gives a warning log record but still
considers the data of size size * nmemb written and return len = size
* nmemb.
Since receive_http_data is registered as CURLOPT_WRITEFUNCTION, curl
will think the data is properly written and report no errors. Thus the
curl caller may be misled.
The behavior seems not quite reasonable to me.
Is it as designed due to some history?

static size_t receive_http_data(void *ptr, size_t size, size_t nmemb,
void *_info)
{
    RGWHTTPClient *client = static_cast<RGWHTTPClient *>(_info);
    size_t len = size * nmemb;
    int ret = client->receive_data(ptr, size * nmemb);
    if (ret < 0) {
        dout(0) << "WARNING: client->receive_data() returned ret=" <<
ret << dendl;
    }
    return len;
}

Thanks,
Jeegn
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux