Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BufferedReader on Reader on input-port peeks-and-throws, not waiting for input to trickle in #1248

Open
metaleap opened this issue Jun 15, 2024 · 0 comments

Comments

@metaleap
Copy link
Contributor

From chat, by @metaleap:

somehow my use of httpds read-request-headers on a BufferedReader based on stdin immediately raises eof instead of waiting for actual input, what am I missing? (surely any reader backing a BufferedReader will take some time before something can be read!..)
minimal repro gist here

Runtime error on the read-request-headers call:

*** ERROR IN _/revrepl/main#main -- This object was raised: eof
*** ERROR IN std/misc/process#run-process__% -- 
*** ERROR IN "misc/process.ss"@28.35-28.46 [ProcessError]: process exited with non-zero status
--- irritants: "revrepl" 17920 (path: "revrepl" arguments: () environment: #f directory: #f stdin-redirection: #f stdout-redirection: #f stderr-redirection: #f pseudo-terminal: #f show-console: #f) 
--- continuation backtrace:
[0] raise                                                                              
[1] std/misc/process#run-process__%                                                                                                                                            ((if (procedure? _%check-status260866%_) _%check-status260866%_ std/misc/proc...

By @vyzo:

so my uderstanding of the problem is that gambit's read-subu8vector treats the need parameter as "don't block" while gerbil's reader treats the need parameter as "error if you can't read that many"
so there is impedance mismatch
which is not there if peek-u8 is used directly by making a buffered reader directly on top the of the port
also looking at the code, the issue is that raw-binary-input-port is missing some methods for BufferedReader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant