chraft/c-raft — Issue #152: "String field too long" IOException
Author: daniel-sage
Created: 2011-12-23 03:41:13+00:00
State: open

I was attempting to eat a cake when Visual Studio took focus because the server got the following exception:

```
System.IO.IOException was unhandled by user code
Message=String field too long
Source=Chraft
StackTrace:
at Chraft.Net.PacketReader.ReadString16(Int16 maxLen) in C:\chraft-c-raft-7f2058c\Chraft\Net\PacketReader.cs:line 147
at Chraft.Net.Packets.LoginRequestPacket.Read(PacketReader reader) in C:\chraft-c-raft-7f2058c\Chraft\Net\Packets\Packet.cs:line 186
at Chraft.Net.PacketHandlers.ReadLoginRequest(Client client, PacketReader reader) in C:\chraft-c-raft-7f2058c\Chraft\Net\PacketHandlers.cs:line 90
at Chraft.Server.b__7(Int32 i) in C:\chraft-c-raft-7f2058c\Chraft\Server.cs:line 406
at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.b__c()
InnerException:
```

I found the value of `len` to be `2561`. I don't see why the server was parsing a `LoginRequestPacket` as this was well after I logged into the server.

I am using an unmodified zip of commit 7f2058cf46.