Index: /trunk/include/CRXHttpMessage.h
===================================================================
--- /trunk/include/CRXHttpMessage.h	(revision 43)
+++ /trunk/include/CRXHttpMessage.h	(revision 44)
@@ -6,4 +6,7 @@
 
 #include <string>
+
+#define CRLF				"\r\n"
+#define CRLF2				"\r\n\r\n"	
 
 class CRXHttpMessage
@@ -26,6 +29,4 @@
 
 	void			ResetMessage	(void);
-
-	virtual CRXHttpMessage &	operator =	(const char * aHttpMessage) = 0;
 };
 
Index: /trunk/include/CRXHttpRequest.h
===================================================================
--- /trunk/include/CRXHttpRequest.h	(revision 43)
+++ /trunk/include/CRXHttpRequest.h	(revision 44)
@@ -31,6 +31,4 @@
 	std::string			GetHeader			(void) const;
 
-	CRXHttpRequest &	operator =			(const char * aHttpRequest);
-
 public:
 	std::string			GetURL				(void) const;
Index: /trunk/include/CRXHttpResponse.h
===================================================================
--- /trunk/include/CRXHttpResponse.h	(revision 43)
+++ /trunk/include/CRXHttpResponse.h	(revision 44)
@@ -32,6 +32,4 @@
 private:
 	void				Parse				(void);
-	int					ParseContent		(const char	* aContent,
-											 const int	aLength);
 	void				Reset				(void);
 	void				ResetContent		(void);
@@ -40,11 +38,13 @@
 	int					GetStatusCode		(void) const;
 
-	int					SetResponse			(const char	* aHttpResponse,
+	bool				IsChunked			(void) const;
+	int					SetResponseAll		(const char	* aHttpResponse,
 											 const int	aResponseLength);
+	void				SetHeader			(const char	* aHttpResponse);
 	std::string			GetHeader			(void) const;
+	int					SetContent			(const char	* aContent,
+											 const int	aLength);
 	const char *		GetContentBody		(void) const;
 	int					GetContentLength	(void) const;
-
-	CRXHttpResponse &	operator =			(const char	* aHttpResponse);
 };
 
Index: /trunk/include/CRXProxy.h
===================================================================
--- /trunk/include/CRXProxy.h	(revision 43)
+++ /trunk/include/CRXProxy.h	(revision 44)
@@ -38,10 +38,6 @@
 	~CRXProxy			(void);
 
-	static CRXProxy *	GetNewInstance	(void);
-
 public:
 	/* common utilities */
-	void	ReleaseInstance				(void);
-
 	void	SetClientSocket				(const int	aSocket);
 	void	SetServerTimeout			(const int	aTimeout = TCPSOCKET_NO_TIMEOUT);
Index: /trunk/src/CRXHttpRequest.cpp
===================================================================
--- /trunk/src/CRXHttpRequest.cpp	(revision 43)
+++ /trunk/src/CRXHttpRequest.cpp	(revision 44)
@@ -48,14 +48,4 @@
 
 	return GetMessage ();
-}
-
-CRXHttpRequest &
-CRXHttpRequest::operator = (const char * aHttpMessage)
-{
-	/*----------------------------------------------------------------*/
-	SetHeader (aHttpMessage);
-	/*----------------------------------------------------------------*/
-
-	return *this;
 }
 
Index: /trunk/src/CRXHttpResponse.cpp
===================================================================
--- /trunk/src/CRXHttpResponse.cpp	(revision 43)
+++ /trunk/src/CRXHttpResponse.cpp	(revision 44)
@@ -12,7 +12,4 @@
 #include <string.h>
 
-#define CRLF				"\r\n"
-#define CRLF2				"\r\n\r\n"	
-
 #define CONTENT_LENGTH		"Content-Length: "
 #define TRANSFER_ENCODING	"Transfer-Encoding: "
@@ -56,6 +53,6 @@
 
 int
-CRXHttpResponse::SetResponse (const char	* aHttpResponse,
-							  const int		aResponseLength)
+CRXHttpResponse::SetResponseAll (const char	* aHttpResponse,
+								 const int	aResponseLength)
 {
 	int				aResult = 0;
@@ -70,5 +67,5 @@
 		return ERROR_HTTP_RESPONSE_INVALID_LENGTH;
 
-	if (GetHeader ().length () == 0)
+	if (GetHeader ().rfind (CRLF2) == std::string::npos)
 	{
 		aEndOfHeader = strstr (aHttpResponse, CRLF2);
@@ -80,11 +77,11 @@
 		aHeader.assign (aHttpResponse, aHeaderLength);
 
-		SetMessage (aHeader.c_str ());
-	}
-
-	aResult = ParseContent (aHttpResponse + aHeaderLength, aResponseLength - aHeaderLength);
+		SetHeader (aHeader.c_str ());
+	}
+
+	aResult = SetContent (aHttpResponse + aHeaderLength, aResponseLength - aHeaderLength);
 	if (aResult)
 	{
-		return ERROR_HTTP_RESPONSE_FAILED_TO_PARSE_CONTENT;
+		aResult = ERROR_HTTP_RESPONSE_FAILED_TO_PARSE_CONTENT;
 	}
 	/*----------------------------------------------------------------*/
@@ -93,12 +90,10 @@
 }
 
-CRXHttpResponse &
-CRXHttpResponse::operator = (const char * aHttpMessage)
+void
+CRXHttpResponse::SetHeader (const char * aHttpMessage)
 {
 	/*----------------------------------------------------------------*/
 	SetMessage (aHttpMessage);
 	/*----------------------------------------------------------------*/
-
-	return *this;
 }
 
@@ -166,5 +161,5 @@
 
 int
-CRXHttpResponse::ParseContent (const char	* aContent,
+CRXHttpResponse::SetContent (const char	* aContent,
 							   const int	aLength)
 {
@@ -207,4 +202,5 @@
 
 int				CRXHttpResponse::GetStatusCode		(void) const { return mStatusCode; }
+bool			CRXHttpResponse::IsChunked			(void) const { return mIsChunked; }
 int				CRXHttpResponse::GetContentLength	(void) const { return mContentLength; }
 const char *	CRXHttpResponse::GetContentBody		(void) const { return mContent.mBody; }
Index: /trunk/src/CRXProxy.cpp
===================================================================
--- /trunk/src/CRXProxy.cpp	(revision 43)
+++ /trunk/src/CRXProxy.cpp	(revision 44)
@@ -25,21 +25,4 @@
 }
 
-CRXProxy *
-CRXProxy::GetNewInstance (void)
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return new(std::nothrow) CRXProxy ();
-}
-
-void
-CRXProxy::ReleaseInstance (void)
-{
-	/*----------------------------------------------------------------*/
-	delete this;
-	/*----------------------------------------------------------------*/
-}
-
 void
 CRXProxy::SetClientSocket (const int aSocket)
@@ -141,5 +124,5 @@
 {
 	/*----------------------------------------------------------------*/
-	mHttpRequest = aHttpRequest;
+	mHttpRequest.SetHeader (aHttpRequest);
 	/*----------------------------------------------------------------*/
 }
@@ -158,5 +141,5 @@
 	if (aPtr == NULL)
 		return NULL;
-	
+
 	aCopyLength = aRemainLength < aHeaderLength ? aBufferSize : aHeaderLength;
 	if (aCopyLength > 0)
@@ -180,5 +163,5 @@
 {
 	/*----------------------------------------------------------------*/
-	mHttpResponse = aHttpResponse;
+	mHttpResponse.SetHeader (aHttpResponse);
 	/*----------------------------------------------------------------*/
 }
@@ -249,21 +232,25 @@
 CRXProxy::ReceiveRequest (void)
 {
-	int					aResult		= 0;
-
-	const unsigned int	aBufferSize	= 1024 * 56;
-	char				aBuffer[aBufferSize + 1] = {0x00, };
-
-	/*----------------------------------------------------------------*/
-	aResult = mClient.Receive (aBuffer, aBufferSize);
-	if (aResult < 0)
-	{
-		aResult = ERROR_PROXY_FAILED_TO_RECEIVE_REQUEST;
-		CRX_ADD_SUBCLASS_ERROR (mClient);
-		CRX_ERROR_SET (aResult, "Failed to receive from client.");
-		return aResult;
-	}
-
-	/* parse http request */
-	mHttpRequest = aBuffer;
+	int			aResult = 0;
+	char		aBuffer;
+
+	std::string	aHttpHeader;
+	/*----------------------------------------------------------------*/
+	for (;;)
+	{
+		aResult = mClient.Receive (&aBuffer, 1);
+		if (aResult < 0)
+		{
+			aResult = ERROR_PROXY_FAILED_TO_RECEIVE_REQUEST;
+			CRX_ADD_SUBCLASS_ERROR (mClient);
+			CRX_ERROR_SET (aResult, "Failed to receive from client.");
+			return aResult;
+		}
+		aHttpHeader += aBuffer;
+		if (aHttpHeader.rfind (CRLF2) != std::string::npos)
+			break;
+	}
+
+	mHttpRequest.SetHeader (aHttpHeader.c_str ());
 	/*----------------------------------------------------------------*/
 
@@ -292,7 +279,4 @@
 			return aResult;
 		}
-
-		if (getsockname (mServer, (struct sockaddr *) &aSockName, &aSockLen) == 0)
-			CRX_DEBUG_TRACE ("Connected on port number (%d)\n", ntohs (aSockName.sin_port));
 	}
 
@@ -315,6 +299,4 @@
 	const unsigned int	aBufferSize		= 1024 * 64;
 	char				aBuffer[aBufferSize + 1] = {0x00, };
-
-	std::string			aHttpResponse;
 
 	/*----------------------------------------------------------------*/
@@ -331,10 +313,6 @@
 			return aResult;
 		}
-		else if (aResult == 0)
-		{
-			break;
-		}
-
-		aResult = mHttpResponse.SetResponse (aBuffer, aResult);
+
+		aResult = mHttpResponse.SetResponseAll (aBuffer, aResult);
 		if (aResult)
 		{
@@ -343,12 +321,4 @@
 			return aResult;
 		}
-
-		if (!CheckRequestFilter (CRX_FILTER_REQUEST_FILE_EXTENSION) &&
-			mHttpResponse.GetContentLength () > 0)
-		{
-			CRX_DEBUG_TRACE_BIN (mHttpResponse.GetContentBody (),
-								 mHttpResponse.GetContentLength (),
-								 "");
-		}
 	}
 	/*----------------------------------------------------------------*/
Index: /trunk/src/main.cpp
===================================================================
--- /trunk/src/main.cpp	(revision 43)
+++ /trunk/src/main.cpp	(revision 44)
@@ -91,5 +91,5 @@
 		}
 
-		if ((aProxy = CRXProxy::GetNewInstance ()) == NULL)
+		if ((aProxy = new(std::nothrow) CRXProxy ()) == NULL)
 		{
 			cerr << "Failed to get proxy." << endl;
@@ -114,14 +114,22 @@
 			aHttpMessageLength = aProxy->GetHttpRequestLength ();
 			aHttpMessage = (char *) calloc (aHttpMessageLength + 1, 1);
-			cout << aProxy->GetHttpRequest (aHttpMessage, aHttpMessageLength) << endl;
+			aProxy->GetHttpRequest (aHttpMessage, aHttpMessageLength);
+			CRX_DEBUG_TRACE ("== Request: \n%s\n", aHttpMessage);
 			free (aHttpMessage);
 
 			aHttpMessageLength = aProxy->GetHttpResponseHeaderLength ();
 			aHttpMessage = (char *) calloc (aHttpMessageLength + 1, 1);
-			cout << aProxy->GetHttpResponseHeader (aHttpMessage, aHttpMessageLength) << endl;
+			aProxy->GetHttpResponseHeader (aHttpMessage, aHttpMessageLength);
+			CRX_DEBUG_TRACE ("== Response: \n%s\n", aHttpMessage);
+			free (aHttpMessage);
+
+			aHttpMessageLength = aProxy->GetHttpResponseBodyLength ();
+			aHttpMessage = (char *) calloc (aHttpMessageLength + 1, 1);
+			aProxy->GetHttpResponseBody (aHttpMessage, aHttpMessageLength);
+			CRX_DEBUG_TRACE_BIN (aHttpMessage, aHttpMessageLength, "== Content-Body: \n");
 			free (aHttpMessage);
 		}
 
-		aProxy->ReleaseInstance ();
+		delete aProxy;
 	}
 
