Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [iot-wg] Leshan: Registered links removed on registration update with empty payload

Hi,
Thanks for the issue report, 
This is not but the best place since Leshan is not an Eclipse project (even if this will probably change in a near future :).
The best place is probably leshan github issue tracker or the leshan mailling list (in CC).
Julien

Le 13 juil. 2014 21:22, "Michael Koster" <michaeljohnkoster@xxxxxxxxx> a écrit :
Hi,

I’m not sure if this is the right place, so please redirect me as necessary. 

I’ve been using the Leshan sandbox server to debug some LWM2M client libraries and am hitting what looks like a server problem.

I found what I believe to be an error in handling of LWM2M registration updates. 

Leshan appears to be clearing the registered resource links on registration update. 

It appears that Leshan expects a NULL return value from the Californium library request.getPayload() if the payload is empty. 

If it thinks there is a payload by the value being non-null, it replaces the contents of the links:

        if (request.getPayload() != null) {
            objectLinks = new String(request.getPayload(), Charsets.UTF_8).split(",");
        }

        ClientUpdate client = new ClientUpdate(registrationId, request.getSource(), request.getSourcePort(), lifetime,
                smsNumber, binding, objectLinks);

But Californium signals an empty payload with a zero length array of bytes (wondering in the comments if it should be NULL instead)


if (nextByte == PAYLOAD_MARKER) {
// the presence of a marker followed by a zero-length payload must be processed as a message format error
if (!reader.bytesAvailable())
throw new IllegalStateException();

// get payload
message.setPayload(reader.readBytesLeft());
} else {
message.setPayload(new byte[0]); // or null?
}


_______________________________________________
iot-wg mailing list
iot-wg@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/iot-wg

Back to the top