ObjectSize = str_to_uint64(p);
}
+
+void parse_restore_object_string(char **r_obj_str, ROBJECT_DBR *robj_r)
+{
+ char *p = *r_obj_str;
+ int len;
+
+ robj_r->FileIndex = str_to_int32(p); /* FileIndex */
+ skip_nonspaces(&p);
+ skip_spaces(&p);
+ robj_r->FileType = str_to_int32(p); /* FileType */
+ skip_nonspaces(&p);
+ skip_spaces(&p);
+ robj_r->object_index = str_to_int32(p); /* Object Index */
+ skip_nonspaces(&p);
+ skip_spaces(&p);
+ robj_r->object_len = str_to_int32(p); /* object length possibly compressed */
+ skip_nonspaces(&p);
+ skip_spaces(&p);
+ robj_r->object_full_len = str_to_int32(p); /* uncompressed object length */
+ skip_nonspaces(&p);
+ skip_spaces(&p);
+ robj_r->object_compression = str_to_int32(p); /* compression */
+ skip_nonspaces(&p);
+ skip_spaces(&p);
+
+ robj_r->plugin_name = p; /* point to plugin name */
+ len = strlen(robj_r->plugin_name);
+ robj_r->object_name = &robj_r->plugin_name[len+1]; /* point to object name */
+ len = strlen(robj_r->object_name);
+ robj_r->object = &robj_r->object_name[len+1]; /* point to object */
+ robj_r->object[robj_r->object_len] = 0; /* add zero for those who attempt printing */
+ Dmsg7(100, "oname=%s stream=%d FT=%d FI=%d JobId=%ld, obj_len=%d\nobj=\"%s\"\n",
+ robj_r->object_name, robj_r->Stream, robj_r->FileType, robj_r->FileIndex, robj_r->JobId,
+ robj_r->object_len, robj_r->object);
+}
#endif /* HAVE_SQLITE3 || HAVE_MYSQL || HAVE_POSTGRESQL */
break;
}
- case STREAM_PLUGIN_OBJECT:
- {
- OBJECT_DBR obj_r;
- char *buf = rec->data;
- num_plugin_objects++;
-
- skip_nonspaces(&buf); /* Skip FileIndex */
- skip_spaces(&buf);
- skip_nonspaces(&buf); /* Skip FileType */
- skip_spaces(&buf);
-
- parse_plugin_object_string(&buf, &obj_r);
-
- // Need to get new jobId if possible
- mjcr = get_jcr_by_session(rec->VolSessionId, rec->VolSessionTime);
- if (!mjcr) {
- Pmsg2(000, _("Could not find SessId=%d SessTime=%d for PluginObject record.\n"),
- rec->VolSessionId, rec->VolSessionTime);
- break;
- }
-
- obj_r.JobId = mjcr->JobId;
-
- if (db_get_plugin_object_record(mjcr, db, &obj_r)) {
- if (verbose) {
- Pmsg1(0, _("RESTORE_OBJECT: Found Plugin Object \"%s\" in the catalog\n"), obj_r.ObjectName);
- }
- } else if (update_db) {
- /* Send it */
- Pmsg1(0, _("PLUGIN_OBJECT: Inserting Plugin Object \"%s\" into the catalog\n"), obj_r.ObjectName);
- if (!db_create_object_record(mjcr, db, &obj_r)) {
- Jmsg1(mjcr, M_FATAL, 0, _("Plugin object create error. %s"), db_strerror(db));
- }
- } else {
- Pmsg1(0, _("PLUGIN_OBJECT: Found Plugin Object \"%s\" on the volume\n"), obj_r.ObjectName);
- }
-
- break;
- }
-
case STREAM_PLUGIN_OBJECT:
{
OBJECT_DBR obj_r;