Fix pcl-ue8: operator precedence in GetState() (#360)
Separated assignment from condition so rep contains Call() return value. Removed incorrect wrapper that prevented state checks from executing. Now rep values 10/11/12 properly set state. Fixes #180 Co-authored-by: Levi Neely <lkn@darkstar.example.net>
This commit is contained in:
parent
f17fb19b85
commit
1bf831c00f
|
|
@ -161,21 +161,19 @@ int RpcClient::GetState(pCloud_FileState *state, char *path) {
|
|||
size_t errm_size = 0;
|
||||
int rep = 0;
|
||||
|
||||
if ((rep = this->Call(4, path, &errm, &errm_size)) == 0) {
|
||||
pdbg_logf(D_NOTICE, "rpc_get_state responese rep[%d] path[%s]", rep, path);
|
||||
if (errm) {
|
||||
pdbg_logf(D_NOTICE, "The error is %s", errm);
|
||||
}
|
||||
if (rep == 10) {
|
||||
*state = FileStateInSync;
|
||||
} else if (rep == 12) {
|
||||
*state = FileStateInProgress;
|
||||
} else if (rep == 11) {
|
||||
*state = FileStateNoSync;
|
||||
} else {
|
||||
*state = FileStateInvalid;
|
||||
}
|
||||
rep = this->Call(4, path, &errm, &errm_size);
|
||||
pdbg_logf(D_NOTICE, "rpc_get_state responese rep[%d] path[%s]", rep, path);
|
||||
if (errm) {
|
||||
pdbg_logf(D_NOTICE, "The error is %s", errm);
|
||||
}
|
||||
if (rep == 10) {
|
||||
*state = FileStateInSync;
|
||||
} else if (rep == 12) {
|
||||
*state = FileStateInProgress;
|
||||
} else if (rep == 11) {
|
||||
*state = FileStateNoSync;
|
||||
} else {
|
||||
*state = FileStateInvalid;
|
||||
pdbg_logf(D_ERROR, "rpc_get_state ERROR rep[%d] path[%s]", rep, path);
|
||||
}
|
||||
if(errm) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue