bung87 / scorper

scorper is a micro and elegant web framework written in Nim
Apache License 2.0
81 stars 5 forks source link

chronos transport readXX apis seems not fit my needs #3

Closed bung87 closed 3 years ago

bung87 commented 3 years ago

chronos provide readLine which return string and silently fails.

well, I use buffer

chronos provide readUntill raise two kinds of exception that I can handle, but when exception occurs I dont know how much bytes read , the parsing logic heavily relies on it.

https://github.com/bung87/looper/blob/b02e79c73b8cb6afd6e5231b632c1b2d9cdb60a0/src/looper/http/multipartparser.nim#L239-L246

bung87 commented 3 years ago

use readOnce and check line end in own loop for now.