You're reading `buflen` bytes, but `buflen` grows each time.  I think you want `CF_BUFSIZE` here.