Skip to content

Commit

Permalink
Ignore SIGPIPE, the socket engine likes to throw a lot of these, Tran…
Browse files Browse the repository at this point in the history
…slateColors in m_logchan repeats messages so i disabled it and just stripped the colors for now, update the module lines in the example conf (clears up some confusing on wht bots are broke)
  • Loading branch information
Justin Crawford authored and Justin Crawford committed May 28, 2012
1 parent bd4f055 commit fd18b0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bot.example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ Rate = 5
# This is where the oper info goes #
##############################################################
[Oper]
# Operator account username (comment out or remove if you dont have one)
# Operator account username (comment out or remove if you don't have one)
#Oper_Username =
# Operator Password (comment out or remove if you dont have one)
# Operator Password (comment out or remove if you don't have one)
#Oper_Password =

##############################################################
Expand All @@ -140,4 +140,4 @@ WeatherURL = http://www.google.com/ig/api?weather=%l
# This will load modules in any directory in the binary runtime, do not use absolute paths
ModuleDir = ../modules/
# Modules to load :P
Modules = m_system, modulehandler, help, m_ping, m_join, testmod, searcher, m_dns, about_me, ctcp, encyclopedia, weather, world_clock, channel_logger, m_terminal_input, da_goat
Modules = m_system, m_modulehandler, m_help, m_ping, m_join, m_testmod, m_searcher, m_dns, m_about_me, m_ctcp, m_encyclopedia, m_weather, m_world_clock, channel_logger, m_terminal_input, da_goat, m_logchan
2 changes: 1 addition & 1 deletion modules/core/m_logchan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class LogChan : public module

Flux::string message = l->logstream.str();
message = message.substr(message.find(']') + 2);
c->SendMessage(TranslateColors(message));
c->SendMessage(NoTermColor(message));
return EVENT_CONTINUE;
}
};
Expand Down
5 changes: 5 additions & 0 deletions src/signal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ void sigact(int sig)
signal(sig, SIG_IGN);
Rehash();
break;
case SIGPIPE:
signal(sig, SIG_IGN);
Log(LOG_DEBUG) << "Received SIGPIPE, ignoring..";
break;
case SIGUSR1:
Log(LOG_CRITICAL) << "Ran out of memory! oh noes!";
if(ircproto)
Expand Down Expand Up @@ -179,6 +183,7 @@ void InitSignals()
{
signal(SIGTERM, sigact);
signal(SIGUSR1, sigact);
signal(SIGPIPE, sigact);
signal(SIGINT, sigact);
signal(SIGHUP, sigact);
signal(SIGSEGV, sigact);
Expand Down

0 comments on commit fd18b0c

Please sign in to comment.