Hi,
When a new browser window is opened and client_key_exchange is processed,
my SSL server will lose memories about 0x13000 ~ 0x16000 byte.
I'm sure that every SSL_new() is along with SSL_free().
I doubted the function of cache, so I set SSL_CTX_sess_set_cache_size(ctx,0).
But it didn't help at all.
The problem still happens when using Netscape browser.
How do I fix the problem??
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Amit Limaye
Sent: Friday, December 13, 2002 4:36 PM
To: [EMAIL PROTECTED]
Subject: Re: Who steal my memory??
Shao
The System should lose memory when a request from IE comes but not
for Netscape
Check that ?
there is slight difference in the way IE and netscape will send u the
initial key requests
for eg:
With IE u will get 2 requests
I m putting comments in the code have a look at them is this ur problem
1 The first request is empty and returns an error remember to free all that
u allocated at that point
This is what i m talking abt
l_pcbuff = new char[1500]; /*Allocated a buffer to read */
do
l_nread = SSL_read(this->getSSL(),(void *)l_pcbuff,1499);
}while(SSL_get_error(this->getSSL(),l_nread)
==SSL_ERROR_WANT_X509_LOOKUP || SSL_get_error(this->getSSL(),l_nread) ==
SSL_ERROR_WANT_READ);
/* If u get any one of the above errors repeat the same task */
/*This is what i m saying */
/*With Netscape this condition is never satisfied and with IE it goes in
once here*/
/*This was causing a leak initially with my code*/
if(l_nread ==0)
{
delete[] l_pcbuff;
return (SSL_NODATAREAD);
}
switch (SSL_get_error(this->getSSL(),l_nread))
{
case SSL_ERROR_NONE:
if(SSL_pending(this->getSSL()))
{
cout<<"Connection pending";
}
cout<<"\nNumber of bytes"<<SSL_pending(this->getSSL())<<endl;
break;
case SSL_ERROR_WANT_WRITE:
cout<<"SSL_WANT_WRITE"<<endl;
break;
case SSL_ERROR_WANT_READ:
cout<<"SSL_WANT_READ"<<endl;
break;
case SSL_ERROR_WANT_X509_LOOKUP:
file://BIO_printf(bio_s_out,"Read BLOCK\n");
cout<<"\nSSL_ERROR_WANT_X509\n";
break;
case SSL_ERROR_SYSCALL:
case SSL_ERROR_SSL:
cout<<"\nErrors \n";
cout<<"ERRORString\t"<<ERR_error_string(SSL_ERROR_SSL,NULL)<<"Function"<<ERR
_func_error_string(SSL_ERROR_SSL)<<endl;
return -1;
break;
case SSL_ERROR_ZERO_RETURN:
file://BIO_printf(bio_s_out,"DONE\n");
break;
file://goto err;
// cout<<"Done";
}
-SIGTERM
amit
----- Original Message -----
From: "Shao (E-mail)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 13, 2002 1:47 PM
Subject: Who steal my memory??
> Hi, everybody:
>
> I have ported the openssl 0.9.6g to my embedded system of ARM CPU.
> My program plays the role of https server.
> It can handle the requests of IE and Netscape browsers successfully.
> Everything is OK, except the system memory is losing.
> When a new browser window is opened and client_key_exchange is processed,
> my system memory will lose about 0x13000 ~ 0x16000 byte.
> I'm sure that every SSL_new() is along with SSL_free().
> I doubted the function of cache, so I set
SSL_CTX_sess_set_cache_size(ctx,0).
> But it did not help.
> Now, I have no idea. Who can tell me what's wrong in the situation? Thanks
a lot.
>
> Best Regards
> Wilson Shao
> [EMAIL PROTECTED]
> :I"Ϯrm??(Z+K?1x h[z?Z+ fy
fh?)z{,?
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]:I"Ϯrm
(Z+K+1xh[z(Z+fyfh)z{,