mirror of
https://github.com/sys-fs/tubes
synced 2024-11-22 03:54:15 -05:00
Remove -v flag
This commit is contained in:
parent
c0d9536605
commit
f061ae1879
6
tubes.1
6
tubes.1
@ -1,4 +1,4 @@
|
|||||||
.TH TUBES 1 tubes-1.1.1
|
.TH TUBES 1 tubes-1.2.1
|
||||||
.SH NAME
|
.SH NAME
|
||||||
tubes \- irc pipes
|
tubes \- irc pipes
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -8,7 +8,6 @@ tubes \- irc pipes
|
|||||||
.IR server ]
|
.IR server ]
|
||||||
.RB [ \-p
|
.RB [ \-p
|
||||||
.IR port ]
|
.IR port ]
|
||||||
.RB [ \-v ]
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B tubes
|
.B tubes
|
||||||
is a small daemon that provides a minimalistic interface for irc bots.
|
is a small daemon that provides a minimalistic interface for irc bots.
|
||||||
@ -26,9 +25,6 @@ Use a host other than the default (chat.freenode.net)
|
|||||||
.TP
|
.TP
|
||||||
.BI \-p " port"
|
.BI \-p " port"
|
||||||
Use a port other than the default (6667)
|
Use a port other than the default (6667)
|
||||||
.TP
|
|
||||||
.B \-v
|
|
||||||
Print version information and exit
|
|
||||||
|
|
||||||
.SH FILES
|
.SH FILES
|
||||||
The incoming and outgoing FIFO buffers are stored in /tmp and are named for
|
The incoming and outgoing FIFO buffers are stored in /tmp and are named for
|
||||||
|
18
tubes.c
18
tubes.c
@ -16,7 +16,6 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#define PING_TIMEOUT 240
|
#define PING_TIMEOUT 240
|
||||||
#define VERSION "1.1.1"
|
|
||||||
|
|
||||||
static SSL_CTX *ctx;
|
static SSL_CTX *ctx;
|
||||||
static SSL *ssl;
|
static SSL *ssl;
|
||||||
@ -104,10 +103,10 @@ main(int argc, char **argv)
|
|||||||
int i, r, status;
|
int i, r, status;
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
char c = argv[i][1];
|
r = argv[i][1];
|
||||||
if (argv[i][0] != '-' || argv[i][2])
|
if (argv[i][0] != '-' || argv[i][2])
|
||||||
c = -1;
|
r = -1;
|
||||||
switch (c) {
|
switch (r) {
|
||||||
case 'S':
|
case 'S':
|
||||||
use_ssl = 1;
|
use_ssl = 1;
|
||||||
port = 6697;
|
port = 6697;
|
||||||
@ -120,9 +119,8 @@ main(int argc, char **argv)
|
|||||||
if (++i < argc)
|
if (++i < argc)
|
||||||
port = atoi(argv[i]);
|
port = atoi(argv[i]);
|
||||||
break;
|
break;
|
||||||
case 'v': /* fall through */
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "tubes-%s © 2016 Thomas Mannay\n", VERSION);
|
fprintf(stderr, "usage: tubes [-S] [-s server] [-p port]\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,7 +152,6 @@ main(int argc, char **argv)
|
|||||||
fprintf(log, "out: error on open()\n");
|
fprintf(log, "out: error on open()\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (status = 0;;) {
|
for (status = 0;;) {
|
||||||
FD_ZERO(&rd);
|
FD_ZERO(&rd);
|
||||||
maxfd = (out >= sockfd) ? out : sockfd;
|
maxfd = (out >= sockfd) ? out : sockfd;
|
||||||
@ -185,14 +182,13 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if (FD_ISSET(sockfd, &rd)) {
|
if (FD_ISSET(sockfd, &rd)) {
|
||||||
if (use_ssl) {
|
if (use_ssl) {
|
||||||
int blocked;
|
|
||||||
do {
|
do {
|
||||||
blocked = 0;
|
r = 0;
|
||||||
i = SSL_read(ssl, buf, sizeof(buf));
|
i = SSL_read(ssl, buf, sizeof(buf));
|
||||||
if (SSL_get_error(ssl, i)
|
if (SSL_get_error(ssl, i)
|
||||||
== SSL_ERROR_WANT_READ)
|
== SSL_ERROR_WANT_READ)
|
||||||
blocked = 1;
|
r = 1;
|
||||||
} while (SSL_pending(ssl) && !blocked);
|
} while (SSL_pending(ssl) && !r);
|
||||||
} else
|
} else
|
||||||
i = recv(sockfd, buf, sizeof(buf), 0);
|
i = recv(sockfd, buf, sizeof(buf), 0);
|
||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user