writing content-length message header