mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-29 15:43:52 +00:00
fix packet sending functions
This commit is contained in:
parent
d8f1c3dff7
commit
512c3af4ea
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user