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;
|
size_t errm_size = 0;
|
||||||
int rep = 0;
|
int rep = 0;
|
||||||
|
|
||||||
if ((rep = this->Call(4, path, &errm, &errm_size)) == 0) {
|
rep = this->Call(4, path, &errm, &errm_size);
|
||||||
pdbg_logf(D_NOTICE, "rpc_get_state responese rep[%d] path[%s]", rep, path);
|
pdbg_logf(D_NOTICE, "rpc_get_state responese rep[%d] path[%s]", rep, path);
|
||||||
if (errm) {
|
if (errm) {
|
||||||
pdbg_logf(D_NOTICE, "The error is %s", errm);
|
pdbg_logf(D_NOTICE, "The error is %s", errm);
|
||||||
}
|
}
|
||||||
if (rep == 10) {
|
if (rep == 10) {
|
||||||
*state = FileStateInSync;
|
*state = FileStateInSync;
|
||||||
} else if (rep == 12) {
|
} else if (rep == 12) {
|
||||||
*state = FileStateInProgress;
|
*state = FileStateInProgress;
|
||||||
} else if (rep == 11) {
|
} else if (rep == 11) {
|
||||||
*state = FileStateNoSync;
|
*state = FileStateNoSync;
|
||||||
} else {
|
|
||||||
*state = FileStateInvalid;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
*state = FileStateInvalid;
|
||||||
pdbg_logf(D_ERROR, "rpc_get_state ERROR rep[%d] path[%s]", rep, path);
|
pdbg_logf(D_ERROR, "rpc_get_state ERROR rep[%d] path[%s]", rep, path);
|
||||||
}
|
}
|
||||||
if(errm) {
|
if(errm) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue