mirror of
https://github.com/irssi/irssi.git
synced 2024-09-29 04:45:57 -04:00
Merge pull request #622 from ailin-nemui/starttls
provide net_start_ssl api
This commit is contained in:
commit
653c7fb05a
@ -6,7 +6,7 @@
|
|||||||
#define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
|
#define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
|
||||||
#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */
|
#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */
|
||||||
|
|
||||||
#define IRSSI_ABI_VERSION 7
|
#define IRSSI_ABI_VERSION 8
|
||||||
|
|
||||||
#define DEFAULT_SERVER_ADD_PORT 6667
|
#define DEFAULT_SERVER_ADD_PORT 6667
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "net-sendbuffer.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "servers.h"
|
#include "servers.h"
|
||||||
#include "signals.h"
|
#include "signals.h"
|
||||||
@ -718,6 +719,21 @@ GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, IPADDR *my_ip, SERVER_REC *
|
|||||||
return ssl_handle;
|
return ssl_handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GIOChannel *net_start_ssl(SERVER_REC *server)
|
||||||
|
{
|
||||||
|
GIOChannel *handle, *ssl_handle;
|
||||||
|
|
||||||
|
g_return_val_if_fail(server != NULL, NULL);
|
||||||
|
|
||||||
|
handle = net_sendbuffer_handle(server->handle);
|
||||||
|
if (handle == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
ssl_handle = irssi_ssl_get_iochannel(handle, server->connrec->port, server);
|
||||||
|
return ssl_handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int irssi_ssl_handshake(GIOChannel *handle)
|
int irssi_ssl_handshake(GIOChannel *handle)
|
||||||
{
|
{
|
||||||
GIOSSLChannel *chan = (GIOSSLChannel *)handle;
|
GIOSSLChannel *chan = (GIOSSLChannel *)handle;
|
||||||
|
@ -40,6 +40,9 @@ int net_ip_compare(IPADDR *ip1, IPADDR *ip2);
|
|||||||
GIOChannel *net_connect(const char *addr, int port, IPADDR *my_ip) G_GNUC_DEPRECATED;
|
GIOChannel *net_connect(const char *addr, int port, IPADDR *my_ip) G_GNUC_DEPRECATED;
|
||||||
/* Connect to socket with ip address and SSL*/
|
/* Connect to socket with ip address and SSL*/
|
||||||
GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, IPADDR *my_ip, SERVER_REC *server);
|
GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, IPADDR *my_ip, SERVER_REC *server);
|
||||||
|
/* Start TLS */
|
||||||
|
GIOChannel *net_start_ssl(SERVER_REC *server);
|
||||||
|
|
||||||
int irssi_ssl_handshake(GIOChannel *handle);
|
int irssi_ssl_handshake(GIOChannel *handle);
|
||||||
/* Connect to socket with ip address */
|
/* Connect to socket with ip address */
|
||||||
GIOChannel *net_connect_ip(IPADDR *ip, int port, IPADDR *my_ip);
|
GIOChannel *net_connect_ip(IPADDR *ip, int port, IPADDR *my_ip);
|
||||||
|
Loading…
Reference in New Issue
Block a user