uint64_t* ioff;
size_t ix;
uint32_t d_count;
+ bool rcb_eof; // caller forced early stop in readdir cycle
RGWListBucketsRequest(CephContext* _cct, RGWUserInfo *_user,
RGWFileHandle* _rgw_fh, rgw_readdir_cb _rcb,
void* _cb_arg, RGWFileHandle::readdir_offset& _offset)
: RGWLibRequest(_cct, _user), rgw_fh(_rgw_fh), offset(_offset),
- cb_arg(_cb_arg), rcb(_rcb), ioff(nullptr), ix(0), d_count(0) {
+ cb_arg(_cb_arg), rcb(_rcb), ioff(nullptr), ix(0), d_count(0),
+ rcb_eof(false) {
using boost::get;
<< " dirent=" << ent.bucket.name
<< " call count=" << ix
<< dendl;
+ rcb_eof = true;
return;
}
++ix;
<< " is_truncated: " << is_truncated
<< dendl;
}
- return !is_truncated;
+ return !is_truncated && !rcb_eof;
}
}; /* RGWListBucketsRequest */
uint64_t* ioff;
size_t ix;
uint32_t d_count;
+ bool rcb_eof; // caller forced early stop in readdir cycle
RGWReaddirRequest(CephContext* _cct, RGWUserInfo *_user,
RGWFileHandle* _rgw_fh, rgw_readdir_cb _rcb,
void* _cb_arg, RGWFileHandle::readdir_offset& _offset)
: RGWLibRequest(_cct, _user), rgw_fh(_rgw_fh), offset(_offset),
- cb_arg(_cb_arg), rcb(_rcb), ioff(nullptr), ix(0), d_count(0) {
+ cb_arg(_cb_arg), rcb(_rcb), ioff(nullptr), ix(0), d_count(0),
+ rcb_eof(false) {
using boost::get;
<< " (" << sref << ")" << ""
<< dendl;
- if(! this->operator()(sref, next_marker, RGW_FS_TYPE_FILE)) {
+ if (! this->operator()(sref, next_marker, RGW_FS_TYPE_FILE)) {
/* caller cannot accept more */
lsubdout(cct, rgw, 5) << "readdir rcb failed"
<< " dirent=" << sref.data()
<< " call count=" << ix
<< dendl;
+ rcb_eof = true;
return;
}
++ix;
return;
}
- this->operator()(sref, next_marker, RGW_FS_TYPE_DIRECTORY);
+ if (! this->operator()(sref, next_marker, RGW_FS_TYPE_DIRECTORY)) {
+ /* caller cannot accept more */
+ lsubdout(cct, rgw, 5) << "readdir rcb failed"
+ << " dirent=" << sref.data()
+ << " call count=" << ix
+ << dendl;
+ rcb_eof = true;
+ return;
+ }
++ix;
}
}
<< " is_truncated: " << is_truncated
<< dendl;
}
- return !is_truncated;
+ return !is_truncated && !rcb_eof;
}
}; /* RGWReaddirRequest */