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 1000 of file gnutls.c.
1001{
1003 if (data)
1004 {
1005
1006
1007
1008
1009
1010
1011
1012 gnutls_bye(data->
session, GNUTLS_SHUT_WR);
1013
1014 gnutls_certificate_free_credentials(data->
xcred);
1017 }
1018
1020}
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 1103 of file gnutls.c.
1104{
1105 int rc;
1106
1112
1113 return rc;
1114}
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)
Checks whether reads would block - 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 1369 of file openssl.c.
1370{
1371 struct SslSockData *data =
sockdata(conn);
1372
1373 if (data)
1374 {
1376 SSL_shutdown(data->ssl);
1377
1378 SSL_free(data->ssl);
1379 data->ssl = NULL;
1380 SSL_CTX_free(data->sctx);
1381 data->sctx = NULL;
1383 }
1384
1386}
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 379 of file raw.c.
380{
381 return close(conn->
fd);
382}
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 442 of file sasl.c.
443{
445
446
453
454
457
458
459 int rc = conn->
close(conn);
460
461 return rc;
462}
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 whether a socket read would block - 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 212 of file tunnel.c.
213{
215 if (!tunnel)
216 {
217 return 0;
218 }
219
220 int status;
221
224 waitpid(tunnel->
pid, &status, 0);
225 if (!WIFEXITED(status) || WEXITSTATUS(status))
226 {
229 }
231
232 return 0;
233}
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 97 of file zstrm.c.
98{
100
102
104 zctx->
read.
z.total_in, zctx->
read.
z.total_out,
105 (
float) zctx->
read.
z.total_out / (
float) zctx->
read.
z.total_in,
107 (
float) zctx->
write.
z.total_in / (
float) zctx->
write.
z.total_out);
108
109
116
117 inflateEnd(&zctx->
read.
z);
118 deflateEnd(&zctx->
write.
z);
122
123 return rc;
124}
#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) |