about summary refs log tree commit diff stats
path: root/src/server
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-25 15:49:04 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-25 15:49:04 +0100
commit36c7878bd71058b1c16a9e1ef2fd7e60bbf40fde (patch)
treeb35445e09e69c2e006f10528d82b52f062339fa3 /src/server
parented6c9ef56eec768803b17abd808039d95227b4a4 (diff)
downloadchawan-36c7878bd71058b1c16a9e1ef2fd7e60bbf40fde.tar.gz
buffer: remove incorrect assertions
`confidence' becomes ccCertain when PRES_STOP is returned, so asserting
the opposite is incorrect (and was resulting in crashes).
Diffstat (limited to 'src/server')
-rw-r--r--src/server/buffer.nim3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index 7e002a31..aef50329 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -669,14 +669,12 @@ proc decodeData(buffer: Buffer, iq: openArray[uint8]): bool =
     case buffer.decoder.decode(iq, oq.toOpenArrayByte(0, oq.high), n)
     of tdrDone:
       if not buffer.processData0(oq.toOpenArray(0, n - 1)):
-        assert buffer.canSwitch
         buffer.switchCharset()
         return false
       break
     of tdrReqOutput:
       # flush output buffer
       if not buffer.processData0(oq.toOpenArray(0, n - 1)):
-        assert buffer.canSwitch
         buffer.switchCharset()
         return false
       n = 0
@@ -699,7 +697,6 @@ proc validateData(buffer: Buffer, iq: openArray[char]): bool =
         doAssert buffer.processData0(buffer.validateBuf)
         buffer.validateBuf.setLen(0)
       if not buffer.processData0(iq.toOpenArray(pi, n)):
-        assert buffer.canSwitch
         buffer.switchCharset()
         return false
       buffer.validateBuf.add(iq.toOpenArray(n + 1, iq.high))