back2dos / foxhole

Standalone neko web server.
The Unlicense
23 stars 2 forks source link

getPostData throws #4

Closed benmerckx closed 8 years ago

benmerckx commented 8 years ago

So I've been trying to get enough info from your code here to parse the body of a tink_http request to String. I kept getting nowhere and decided to test with foxhole itself and I'm running into the same issue. Running Web.getPostData() always throws:

[...]
Called from tink/io/Pipe.hx line 38
Called from tink/io/Pipe.hx line 44
Called from tink/io/Sink.hx line 179
Uncaught exception - Error: Uncaught exception: Invalid call tink.runloop.QueueWorker.execute:70

This happens somewhere in the pipeTo call, the handle is never reached. I've been going through tink_io but I'm not really sure how to debug this.

back2dos commented 8 years ago

Yeah, I'm afraid tink_io will just be one of those libs who's code will just drive its readers crazy. I hope to find the time soon to properly cover it with tests though. Correct weird code is already a step up from incorrect weird code.

This was a twofold issue, one by tink_io's buffer pooling that caused some data to be lost, one by some weirdness in Haxe that I worked around (accessing Worker.DEFAULT did not call the getter and caused the null-reference you got).

I've just submitted a new version that should fix both problems. Could you confirm that please?

benmerckx commented 8 years ago

This fixes it, thanks!