int length, char line[STR_MAXLINE] = ""; 

stream_handle = accept_request (socket, peer_info.rq_id),
{
  listen_socket (&peer_info, socket), { peer_info = . };
};

while (chars (stream_handle))
{
  char byte = read (&_, -_, stream_handle);

  line[length] = byte; length ++;
  line[length] = 0;

  if (length == array_length (line) - 1 | byte = STR_END_OF_LINE)
  {
    ...

    length, line[length] = 0; break;
  }
}