*/
readtimeout = 15 minutes;
+ /*
+ * Interval in how often we try to reconnect to the IRC server
+ */
+ reconnectinterval = 30 seconds;
+
/*
* Command to execute to identify to NickServ (if your network uses
* it). This is the raw IRC command text, and the below example
PROTOCOL { return PROTOCOL; }
READTIMEOUT { return READTIMEOUT; }
REALNAME { return REALNAME; }
+RECONNECTINTERVAL { return RECONNECTINTERVAL; }
REPLY { return REPLY; }
SCANLOG { return SCANLOG; }
SCANNER { return SCANNER; }
%token PROTOCOL
%token READTIMEOUT
%token REALNAME
+%token RECONNECTINTERVAL
%token REPLY
%token SCANLOG
%token SCANNER
irc_items: irc_items irc_item |
irc_item;
-irc_item: irc_away |
- irc_connregex |
- irc_kline |
- irc_nick |
- irc_nickserv |
- irc_mode |
- irc_oper |
- irc_password |
- irc_port |
- irc_readtimeout |
- irc_realname |
- irc_server |
- irc_username |
- irc_vhost |
- irc_perform |
- irc_notice |
- channel_entry |
+irc_item: irc_away |
+ irc_connregex |
+ irc_kline |
+ irc_nick |
+ irc_nickserv |
+ irc_mode |
+ irc_oper |
+ irc_password |
+ irc_port |
+ irc_readtimeout |
+ irc_reconnectinterval |
+ irc_realname |
+ irc_server |
+ irc_username |
+ irc_vhost |
+ irc_perform |
+ irc_notice |
+ channel_entry |
error;
irc_away: AWAY '=' STRING ';'
IRCItem->readtimeout = $3;
};
+irc_reconnectinterval: RECONNECTINTERVAL '=' timespec ';'
+{
+ IRCItem->reconnectinterval = $3;
+};
+
irc_realname: REALNAME '=' STRING ';'
{
xfree(IRCItem->realname);
IRCItem->nick = xstrdup("hopm");
IRCItem->port = 6667;
IRCItem->readtimeout = 900;
+ IRCItem->reconnectinterval = 30;
IRCItem->oper = xstrdup("undefined");
IRCItem->username = xstrdup("hopm");
IRCItem->realname = xstrdup("Hybrid Open Proxy Monitor");
char *server;
int port;
time_t readtimeout;
+ time_t reconnectinterval;
char *password;
char *vhost;
char *nickserv;
time(&present);
- /* Only try to reconnect every RECONNECT_INTERVAL seconds */
- if ((present - IRC_LASTRECONNECT) < RECONNECTINTERVAL)
+ /* Only try to reconnect every IRCItem->reconnectinterval seconds */
+ if ((present - IRC_LASTRECONNECT) < IRCItem->reconnectinterval)
{
/* Sleep to avoid excessive CPU */
sleep(1);
/* Timeout of commands (in seconds) */
#define COMMANDTIMEOUT 180
-
-/* Interval in how often we try to reconnect (in seconds) */
-#define RECONNECTINTERVAL 30
#endif /* OPTIONS_H */