LINK=libtool --mode=link ${CC} ${LDFLAGS}
INSTALL=libtool --mode=install install
-CFLAGS_LIB=-Wall -pedantic -fPIC -c -g -I${top_srcdir}/src ${LIBCARES_CFLAGS} ${LIBSSL_CFLAGS}
+CFLAGS_LIB=-Wall -pedantic -fPIC -c -g -I${top_srcdir}/src ${LIBCARES_CFLAGS} ${LIBSSL_CFLAGS} -DDEBUG
LFLAGS_LIB=-shared ${LIBCARES_LIBS} ${LIBSSL_LIBS}
CFLAGS_CLI=-Wall -g -I${top_srcdir}/src
err = ssl_accept(glb_cc, io_cc, (*io_new_cc), timeout);
end:
- if (err)
+ if (err){
+ /* ssl_accept closed new_sock*/
+ (*io_new_cc)->sock = 0;
update_error(glb_cc, "cannot accept connection (canl_io_accept)");
+ }
return err;
}
free (io_cc->s_addr);
io_cc->s_addr = NULL;
}
+ if (io_cc->sock) {
+ fclose (io_cc->sock);
+ io_cc->sock = NULL;
+ }
if (io_cc->s_ctx) {
/*TODO maybe new function because of BIO_free and SSL_free*/
if (io_cc->s_ctx->ssl_io) {