Close a socket Connection.
More...
Close a socket Connection.
- Parameters
-
- Return values
-
0 | Success |
-1 | Error, see errno |
◆ tls_socket_close()
static int tls_socket_close |
( |
struct Connection * |
conn | ) |
|
|
static |
Close a TLS socket - Implements Connection::close() -.
Definition at line 1004 of file gnutls.c.
1005{
1007 if (data)
1008 {
1009
1010
1011
1012
1013
1014
1015
1016 gnutls_bye(data->
session, GNUTLS_SHUT_WR);
1017
1018 gnutls_certificate_free_credentials(data->
xcred);
1021 }
1022
1024}
int raw_socket_close(struct Connection *conn)
Close a socket - Implements Connection::close() -.
void * sockdata
Backend-specific socket data.
gnutls_certificate_credentials_t xcred
◆ tls_starttls_close()
static int tls_starttls_close |
( |
struct Connection * |
conn | ) |
|
|
static |
Close a TLS connection - Implements Connection::close() -.
Definition at line 1107 of file gnutls.c.
1108{
1109 int rc;
1110
1116
1117 return rc;
1118}
static int tls_socket_close(struct Connection *conn)
Close a TLS socket - Implements Connection::close() -.
int raw_socket_poll(struct Connection *conn, time_t wait_secs)
Check if any data is waiting on a socket - Implements Connection::poll() -.
int raw_socket_read(struct Connection *conn, char *buf, size_t len)
Read data from a socket - Implements Connection::read() -.
int raw_socket_write(struct Connection *conn, const char *buf, size_t count)
Write data to a socket - Implements Connection::write() -.
int(* poll)(struct Connection *conn, time_t wait_secs)
int(* write)(struct Connection *conn, const char *buf, size_t count)
int(* close)(struct Connection *conn)
int(* read)(struct Connection *conn, char *buf, size_t count)
◆ ssl_socket_close_and_restore()
static int ssl_socket_close_and_restore |
( |
struct Connection * |
conn | ) |
|
|
static |
Close an SSL Connection and restore Connection callbacks - Implements Connection::close() -.
Definition at line 621 of file openssl.c.
622{
628
629 return rc;
630}
static int ssl_socket_close(struct Connection *conn)
Close an SSL connection - Implements Connection::close() -.
◆ ssl_socket_close()
static int ssl_socket_close |
( |
struct Connection * |
conn | ) |
|
|
static |
Close an SSL connection - Implements Connection::close() -.
Definition at line 1397 of file openssl.c.
1398{
1399 struct SslSockData *data =
sockdata(conn);
1400
1401 if (data)
1402 {
1404 SSL_shutdown(data->ssl);
1405
1406 SSL_free(data->ssl);
1407 data->ssl = NULL;
1408 SSL_CTX_free(data->sctx);
1409 data->sctx = NULL;
1411 }
1412
1414}
static struct SslSockData * sockdata(struct Connection *conn)
Get a Connection's socket data.
◆ raw_socket_close()
Close a socket - Implements Connection::close() -.
Definition at line 393 of file raw.c.
394{
395 return close(conn->
fd);
396}
int fd
Socket file descriptor.
◆ mutt_sasl_conn_close()
static int mutt_sasl_conn_close |
( |
struct Connection * |
conn | ) |
|
|
static |
Close SASL connection - Implements Connection::close() -.
Calls underlying close function and disposes of the sasl_conn_t object, then restores connection to pre-sasl state
Definition at line 443 of file sasl.c.
444{
446
447
454
455
458
459
460 int rc = conn->
close(conn);
461
462 return rc;
463}
int(* close)(struct Connection *conn)
Close a socket Connection - Implements Connection::close() -.
int(* open)(struct Connection *conn)
Open a socket Connection - Implements Connection::open() -.
int(* poll)(struct Connection *conn, time_t wait_secs)
Check if any data is waiting on a socket - Implements Connection::poll() -.
int(* read)(struct Connection *conn, char *buf, size_t count)
Read from a socket Connection - Implements Connection::read() -.
int(* write)(struct Connection *conn, const char *buf, size_t count)
Write to a socket Connection - Implements Connection::write() -.
int(* open)(struct Connection *conn)
SASL authentication API -.
void * sockdata
Underlying socket data.
◆ tunnel_socket_close()
static int tunnel_socket_close |
( |
struct Connection * |
conn | ) |
|
|
static |
Close a tunnel socket - Implements Connection::close() -.
Definition at line 213 of file tunnel.c.
214{
216 if (!tunnel)
217 {
218 return 0;
219 }
220
221 int status;
222
225 waitpid(tunnel->
pid, &status, 0);
226 if (!WIFEXITED(status) || WEXITSTATUS(status))
227 {
230 }
232
233 return 0;
234}
const char * mutt_str_sysexit(int err_num)
Return a string matching an error code.
char host[128]
Server to login to.
struct ConnAccount account
Account details: username, password, etc.
A network tunnel (pair of sockets)
int fd_read
File descriptor to read from.
pid_t pid
Process ID of tunnel program.
int fd_write
File descriptor to write to.
◆ zstrm_close()
static int zstrm_close |
( |
struct Connection * |
conn | ) |
|
|
static |
Close a socket - Implements Connection::close() -.
Definition at line 100 of file zstrm.c.
101{
103
105
107 zctx->
read.
z.total_in, zctx->
read.
z.total_out,
108 (
double) zctx->
read.
z.total_out / (
double) zctx->
read.
z.total_in,
110 (
double) zctx->
write.
z.total_in / (
double) zctx->
write.
z.total_out);
111
112
119
120 inflateEnd(&zctx->
read.
z);
121 deflateEnd(&zctx->
write.
z);
125
126 return rc;
127}
#define mutt_debug(LEVEL,...)
@ LL_DEBUG5
Log at debug level 5.
struct ZstrmDirection read
Data being read and de-compressed.
struct ZstrmDirection write
Data being compressed and written.
struct Connection next_conn
Underlying stream.
z_stream z
zlib compression handle
char * buf
Buffer for data being (de-)compressed.
◆ close
int(* SaslSockData::close) (struct Connection *conn) |