Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: znc/znc
base: f73d766c8af6
...
head fork: znc/znc
compare: c28207d35b82
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 07, 2013
@psychon psychon Debug: Only print queued lines if they are really just queued
Previously, every line that was forwarded to the IRCd was printed twice in debug
mode. Once when it got added to the send queue and a second time when it was
actually sent. However, most of the time this queue is empty and thus the two
events happened at approximately the same time.

Thus, this patch now changes the debug output. Lines are only printed extra if
they really have to wait in the queue for a while before they can be sent out.

This has the positive effect of making the debug output more readable, because
it is shorter and less repetitive and it makes it more obvious when znc actively
throttles the traffic that is sent out.

Signed-off-by: Uli Schlachter <psychon@znc.in>
9b23ee6
@psychon psychon make clean: Only delete files that can be regenerated
Previously, "make clean" would happily delete swig's output files even though
configure did not find swig and thus these files could not be generated again.

This half-fixes issue 276. It would be great if the Makefiles never delete files
which are part of the tarball, but at least they now don't delete files which
cannot be regenerated.

Signed-off-by: Uli Schlachter <psychon@znc.in>
ed478e6
@psychon psychon Makefile: Remove unused (and broken) variable
Signed-off-by: Uli Schlachter <psychon@znc.in>
c28207d
View
1  modules/Makefile.in
@@ -36,7 +36,6 @@ PYTHON_ON:= @PYTHON@
PY_CFLAGS:= @python_CFLAGS@
PY_LDFLAGS:=@python_LIBS@
SWIG := @SWIG@
-SWIG_ON := @USESWIG@
MODDIR := @MODDIR@
DATADIR := @DATADIR@
LIBZNC := @LIBZNC@
View
9 modules/modperl/Makefile.inc
@@ -23,9 +23,12 @@ PERLDEPONMOD :=
endif
PERLHOOK := modperl_install
-CLEAN += modperl/ZNC.$(PERLCEXT_EXT) modperl/ZNC.pm modperl/ZNC.o
-CLEAN += modperl/swigperlrun.h modperl/ZNC.cpp modperl/functions.cpp
-CLEAN += modperl/gen
+CLEAN += modperl/ZNC.$(PERLCEXT_EXT) modperl/ZNC.o modperl/gen
+ifneq "$(SWIG)" ""
+# Only delete these files if we can regenerate them
+CLEAN += modperl/ZNC.pm modperl/swigperlrun.h modperl/ZNC.cpp modperl/functions.cpp
+endif
+
all: modperl_all
else
View
9 modules/modpython/Makefile.inc
@@ -19,9 +19,14 @@ PYDEPONMOD :=
endif
PYTHONHOOK := modpython_install
-CLEAN += modpython/_znc_core.$(PYCEXT_EXT) modpython/_znc_core.cpp modpython/znc_core.py modpython/znc_core.pyc
-CLEAN += modpython/swigpyrun.h modpython/znc.pyc modpython/functions.cpp modpython/compiler *.pyc
+CLEAN += modpython/_znc_core.$(PYCEXT_EXT) modpython/znc_core.pyc
+CLEAN += modpython/znc.pyc modpython/compiler *.pyc
CLEAN += modpython/_znc_core.o modpython/compiler.o
+ifneq "$(SWIG)" ""
+# Only delete these files if we can regenerate them
+CLEAN += modpython/_znc_core.cpp modpython/znc_core.py
+CLEAN += modpython/swigpyrun.h modpython/functions.cpp
+endif
ifneq "$(srcdir)" "."
# Copied from source for out-of-tree builds
CLEAN += modpython/znc.py
View
13 src/IRCSock.cpp
@@ -1016,19 +1016,26 @@ bool CIRCSock::OnChanMsg(CNick& Nick, const CString& sChan, CString& sMessage) {
}
void CIRCSock::PutIRC(const CString& sLine) {
- DEBUG("(" << m_pNetwork->GetUser()->GetUserName() << "/" << m_pNetwork->GetName() << ") ZNC -> IRC [" << sLine << "] (queued)");
+ // Only print if the line won't get sent immediately (same condition as in TrySend()!)
+ if (m_bFloodProtection && m_iSendsAllowed <= 0) {
+ DEBUG("(" << m_pNetwork->GetUser()->GetUserName() << "/" << m_pNetwork->GetName() << ") ZNC -> IRC [" << sLine << "] (queued)");
+ }
m_vsSendQueue.push_back(sLine);
TrySend();
}
void CIRCSock::PutIRCQuick(const CString& sLine) {
- DEBUG("(" << m_pNetwork->GetUser()->GetUserName() << "/" << m_pNetwork->GetName() << ") ZNC -> IRC [" << sLine << "] (queued to front)");
+ // Only print if the line won't get sent immediately (same condition as in TrySend()!)
+ if (m_bFloodProtection && m_iSendsAllowed <= 0) {
+ DEBUG("(" << m_pNetwork->GetUser()->GetUserName() << "/" << m_pNetwork->GetName() << ") ZNC -> IRC [" << sLine << "] (queued to front)");
+ }
m_vsSendQueue.push_front(sLine);
TrySend();
}
void CIRCSock::TrySend() {
- while (!m_vsSendQueue.empty() && (m_iSendsAllowed > 0 || !m_bFloodProtection)) {
+ // This condition must be the same as in PutIRC() and PutIRCQuick()!
+ while (!m_vsSendQueue.empty() && (!m_bFloodProtection || m_iSendsAllowed > 0)) {
m_iSendsAllowed--;
DEBUG("(" << m_pNetwork->GetUser()->GetUserName() << "/" << m_pNetwork->GetName() << ") ZNC -> IRC [" << m_vsSendQueue.front() << "]");
Write(m_vsSendQueue.front() + "\r\n");

No commit comments for this range

Something went wrong with that request. Please try again.