src/dird/fd_cmds.c
bool send_restore_objects(JCR *jcr)
{
   char ed1[50];
   POOL_MEM query(PM_MESSAGE);
   BSOCK *fd;
   OBJ_CTX octx;

   if (!jcr->JobIds || !jcr->JobIds[0]) {
      return true;
   }
   octx.jcr = jcr;
   octx.count = 0;

   /* restore_object_handler is called for each file found */

   /* send restore objects for all jobs involved  */
   Mmsg(query, get_restore_objects, jcr->JobIds, FT_RESTORE_FIRST);
   db_sql_query(jcr->db, query.c_str(), restore_object_handler, (void *)&octx);

   /* send config objects for the current restore job */
   Mmsg(query, get_restore_objects,
        edit_uint64(jcr->JobId, ed1), FT_PLUGIN_CONFIG_FILLED);
   db_sql_query(jcr->db, query.c_str(), restore_object_handler, (void *)&octx);

   /*
    * Send to FD only if we have at least one restore object.
    * This permits backward compatibility with older FDs.
    */
   if (octx.count > 0) {
      fd = jcr->file_bsock;
      fd->fsend("restoreobject end\n");
      if (!response(jcr, fd, OKRestoreObject, "RestoreObject", DISPLAY_ERROR)) {
         Jmsg(jcr, M_FATAL, 0, _("RestoreObject failed.\n"));
         return false;
      }
   }
   return true;
}
/*
 * Send the plugin Restore Objects, which allow the
 *  plugin to get information early in the restore
 *  process.  The RestoreObjects were created during
 *  the backup by the plugin.
 */
Send the plugin Restore Objects, which allow the
plugin to get information early in the restore
process.  The RestoreObjects were created during
the backup by the plugin.
Send the plugin Restore Objects which allow the plugin to get information early in the restore process . The RestoreObjects were created during the backup by the plugin .
bool send_restore_objects(JCR *jcr)
{
   char ed1[50];
   POOL_MEM query(PM_MESSAGE);
   BSOCK *fd;
   OBJ_CTX octx;
   if (!jcr->JobIds || !jcr->JobIds[0]) {
      return true;
   }
   octx.jcr = jcr;
   octx.count = 0;
   Mmsg(query, get_restore_objects, jcr->JobIds, FT_RESTORE_FIRST);
   db_sql_query(jcr->db, query.c_str(), restore_object_handler, (void *)&octx);
   Mmsg(query, get_restore_objects,
        edit_uint64(jcr->JobId, ed1), FT_PLUGIN_CONFIG_FILLED);
   db_sql_query(jcr->db, query.c_str(), restore_object_handler, (void *)&octx);
   if (octx.count > 0) {
      fd = jcr->file_bsock;
      fd->fsend("restoreobject end\n");
      if (!response(jcr, fd, OKRestoreObject, "RestoreObject", DISPLAY_ERROR)) {
         Jmsg(jcr, M_FATAL, 0, _("RestoreObject failed.\n"));
         return false;
      }
   }
   return true;
}
bool send_restore_objects ( JCR * jcr ) { char ed1 [ 50 ] ; POOL_MEM query ( PM_MESSAGE ) ; BSOCK * fd ; OBJ_CTX octx ; if ( ! jcr -> JobIds || ! jcr -> JobIds [ 0 ] ) { return true ; } octx . jcr = jcr ; octx . count = 0 ; Mmsg ( query , get_restore_objects , jcr -> JobIds , FT_RESTORE_FIRST ) ; db_sql_query ( jcr -> db , query . c_str ( ) , restore_object_handler , ( void * ) & octx ) ; Mmsg ( query , get_restore_objects , edit_uint64 ( jcr -> JobId , ed1 ) , FT_PLUGIN_CONFIG_FILLED ) ; db_sql_query ( jcr -> db , query . c_str ( ) , restore_object_handler , ( void * ) & octx ) ; if ( octx . count > 0 ) { fd = jcr -> file_bsock ; fd -> fsend ( " \n " ) ; if ( ! response ( jcr , fd , OKRestoreObject , " " , DISPLAY_ERROR ) ) { Jmsg ( jcr , M_FATAL , 0 , _ ( " \n " ) ) ; return false ; } } return true ; }
Send the plugin Restore Objects, which allow the
  plugin to get information early in the restore
  process.
Send the plugin Restore Objects which allow the plugin to get information early in the restore process .
/* restore_object_handler is called for each file found */ /* send restore objects for all jobs involved  */ /* send config objects for the current restore job */ /*
    * Send to FD only if we have at least one restore object.
    * This permits backward compatibility with older FDs.
    */