mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 20:00:58 +01:00
nothing
This commit is contained in:
@@ -174,6 +174,7 @@ size_t ps_read_cached(Pcpstream *stream, void *buf, size_t readbytes) {
|
|||||||
else {
|
else {
|
||||||
// fprintf(stderr, " fetch next\n");
|
// fprintf(stderr, " fetch next\n");
|
||||||
/* request for chunk larger than what we've got in the cache */
|
/* request for chunk larger than what we've got in the cache */
|
||||||
|
// FIXME: use static buffer !
|
||||||
Buffer *tmp = buffer_new(stream->blocksize, "Pcpreadchunktmp");
|
Buffer *tmp = buffer_new(stream->blocksize, "Pcpreadchunktmp");
|
||||||
|
|
||||||
if( buffer_left(stream->cache) > 0) {
|
if( buffer_left(stream->cache) > 0) {
|
||||||
@@ -257,6 +258,7 @@ size_t ps_read(Pcpstream *stream, void *buf, size_t readbytes) {
|
|||||||
size_t got = 0;
|
size_t got = 0;
|
||||||
if(stream->cache == NULL) {
|
if(stream->cache == NULL) {
|
||||||
got = ps_read_raw(stream, buf, readbytes);
|
got = ps_read_raw(stream, buf, readbytes);
|
||||||
|
// fprintf(stderr, "%ld = ps_read_raw(stream, buf, readbytes); // no cache\n", got);
|
||||||
}
|
}
|
||||||
else if(buffer_size(stream->cache) > 0) {
|
else if(buffer_size(stream->cache) > 0) {
|
||||||
/* use cache */
|
/* use cache */
|
||||||
@@ -281,11 +283,12 @@ size_t ps_read(Pcpstream *stream, void *buf, size_t readbytes) {
|
|||||||
else {
|
else {
|
||||||
/* read directly from source */
|
/* read directly from source */
|
||||||
got = ps_read_raw(stream, buf, readbytes);
|
got = ps_read_raw(stream, buf, readbytes);
|
||||||
|
// fprintf(stderr, "%ld = ps_read_raw(stream, buf, readbytes);\n", got);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stream->pos += got;
|
stream->pos += got;
|
||||||
// fprintf(stderr, " ps_read(): %ld\n", got);
|
//fprintf(stderr, " ps_read(): %ld\n", got);
|
||||||
return got;
|
return got;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
while(!ps_end(in)) {
|
while(!ps_end(in)) {
|
||||||
got = ps_read(in, buf, blocksize);
|
got = ps_read(in, buf, blocksize);
|
||||||
|
//fprintf(stderr, "got: %ld\n", got);
|
||||||
if(got > 0)
|
if(got > 0)
|
||||||
ps_write(out, buf, got);
|
ps_write(out, buf, got);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user