MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rioWrite

Function rioWrite

app/redis-6.2.6/src/rio.h:103–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101 * if needed. */
102
103static inline size_t rioWrite(rio *r, const void *buf, size_t len) {
104 if (r->flags & RIO_FLAG_WRITE_ERROR) return 0;
105 while (len) {
106 size_t bytes_to_write = (r->max_processing_chunk && r->max_processing_chunk < len) ? r->max_processing_chunk : len;
107 if (r->update_cksum) r->update_cksum(r,buf,bytes_to_write);
108 if (r->write(r,buf,bytes_to_write) == 0) {
109 r->flags |= RIO_FLAG_WRITE_ERROR;
110 return 0;
111 }
112 buf = (char*)buf + bytes_to_write;
113 len -= bytes_to_write;
114 r->processed_bytes += bytes_to_write;
115 }
116 return 1;
117}
118
119static inline size_t rioRead(rio *r, void *buf, size_t len) {
120 if (r->flags & RIO_FLAG_READ_ERROR) return 0;

Callers 7

rdbWriteRawFunction · 0.85
rdbSaveRioFunction · 0.85
rdbSaveRioWithEOFMarkFunction · 0.85
rioWriteBulkCountFunction · 0.85
rioWriteBulkStringFunction · 0.85
rewriteAppendOnlyFileRioFunction · 0.85
rewriteAppendOnlyFileFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected