Go to the documentation of this file.
59 #if !defined(OPENSSL_TRUSTY)
65 #if !defined(OPENSSL_WINDOWS)
66 #include <sys/socket.h>
67 #include <netinet/in.h>
68 #include <arpa/inet.h>
81 #include "../internal.h"
99 struct sockaddr_storage
them;
111 #if !defined(OPENSSL_WINDOWS)
121 const char *host, *
port = NULL;
127 if (
name[0] ==
'[') {
133 host_len =
close - host;
134 if (
close[1] ==
':') {
136 }
else if (
close[1] != 0) {
140 const char *colon = strchr(
name,
':');
141 if (colon == NULL || strchr(colon + 1,
':') != NULL) {
143 host_len = strlen(
name);
146 host_len = colon -
name;
152 if (*out_host == NULL) {
160 if (*out_port == NULL) {
172 if (
c->info_callback != NULL) {
173 cb =
c->info_callback;
183 if (
c->param_hostname == NULL) {
188 if (
c->param_port == NULL) {
200 c->param_port =
port;
202 c->param_hostname = host;
206 &bio->
num, &
c->them, &
c->them_length,
c->param_hostname,
223 ret = setsockopt(bio->
num, SOL_SOCKET, SO_KEEPALIVE, (
char *)&
i,
233 ret = connect(bio->
num, (
struct sockaddr*) &
c->them,
c->them_length);
324 return bio->
ptr != NULL;
330 if (bio->
num == -1) {
336 shutdown(bio->
num, 2);
389 ret = send(bio->
num,
in, in_len, 0);
428 if (
data->param_hostname == NULL) {
431 }
else if (
num == 1) {
434 if (
data->param_port == NULL) {
471 *fptr =
data->info_callback;
541 #endif // OPENSSL_TRUSTY
long(* bio_info_cb)(BIO *bio, int event, const char *parg, int cmd, long larg, long return_value)
#define BIO_CTRL_WPENDING
#define BIO_R_NO_HOSTNAME_SPECIFIED
int BIO_do_connect(BIO *bio)
#define BIO_set_retry_write
struct bio_connect_st BIO_CONNECT
#define BIO_R_UNABLE_TO_CREATE_SOCKET
#define OPENSSL_PUT_ERROR(library, reason)
#define BIO_FLAGS_SHOULD_RETRY
static long conn_ctrl(BIO *bio, int cmd, long num, void *ptr)
static long conn_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp)
static BIO_CONNECT * BIO_CONNECT_new(void)
int(* info_callback)(const BIO *bio, int state, int ret)
#define BIO_R_ERROR_SETTING_NBIO
#define bio_clear_socket_error
static int conn_write(BIO *bio, const char *in, int in_len)
const BIO_METHOD * BIO_s_connect(void)
static void * OPENSSL_memset(void *dst, int c, size_t n)
int BIO_set_nbio(BIO *bio, int on)
static int conn_free(BIO *bio)
#define BIO_FLAGS_IO_SPECIAL
static int conn_state(BIO *bio, BIO_CONNECT *c)
static int split_host_and_port(char **out_host, char **out_port, const char *name)
#define BIO_C_DO_STATE_MACHINE
@ BIO_CONN_S_BLOCKED_CONNECT
#define BIO_R_NBIO_CONNECT_ERROR
#define BIO_R_CONNECT_ERROR
static const BIO_METHOD methods_connectp
static int conn_new(BIO *bio)
#define BIO_CTRL_SET_CALLBACK
#define BIO_C_SET_CONNECT
OPENSSL_MSVC_PRAGMA(warning(disable:4702))
#define bio_ip_and_port_to_socket_and_addr
int BIO_set_conn_port(BIO *bio, const char *port_str)
int push(void *desc, unsigned char *buf, unsigned len)
#define BIO_CTRL_GET_CLOSE
static void BIO_CONNECT_free(BIO_CONNECT *c)
#define BIO_CTRL_SET_CLOSE
static void conn_close_socket(BIO *bio)
#define bio_fd_should_retry
int BIO_set_conn_int_port(BIO *bio, const int *port)
UniquePtr< SSL_SESSION > ret
#define OPENSSL_PUT_SYSTEM_ERROR()
int BIO_set_conn_hostname(BIO *bio, const char *name)
#define ERR_add_error_data
#define DECIMAL_SIZE(type)
struct sockaddr_storage them
static int conn_read(BIO *bio, char *out, int out_len)
#define BIO_CTRL_GET_CALLBACK
static int closesocket(int sock)
#define BIO_set_retry_read
BIO * BIO_new_connect(const char *hostname)
if(p->owned &&p->wrapped !=NULL)
OPENSSL_EXPORT pem_password_cb * cb
static struct rpc_state state
#define BIO_clear_retry_flags
#define BIO_R_NO_PORT_SPECIFIED
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:54