*/
if (my->info.type == FR_BIO_FD_UNCONNECTED) {
error:
+#ifdef ECONNABORTED
+ my->info.connect_errno = ECONNABORTED;
+#else
+ my->info.connect_errno = ECONNREFUSED;
+#endif
+ if (error_cb) error_cb(bio);
fr_bio_shutdown(&my->bio);
return fr_bio_error(GENERIC);
}
ssize_t rcode;
rcode = fr_bio_fd_try_connect(my);
- if (rcode < 0) return rcode; /* it already called shutdown */
+ if (rcode < 0) {
+ if (error_cb) error_cb(bio);
+ return rcode; /* it already called shutdown */
+ }
return 1;
}