I am writing a https proxy in c++, I am using ubuntu 10.04 and using gnutls-2.10.0.
I know only google.com i.e request is of the form
**************************
*****
GET
https://www.google.com/ HTTP/1.1
User-Agent: NetSurf/2.6 (Linux; i686)
Host:
www.google.com
-------
----------
I am able to receive response in the form of chunks and I am able to see almost entire content and I am using
ret = gnutls_record_recv (session, buffer_new, MAX_BUF); this statement in a for loop.
and I want to come out of the loop after receiving the entire content. i.e I use different flags like
GNUTLS_E_UNEXPECTED_PACKET
_LENGTH
GNUTLS_E_INTERRUPTED
the recv call block for a while (nearly 30 mins) even after entire content is received,I want to know how I can come out, I tried few options but none of them work. Please help me and explain this
Thanking you
gnutls_record_recv uses the underlying socket layer. As such it will stay open until the socket is closed.
to achieve what you wish you will need to incorporate gnutls_record_check_pendin