mirror of
https://github.com/irssi/irssi.git
synced 2026-08-17 15:42:26 +02:00
Add OTR support.
This patch adds support for the OTR protocol to irssi. This is an import of the external irssi-otr project that we are now taking over maintership for. Major thanks to the original authors of Irssi-OTR: Uli Meis and David Goulet. Thanks to the OTR community in #OTR on OFTC, thanks to everyone who have helped testing the patches and submitted UI suggestions.
This commit is contained in:
parent
ad4324d242
commit
016b42baea
25 changed files with 3262 additions and 41 deletions
|
|
@ -35,41 +35,6 @@ typedef struct {
|
|||
int tag;
|
||||
} SIMPLE_THREAD_REC;
|
||||
|
||||
static int g_io_channel_write_block(GIOChannel *channel, void *data, int len)
|
||||
{
|
||||
gsize ret;
|
||||
int sent;
|
||||
GIOStatus status;
|
||||
|
||||
sent = 0;
|
||||
do {
|
||||
status = g_io_channel_write_chars(channel, (char *) data + sent,
|
||||
len-sent, &ret, NULL);
|
||||
sent += ret;
|
||||
} while (sent < len && status != G_IO_STATUS_ERROR);
|
||||
|
||||
return sent < len ? -1 : 0;
|
||||
}
|
||||
|
||||
static int g_io_channel_read_block(GIOChannel *channel, void *data, int len)
|
||||
{
|
||||
time_t maxwait;
|
||||
gsize ret;
|
||||
int received;
|
||||
GIOStatus status;
|
||||
|
||||
maxwait = time(NULL)+2;
|
||||
received = 0;
|
||||
do {
|
||||
status = g_io_channel_read_chars(channel, (char *) data + received,
|
||||
len-received, &ret, NULL);
|
||||
received += ret;
|
||||
} while (received < len && time(NULL) < maxwait &&
|
||||
status != G_IO_STATUS_ERROR && status != G_IO_STATUS_EOF);
|
||||
|
||||
return received < len ? -1 : 0;
|
||||
}
|
||||
|
||||
/* nonblocking gethostbyname(), ip (IPADDR) + error (int, 0 = not error) is
|
||||
written to pipe when found PID of the resolver child is returned */
|
||||
int net_gethostbyname_nonblock(const char *addr, GIOChannel *pipe,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue