X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=remote.cc;h=6d80b02ef04fbbfa8298c776da6973e7ae2b39a1;hb=f1f817df56ce99ea544569635698df55d72bd1ee;hp=a279751ffbd73f010e5d65220fa4b2ae8b2e619f;hpb=b41d7697d060b3675ae160ef8b88c51e642b0c99;p=cumulus.git diff --git a/remote.cc b/remote.cc index a279751..6d80b02 100644 --- a/remote.cc +++ b/remote.cc @@ -67,13 +67,13 @@ RemoteStore::~RemoteStore() * will initially be created in a temporary directory. When the file is * written out, the RemoteFile object should be passed to RemoteStore::enqueue, * which will upload it to the remote server. */ -RemoteFile *RemoteStore::alloc_file(const string &name) +RemoteFile *RemoteStore::alloc_file(const string &name, const string &type) { fprintf(stderr, "Allocate file: %s\n", name.c_str()); pthread_mutex_lock(&lock); files_outstanding++; pthread_mutex_unlock(&lock); - return new RemoteFile(this, name, staging_dir + "/" + name); + return new RemoteFile(this, name, type, staging_dir + "/" + name); } /* Request that a file be transferred to the remote server. The actual @@ -153,7 +153,8 @@ void RemoteStore::transfer_thread() } if (pid == 0) { string cmd = backup_script; - cmd += " " + file->local_path + " " + file->remote_path; + cmd += " " + file->local_path + " " + file->type + " " + + file->remote_path; execlp("/bin/sh", "/bin/sh", "-c", cmd.c_str(), NULL); throw IOException("exec failed"); } @@ -177,9 +178,11 @@ void RemoteStore::transfer_thread() } RemoteFile::RemoteFile(RemoteStore *remote, - const string &name, const string &local_path) + const string &name, const string &type, + const string &local_path) { remote_store = remote; + this->type = type; this->local_path = local_path; this->remote_path = name;