public void httpContents() throws Exception {
		this.doContinuation = false;

		// Are we low on free slots for incoming connections?
		boolean disableContinuation = false;
		if (MainDialog.listenThread.isLowOnFreeIncomingSlots()) {
			disableContinuation = true;
			D
					.out("Low in free incoming connection slots, disabling keep-alive connections");
		}

		this.write("Server: p300\r\n");
		this.write("Date: " + HTTP.getHTTPDate() + "\r\n");

		if (this.contentLength != -1) {
			this.write("Content-Length: " + this.contentLength + "\r\n");

			if (this.clientSupportsContinuation() && !disableContinuation) {
				this.doContinuation = true;
				this.write("Connection: Keep-Alive\r\n");
			}
			this.write("\r\n");
		} else {
			if (this.clientSupportsChunkedEncoding()
					&& this.clientSupportsContinuation()
					&& !disableContinuation) {
				// System.out.println ("Using chunked encoding!");
				this.write("Transfer-Encoding: chunked\r\n");
				this.write("Connection: Keep-Alive\r\n");
				this.write("\r\n");
				this.useChunkedEncoding = true;
				this.doContinuation = true;
				this.chunkedEncodingHelper = new ChunkedEncodingHelper(
						this.connection);
			} else {
				this.useChunkedEncoding = false;
				this.write("Connection: close\r\n");
				this.write("\r\n");
			}

		}

		// commented out and moved to above, it would mess up the
		// chunked encoding
		// write("\n");

		this.atContent = true;
		this.written = 0;

		this.flush();
	}