Hi.
I recently discovered Julia, and like it a lot so far. After porting some code I'd written in Go, I decided to write a simple SCGI library to be run behind Nginx for a toy project.
The code can be found here:
https://github.com/oal/SCGI.jlI use readbytes to read the incoming request headers from Nginx, which works as expected. Though when I try to read the request body, it blocks (waits for more data until the request times out) even though I tell it to only read the length of the request body (CONTENT_LENGTH). However, when I use array comprehension and do "ns.content = [read(ns.socket, Uint8) for i = 1:int(ns.headers["CONTENT_LENGTH"])]", it reads what I want, and returns the response.
Here's the line that works. The line below (commented out) will block, even though it should read the same amount of bytes:
https://github.com/oal/SCGI.jl/blob/85117bb3fabed3e88b305b16eca066046c76ec33/scgi.jl#L53 Or am I missing something?
Julia version: 0.2.0-prerelease+3051