Lines Matching refs:context
37 bool HdcFile::BeginTransfer(CtxFile *context, const string &command) in BeginTransfer() argument
50 if (!SetMasterParameters(context, command.c_str(), argc, argv)) { in BeginTransfer()
56 …uv_fs_open(loopTask, &context->fsOpenReq, context->localPath.c_str(), O_RDONLY, S_IWUSR | S_IRUSR,… in BeginTransfer()
57 context->master = true; in BeginTransfer()
61 LogMsg(MSG_FAIL, "Transfer path failed, Master:%s Slave:%s", context->localPath.c_str(), in BeginTransfer()
62 context->remotePath.c_str()); in BeginTransfer()
68 bool HdcFile::SetMasterParameters(CtxFile *context, const char *command, int argc, char **argv) in SetMasterParameters() argument
79 context->transferConfig.compressType = COMPRESS_LZ4; in SetMasterParameters()
82 context->transferConfig.updateIfNew = true; in SetMasterParameters()
89 context->transferConfig.holdTimestamp = true; in SetMasterParameters()
92 context->transferConfig.clientCwd = argv[i + 1]; in SetMasterParameters()
95 context->fileModeSync = true; in SetMasterParameters()
108 context->remotePath = argv[argc - 1]; in SetMasterParameters()
109 context->localPath = argv[argc - 2]; in SetMasterParameters()
116 ExtractRelativePath(context->transferConfig.clientCwd, context->localPath); in SetMasterParameters()
119 context->remotePath = "."; in SetMasterParameters()
120 context->localPath = argv[argc - 1]; in SetMasterParameters()
124 context->localName = Base::GetFullFilePath(context->localPath); in SetMasterParameters()
127 …if (!Base::CheckDirectoryOrPath(context->localPath.c_str(), true, true, errStr, mode) && (mode & S… in SetMasterParameters()
128 context->isDir = true; in SetMasterParameters()
129 GetSubFilesRecursively(context->localPath, context->localName, &context->taskQueue); in SetMasterParameters()
130 if (context->taskQueue.size() == 0) { in SetMasterParameters()
134 context->fileCnt = 0; in SetMasterParameters()
135 context->dirSize = 0; in SetMasterParameters()
136 context->localDirName = Base::GetPathWithoutFilename(context->localPath); in SetMasterParameters()
138 WRITE_LOG(LOG_DEBUG, "context->localDirName = %s", context->localDirName.c_str()); in SetMasterParameters()
140 context->localName = context->taskQueue.back(); in SetMasterParameters()
141 context->localPath = context->localDirName + context->localName; in SetMasterParameters()
143 WRITE_LOG(LOG_DEBUG, "localName = %s context->localPath = %s", context->localName.c_str(), in SetMasterParameters()
144 context->localPath.c_str()); in SetMasterParameters()
145 context->taskQueue.pop_back(); in SetMasterParameters()
150 void HdcFile::CheckMaster(CtxFile *context) in CheckMaster() argument
153 if (context->fileModeSync) { in CheckMaster()
154 string s = SerialStruct::SerializeToString(context->fileMode); in CheckMaster()
157 string s = SerialStruct::SerializeToString(context->transferConfig); in CheckMaster()
162 void HdcFile::WhenTransferFinish(CtxFile *context) in WhenTransferFinish() argument
166 context->fileCnt++; in WhenTransferFinish()
167 context->dirSize += context->indexIO; in WhenTransferFinish()
171 void HdcFile::TransferSummary(CtxFile *context) in TransferSummary() argument
174 (context->fileCnt > 1 ? context->transferDirBegin : context->transferBegin); in TransferSummary()
175 uint64_t fSize = context->fileCnt > 1 ? context->dirSize : context->indexIO; in TransferSummary()
177 if (context->indexIO >= context->fileSize) { in TransferSummary()
180 fSize, context->fileCnt, nMSec, fRate); in TransferSummary()
184 uv_strerror_r(static_cast<int>(-context->lastErrno), buf, bufSize); in TransferSummary()
185 …LogMsg(MSG_FAIL, "Transfer Stop at:%lld/%lld(Bytes), Reason: %s", context->indexIO, context->fileS… in TransferSummary()
199 mode.fullName.c_str(), mode.perm, mode.u_id, mode.g_id, mode.context.c_str()); in FileModeSync()
217 … dirMode.fullName.c_str(), dirMode.perm, dirMode.u_id, dirMode.g_id, dirMode.context.c_str()); in FileModeSync()
239 … dirMode.fullName.c_str(), dirMode.perm, dirMode.u_id, dirMode.g_id, dirMode.context.c_str()); in FileModeSync()
296 void HdcFile::TransferNext(CtxFile *context) in TransferNext() argument
300 context->localName = context->taskQueue.back(); in TransferNext()
301 context->localPath = context->localDirName + context->localName; in TransferNext()
302 context->taskQueue.pop_back(); in TransferNext()
304 context->localName.c_str(), context->localPath.c_str(), ctxNow.taskQueue.size()); in TransferNext()
307 …uv_fs_open(loopTask, &context->fsOpenReq, context->localPath.c_str(), O_RDONLY, S_IWUSR | S_IRUSR,… in TransferNext()