dtls_accept did crash when a ssl error should be displayed.

FossilOrigin-Name: 884006ca2e6f5ad724a22f02da6fbdf0976b3589d844cf1157f917bc26affc8a
This commit is contained in:
7u83@mail.ru 2014-07-28 22:33:39 +00:00
parent 1f86c9d56f
commit 5853b29555
1 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,22 @@
/*
This file is part of libcapwap.
libcapwap is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
libcapwap is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
*/
#include <openssl/err.h>
#include "dtls_openssl.h"
@ -70,22 +89,21 @@ int dtls_openssl_accept(struct conn * conn)
}
printf ("UI! error?\n");
char errstr[256];
e = ERR_get_error();
while (e!=0){
ERR_error_string(e,errstr);
cw_log(LOG_ERR,"SSL_accept (e) - %s",e,errstr);
cw_log(LOG_ERR,"SSL_accept - %s",errstr);
e = ERR_get_error();
}
continue;
}
if (rc == 1)
{
// printf("Juhu!\n");
conn->read = dtls_openssl_read;
conn->write = dtls_openssl_write;
return 1;