Index: trunk/src/CRXProxy.cpp
===================================================================
--- trunk/src/CRXProxy.cpp	(revision 44)
+++ trunk/src/CRXProxy.cpp	(revision 45)
@@ -9,10 +9,12 @@
 CRXFilter	CRXProxy::mFilter;
 
-CRXProxy::CRXProxy (void)
-	: mClient (0),
-	  mServer (0),
-	  mServerTimeout (0)
-{
-	/*----------------------------------------------------------------*/
+CRXProxy::CRXProxy (const int aSocket)
+	: mServerTimeout (0)
+{
+	/*----------------------------------------------------------------*/
+	if (aSocket < 0)
+		return ;
+
+	mClient = aSocket;
 	/*----------------------------------------------------------------*/
 }
@@ -22,15 +24,4 @@
 	/*----------------------------------------------------------------*/
 	Close ();
-	/*----------------------------------------------------------------*/
-}
-
-void
-CRXProxy::SetClientSocket (const int aSocket)
-{
-	/*----------------------------------------------------------------*/
-	if (aSocket <= 0)
-		return ;
-
-	mClient = aSocket;
 	/*----------------------------------------------------------------*/
 }
@@ -51,31 +42,4 @@
 	mClient.Close ();
 	/*----------------------------------------------------------------*/
-}
-
-void
-CRXProxy::SetRequestFilter (const E_CRX_FILTER_REQUEST	aType,
-							const bool					aIsMatched,
-							const std::string			aValue)
-{
-	/*----------------------------------------------------------------*/
-	mFilter.SetRequestFilter (aType, aIsMatched, aValue);
-	/*----------------------------------------------------------------*/
-}
-
-void
-CRXProxy::RemoveRequestFilter (const E_CRX_FILTER_REQUEST aType)
-{
-	/*----------------------------------------------------------------*/
-	mFilter.RemoveRequestFilter (aType);
-	/*----------------------------------------------------------------*/
-}
-
-bool
-CRXProxy::CheckRequestFilter (const E_CRX_FILTER_REQUEST aType)
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mFilter.CheckRequestFilter (aType, this->mHttpRequest);
 }
 
@@ -120,113 +84,4 @@
 }
 
-void
-CRXProxy::SetHttpRequest (const char * aHttpRequest)
-{
-	/*----------------------------------------------------------------*/
-	mHttpRequest.SetHeader (aHttpRequest);
-	/*----------------------------------------------------------------*/
-}
-
-char *
-CRXProxy::GetHttpRequest (char		* aBuffer,
-						  const int	aBufferSize) const
-{
-	void		* aPtr = static_cast<void *> (aBuffer);
-
-	int			aCopyLength		= 0;
-	int			aRemainLength	= aBufferSize;
-	const int	aHeaderLength	= mHttpRequest.GetHeader ().length ();
-
-	/*----------------------------------------------------------------*/
-	if (aPtr == NULL)
-		return NULL;
-
-	aCopyLength = aRemainLength < aHeaderLength ? aBufferSize : aHeaderLength;
-	if (aCopyLength > 0)
-		memcpy (aPtr, mHttpRequest.GetHeader ().c_str (), aCopyLength);
-	/*----------------------------------------------------------------*/
-
-	return aBuffer;
-}
-
-int
-CRXProxy::GetHttpRequestLength (void) const
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mHttpRequest.GetHeader().length ();
-}
-
-void
-CRXProxy::SetHttpResponse (const char * aHttpResponse)
-{
-	/*----------------------------------------------------------------*/
-	mHttpResponse.SetHeader (aHttpResponse);
-	/*----------------------------------------------------------------*/
-}
-
-char *
-CRXProxy::GetHttpResponseHeader (char		* aBuffer,
-								 const int	aBufferSize) const
-{
-	void		* aPtr = static_cast<void *> (aBuffer);
-
-	int			aCopyLength		= 0;
-	int			aRemainLength	= aBufferSize;
-	const int	aHeaderLength	= mHttpResponse.GetHeader ().length ();
-
-	/*----------------------------------------------------------------*/
-	if (aPtr == NULL)
-		return NULL;
-
-	aCopyLength = aRemainLength < aHeaderLength ? aBufferSize : aHeaderLength;
-	if (aCopyLength > 0)
-		memcpy (aPtr, mHttpResponse.GetHeader ().c_str (), aCopyLength);
-	/*----------------------------------------------------------------*/
-
-	return aBuffer;
-}
-
-int
-CRXProxy::GetHttpResponseHeaderLength (void) const
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mHttpResponse.GetHeader ().length ();
-}
-
-char *
-CRXProxy::GetHttpResponseBody (char			* aBuffer,
-							   const int	aBufferSize) const
-{
-	void		* aPtr = static_cast<void *> (aBuffer);
-
-	int			aCopyLength		= 0;
-	int			aRemainLength	= aBufferSize;
-	const int	aContentLength	= mHttpResponse.GetContentLength ();
-
-	/*----------------------------------------------------------------*/
-	if (aPtr == NULL)
-		return NULL;
-
-	aCopyLength = aRemainLength < aContentLength ? aRemainLength : aContentLength;
-	if (aCopyLength > 0)
-		memcpy (aPtr, mHttpResponse.GetContentBody (), aCopyLength);
-	/*----------------------------------------------------------------*/
-
-	return aBuffer;
-}
-
-int
-CRXProxy::GetHttpResponseBodyLength (void) const
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mHttpResponse.GetContentLength ();
-}
-
 int
 CRXProxy::ReceiveRequest (void)
@@ -315,5 +170,5 @@
 
 		aResult = mHttpResponse.SetResponseAll (aBuffer, aResult);
-		if (aResult)
+		if (aResult < 0)
 		{
 			aResult = ERROR_PROXY_FAILED_TO_SET_RESPONSE;
@@ -354,2 +209,29 @@
 	return aResult < 0 ? aResult : 0;
 }
+
+CRXFilter &
+CRXProxy::GetFilter (void) const
+{
+	/*----------------------------------------------------------------*/
+	/*----------------------------------------------------------------*/
+
+	return mFilter;
+}
+
+CRXHttpRequest &
+CRXProxy::GetHttpRequest (void)
+{
+	/*----------------------------------------------------------------*/
+	/*----------------------------------------------------------------*/
+
+	return mHttpRequest;
+}
+
+CRXHttpResponse &
+CRXProxy::GetHttpResponse (void)
+{
+	/*----------------------------------------------------------------*/
+	/*----------------------------------------------------------------*/
+
+	return mHttpResponse;
+}
