psk callback will not be set if no psk is available.

FossilOrigin-Name: eb34842cc2f5dc27176735f5e2c381f8231b0eb5dbf0673e0cc0a7a5a3ec8b11
This commit is contained in:
7u83@mail.ru 2014-08-02 16:51:51 +00:00
parent cf60801ca3
commit 525685128e
1 changed files with 6 additions and 2 deletions

View File

@ -61,19 +61,23 @@ int dtls_openssl_accept(struct conn * conn)
if (!d)
return 0;
SSL_set_psk_server_callback( d->ssl, psk_server_cb);
if (conn->dtls_psk)
SSL_set_psk_server_callback( d->ssl, psk_server_cb);
int rc;
// do{
int i;
for (i=0; i<5; i++){
rc = SSL_accept(d->ssl);
printf("Accept returns %d\n",rc);
if (rc==0){
int e;
e = SSL_get_error(d->ssl,rc);
switch (e){
case SSL_ERROR_SYSCALL:
// printf("syscall EOF!\n");
printf("syscall EOF!\n");
break;
}