Start writing to your file after receiving "$crlf $crlf" (the empty line between header and body).