Fixes error multiple login, removed src/test/resources

Fixes #12
This commit is contained in:
DieGurke 2020-01-27 18:36:13 +01:00
parent 0715e69cd7
commit 6ab15547ec
3 changed files with 49 additions and 42 deletions

View File

@ -1,39 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="maven.pomderived" value="true"/> </attributes>
</attributes> </classpathentry>
</classpathentry> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> <attributes>
<attributes> <attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/> </attributes>
<attribute name="maven.pomderived" value="true"/> </classpathentry>
<attribute name="test" value="true"/> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
</attributes> <attributes>
</classpathentry> <attribute name="maven.pomderived" value="true"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> </attributes>
<attributes> </classpathentry>
<attribute name="maven.pomderived" value="true"/> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
</attributes> <attributes>
</classpathentry> <attribute name="test" value="true"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <attribute name="maven.pomderived" value="true"/>
<attributes> </attributes>
<attribute name="maven.pomderived" value="true"/> </classpathentry>
</attributes> <classpathentry kind="src" output="target/classes" path="src/main/java">
</classpathentry> <attributes>
<classpathentry kind="src" path="/envoy-common"/> <attribute name="optional" value="true"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> <attribute name="maven.pomderived" value="true"/>
<attributes> </attributes>
<attribute name="maven.pomderived" value="true"/> </classpathentry>
</attributes> <classpathentry kind="src" output="target/test-classes" path="src/test/java">
</classpathentry> <attributes>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> <attribute name="optional" value="true"/>
<attributes> <attribute name="maven.pomderived" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="test" value="true"/>
<attribute name="test" value="true"/> </attributes>
</attributes> </classpathentry>
</classpathentry> <classpathentry kind="output" path="target/classes"/>
<classpathentry kind="output" path="target/classes"/> </classpath>
</classpath>

View File

@ -50,5 +50,10 @@
<build> <build>
<finalName>envoy-server-standalone</finalName> <finalName>envoy-server-standalone</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build> </build>
</project> </project>

View File

@ -5,7 +5,10 @@ import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.jenkov.nioserver.*; import com.jenkov.nioserver.IMessageReader;
import com.jenkov.nioserver.Message;
import com.jenkov.nioserver.MessageBuffer;
import com.jenkov.nioserver.Socket;
import envoy.util.SerializationUtils; import envoy.util.SerializationUtils;
@ -47,10 +50,10 @@ public class ObjectMessageReader implements IMessageReader {
nextMessage.writeToMessage(buffer); nextMessage.writeToMessage(buffer);
// Get message length // Get message length
if (nextMessage.length - nextMessage.offset < 4) return; if (nextMessage.length < 4) return;
int length = SerializationUtils.bytesToInt(nextMessage.sharedArray, nextMessage.offset) + 4; int length = SerializationUtils.bytesToInt(nextMessage.sharedArray, nextMessage.offset) + 4;
if (nextMessage.length - nextMessage.offset >= length) { if (nextMessage.length >= length) {
Message message = messageBuffer.getMessage(); Message message = messageBuffer.getMessage();
message.writePartialMessageToMessage(nextMessage, nextMessage.offset + length); message.writePartialMessageToMessage(nextMessage, nextMessage.offset + length);
completeMessages.add(nextMessage); completeMessages.add(nextMessage);