fix packet sending functions

This commit is contained in:
Grant Limberg 2017-07-12 13:12:45 -07:00
parent d8f1c3dff7
commit 512c3af4ea
2 changed files with 16 additions and 5 deletions

View File

@ -443,11 +443,22 @@ namespace {
LOGV("Calling onDataStoreGet(%s, %p)", p, buffer);
return (int)env->CallLongMethod(
int retval = (int)env->CallLongMethod(
ref->dataStoreGetListener,
dataStoreGetCallbackMethod,
nameStr,
bufferObj);
LOGV("onDataStoreGet returned %d", retval);
if(retval > 0)
{
void *data = env->GetPrimitiveArrayCritical(bufferObj, NULL);
memcpy(buffer, data, retval);
env->ReleasePrimitiveArrayCritical(bufferObj, data, 0);
}
return retval;
}
int WirePacketSendFunction(ZT_Node *node,
@ -459,7 +470,7 @@ namespace {
unsigned int bufferSize,
unsigned int ttl)
{
LOGV("WirePacketSendFunction(%ld, %p, %p, %d)", localSocket, remoteAddress, buffer, bufferSize);
LOGV("WirePacketSendFunction(%lld, %p, %p, %d)", (long long)localSocket, remoteAddress, buffer, bufferSize);
JniRef *ref = (JniRef*)userData;
assert(ref->node == node);

View File

@ -173,12 +173,12 @@ public class Node {
*/
public ResultCode processWirePacket(
long now,
InetSocketAddress localAddress,
long localSocket,
InetSocketAddress remoteAddress,
byte[] packetData,
long[] nextBackgroundTaskDeadline) {
return processWirePacket(
nodeId, now, localAddress, remoteAddress, packetData,
nodeId, now, localSocket, remoteAddress, packetData,
nextBackgroundTaskDeadline);
}
@ -426,7 +426,7 @@ public class Node {
private native ResultCode processWirePacket(
long nodeId,
long now,
InetSocketAddress localAddress,
long localSocket,
InetSocketAddress remoteAddress,
byte[] packetData,
long[] nextBackgroundTaskDeadline);