1
0
mirror of https://github.com/deavminet/dnetd synced 2024-09-21 17:53:39 +02:00

Fixed segmentation fault

This commit is contained in:
Tristan B. Kildaire 2021-01-30 12:50:44 +02:00
parent 9f7330a3df
commit 068636cde7

View File

@ -87,6 +87,7 @@ public final class DLink : Thread
/* Set the worker thread for outbound connections */ /* Set the worker thread for outbound connections */
super(&outboundWorker); super(&outboundWorker);
this.server = server;
this.name = name; this.name = name;
this.address = address; this.address = address;
@ -154,6 +155,8 @@ public final class DLink : Thread
byte[] data; byte[] data;
data ~= [1]; data ~= [1];
gprintln("Here", DebugType.WARNING);
/* TODO: Encode [serverNameLen, serverName] */ /* TODO: Encode [serverNameLen, serverName] */
string serverName = server.getGeneralConfig().getName(); string serverName = server.getGeneralConfig().getName();
data ~= [cast(byte)serverName.length]; data ~= [cast(byte)serverName.length];
@ -175,7 +178,7 @@ public final class DLink : Thread
{ {
/* TODO: Get server name, makes sure it matches on in config file */ /* TODO: Get server name, makes sure it matches on in config file */
} }
else if(dataReply[0] == 1) else if(dataReply[0] == 1)
{ {