Skip to content

Commit

Permalink
Add some debug logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
ni4 committed Nov 13, 2023
1 parent 1f7759f commit dc32ec4
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/rnp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3132,14 +3132,17 @@ rnp_verify_dest_provider(pgp_parse_handler_t *handler,
const char * filename,
uint32_t mtime)
{
RNP_LOG("here");
rnp_op_verify_t op = (rnp_op_verify_t) handler->param;
if (!op->output) {
RNP_LOG("here");
return false;
}
*dst = &(op->output->dst);
*closedst = false;
op->filename = filename ? std::string(filename) : "";
op->file_mtime = mtime;
RNP_LOG("here");
return true;
}

Expand Down
7 changes: 7 additions & 0 deletions src/librepgp/stream-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ src_read(pgp_source_t *src, void *buf, size_t len, size_t *readres)
bool readahead = cache ? cache->readahead : false;

if (src->error) {
RNP_LOG("here");
return false;
}

if (src->eof || (len == 0)) {
*readres = 0;
RNP_LOG("here");
return true;
}

Expand Down Expand Up @@ -96,8 +98,10 @@ src_read(pgp_source_t *src, void *buf, size_t len, size_t *readres)
// If there is no cache or chunk is larger then read directly
if (!src->read(src, buf, left, &read)) {
src->error = 1;
RNP_LOG("here");
return false;
}
//RNP_LOG("here: %p %zu", src->read, read);

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
if (!read) {
src->eof = 1;
len = len - left;
Expand All @@ -109,8 +113,10 @@ src_read(pgp_source_t *src, void *buf, size_t len, size_t *readres)
// Try to fill the cache to avoid small reads
if (!src->read(src, &cache->buf[0], sizeof(cache->buf), &read)) {
src->error = 1;
RNP_LOG("here");
return false;
}
//RNP_LOG("here: %p %zu", src->read, read);

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
if (!read) {
src->eof = 1;
len = len - left;
Expand All @@ -129,6 +135,7 @@ src_read(pgp_source_t *src, void *buf, size_t len, size_t *readres)
}

finish:
//RNP_LOG("here: %p", src->read);

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
src->readb += len;
if (src->knownsize && (src->readb == src->size)) {
src->eof = 1;
Expand Down
Loading

0 comments on commit dc32ec4

Please sign in to comment.