Commit 4df6a2bf authored by Claes Sjofors's avatar Claes Sjofors

Class cache, fix for V4.8.2 and V4.6

parent ab17c070
......@@ -649,7 +649,7 @@ createObject (
if (body == NULL && bodySize > 0)
return NULL;
if (op->g.size < bodySize)
if ( bodySize != 0 && op->g.size < bodySize - 4) // Allow missing alignment for 4.6
return NULL;
if (bodySize > 0)
......
......@@ -1758,7 +1758,7 @@ ndc_NarefToRaref(
}
}
if (l_ccp != ccp) {
if (l_ccp != ccp && l_ccp->flags.b.cacheLock) {
cmvolc_UnlockClass(NULL, l_ccp);
}
......@@ -1836,7 +1836,7 @@ ndc_NarefToRaref(
}
}
if (l_ccp != ccp) {
if (l_ccp != ccp && l_ccp->flags.b.cacheLock) {
cmvolc_UnlockClass(NULL, l_ccp);
}
......
......@@ -339,6 +339,36 @@ ConvertGet (
}
}
/* Fix for getGclassR message from from V4.8.2 with incompatible ClassDef element */
if (get->type.s == (qcom_eStype)net_eMsg_getGclassR) {
int sts = ((net_sGetGclassR *)get->data)->sts;
if ( sts & 1) {
int *ip = (int *) &((net_sGetGclassR *)get->data)->gclass.bo;
int size = get->size - ((char *)ip - (char *)get->data) - 4;
if ( *ip == 0 && ((net_sGetGclassR *)get->data)->attr[0].ao.oid.vid == 0) {
char *tmp = malloc(size);
memcpy( tmp, ip + 1, size);
memcpy( ip, tmp, size);
get->size -= 4;
free(tmp);
int i;
int acount = ((net_sGetGclassR *)get->data)->gclass.acount;
for ( i = 0; i < acount; i++) {
ip = (int *) &((net_sGetGclassR *)get->data)->attr[i];
size = get->size - ((char *)ip - (char *)get->data) - 4;
if ( size <= 0)
break;
char *tmp = malloc(size);
memcpy( tmp, ip + 1, size);
memcpy( ip, tmp, size);
get->size -= 4;
free(tmp);
}
}
}
}
if (np == qdb->my_node || np->bo == qdb->my_node->bo) {
if (get->data != data) memcpy(data, get->data, get->size);
pwr_Return(TRUE, sts, NET__SUCCESS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment