Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost [Asio] Problem with POST Request and async_read
From: anti00Zero (anti00Zero_at_[hidden])
Date: 2008-10-21 04:29:26


I Found the problem myself.
The problem was transfer_at_least(1). I should write the hole content to the thhp server and after this I should read. With transfer_at_least(1) I wrote some content and want to read again from the server. But the server wants to recieve more content.

>Hello.
>
>I've wrote a SSL Proxy and have a big problem.
>I use a HTTP Client in bei Proxy to communicate with my HTTP Server.
>HTTP Client and HTTP Server are localhost. A SSL Browser should call my local SSL Proxy and internal >a HTTP Client communicate with my HTTP Server.
>If the SSL Brower sends a POST request to my proxy, I have a problem.
>
>This is my code:
>
>async_write(m_HTTPSocket, buffer(m_sSSLRequestBuffer),
> transfer_at_least(1),
> boost::bind(&CSession::HandleHTTPWriteRequest, this, placeholders::error));
>
>void CSession::HandleHTTPWriteRequest(const error_code& error)
>{
> if (!error)
> {
> async_read(m_HTTPSocket, buffer(m_HTTPResponse, >MAX_HTTPRESPONSE_BUFFER_LENGTH),
> transfer_at_least(1),
> boost::bind(&CSession::HandleHTTPReadResponse, this, placeholders::error,
> placeholders::bytes_transferred));
> }
> else if(error != error::eof)
> {
> SendErrorToSSL(error);
> }
>}
>
>void CSession::HandleHTTPReadResponse(const error_code& error, size_t iTransferredBytes)
>{
> if(!error)
> {
>
>The error is boost::asio::error::connection_aborted (10053 (WSAECONNABORTED)). If I don't use my >SSL Proxy the HTTP Browser works correct.
>
>I use Visual Studio 2005 with Boost 1.36
>
>Thanks for help.

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net