outbufp, byref(outbuflen), outsp, byref(outslen)),
timeout)
- if ret == 0:
- # copy returned memory (ctypes makes a copy, not a reference)
- my_outbuf = outbufp.contents[:(outbuflen.value)]
- my_outs = outsp.contents[:(outslen.value)]
+ # copy returned memory (ctypes makes a copy, not a reference)
+ my_outbuf = outbufp.contents[:(outbuflen.value)]
+ my_outs = outsp.contents[:(outslen.value)]
- # free callee's allocations
+ # free callee's allocations
+ if outbuflen.value:
run_in_thread(self.librados.rados_buffer_free, (outbufp.contents,))
+ if outslen.value:
run_in_thread(self.librados.rados_buffer_free, (outsp.contents,))
- else:
- my_outbuf = ''
- my_outs = ''
return (ret, my_outbuf, my_outs)
outbufp, byref(outbuflen), outsp, byref(outslen)),
timeout)
- if ret == 0:
- # copy returned memory
- my_outbuf = outbufp.contents[:(outbuflen.value)]
- my_outs = outsp.contents[:(outslen.value)]
+ # copy returned memory (ctypes makes a copy, not a reference)
+ my_outbuf = outbufp.contents[:(outbuflen.value)]
+ my_outs = outsp.contents[:(outslen.value)]
- # free callee's allocations
+ # free callee's allocations
+ if outbuflen.value:
run_in_thread(self.librados.rados_buffer_free, (outbufp.contents,))
+ if outslen.value:
run_in_thread(self.librados.rados_buffer_free, (outsp.contents,))
- else:
- my_outbuf = ''
- my_outs = ''
return (ret, my_outbuf, my_outs)
outbufp, byref(outbuflen), outsp, byref(outslen)),
timeout)
- if ret == 0:
- # copy returned memory
- my_outbuf = outbufp.contents[:(outbuflen.value)]
- my_outs = outsp.contents[:(outslen.value)]
+ # copy returned memory (ctypes makes a copy, not a reference)
+ my_outbuf = outbufp.contents[:(outbuflen.value)]
+ my_outs = outsp.contents[:(outslen.value)]
- # free callee's allocations
+ # free callee's allocations
+ if outbuflen.value:
run_in_thread(self.librados.rados_buffer_free, (outbufp.contents,))
+ if outslen.value:
run_in_thread(self.librados.rados_buffer_free, (outsp.contents,))
- else:
- my_outbuf = ''
- my_outs = ''
return (ret, my_outbuf, my_outs)