pr_crit("Wrong usage, at least one check must be 'true'.");
if (stat(location, &attr) == -1) {
- if (error_fn != NULL)
- error_fn(errno, "stat(%s) failed", location);
+ if (error_fn != NULL) {
+ error_fn(errno, "stat(%s) failed: %s", location,
+ strerror(errno));
+ }
return false;
}
* to reject the file anyway.
*/
arg->error = -EFBIG;
- return 0; /* Ugh. See fread(3) */
+ return 0; /* Ugh. See fwrite(3) */
}
return fwrite(data, size, nmemb, arg->dst);
pr_val_debug("HTTP GET: %s", uri);
res = curl_easy_perform(handler->curl);
+ pr_val_debug("Done. Total bytes transferred: %zu", args.total_bytes);
if (args.error == -EFBIG) {
pr_val_err("The file '%s' is too big (read: %zu bytes). Rejecting.",
__pr_op_err(int error, const char *format, ...)
{
PR_SIMPLE(LOG_ERR, op_config);
+ lock_mutex();
+ print_stack_trace(NULL);
+ unlock_mutex();
return error;
}
found = find_rrdp_uri(uris, uri);
if (found == NULL) {
+ pr_val_debug("I don't have state for this Update Notification; downloading snapshot...");
*result = RRDP_URI_NOTFOUND;
return 0;
}
if (strcmp(session_id, found->data.session_id) != 0) {
+ pr_val_debug("session_id changed from '%s' to '%s'.",
+ found->data.session_id, session_id);
*result = RRDP_URI_DIFF_SESSION;
return 0;
}
if (serial != found->data.serial) {
+ pr_val_debug("The serial changed from %lu to %lu.",
+ found->data.serial, serial);
*result = RRDP_URI_DIFF_SERIAL;
return 0;
}
+ pr_val_debug("The new Update Notification has the same session_id (%s) and serial (%lu) as the old one.",
+ session_id, serial);
*result = RRDP_URI_EQUAL;
return 0;
}
}
}
+ pr_val_debug("Downloading RRDP Update Notification...");
log_operation = reqs_errors_log_uri(uri_get_global(uri));
error = rrdp_parse_notification(uri, log_operation, force_snapshot,
&upd_notification);
/* No updates at the file (yet), didn't pushed to fnstack */
if (upd_notification == NULL) {
- pr_val_debug("No updates yet at '%s'.", uri_get_global(uri));
+ pr_val_debug("The Update Notification has not changed.");
goto upd_end;
}
+ pr_val_debug("The Update Notification changed.");
+
do {
/* Same flow as a session update */
if (force_snapshot) {
if (WIFEXITED(child_status)) {
/* Happy path (but also sad path sometimes). */
error = WEXITSTATUS(child_status);
- pr_val_debug("Child terminated with error code %d.",
+ pr_val_debug("The rsync sub-process terminated with error code %d.",
error);
if (!error)
goto release_args;