Commit Graph

2448 Commits

Author SHA1 Message Date
Alexey Sokolov ea58912093 Hide every symbol except ZNCModInfo from modules.
This means that now it's possible to have the same class names in
different modules, which reduces chances of weird errors.

Thanks to mclc for noticing this.
2011-07-15 22:56:47 +07:00
Alexey Sokolov efda366d44 Fix znc-buildmod if znc was compiled out of tree. 2011-07-15 21:44:15 +07:00
Uli Schlachter 789f1ff7b5 Update to latest Csocket
This fixes the "busy loop waiting for an SSL handshake to finish" which the last
"Update to latest Csocket" was already supposed to fix. However, that fix had a
bug if poll() is used instead of select().

poll()'s timeout argument is in milliseconds while select also allows
microseconds. Since Csocket originally used select(), it expects the
microseconds-approach. This means it has to divide by 1000 to get the timeout
argument for poll().

However, the iQuickReset which was used to "fix" (rather: hide) the busy loop
was less than 1ms so this still resulted in a timeout of 0 (= busy loop) because
integer division truncates the result.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-13 20:47:56 +02:00
Uli Schlachter 4fbca80705 WebMods: Set another cookie if the IP check fails
This means that they will get a new cookie on the next request. This will make
sure that you will be able to use webadmin again if your IP changed (which seems
to happen to quite a number of people).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-13 20:40:55 +02:00
Uli Schlachter 00024b1b3a znc-buildmod: Print znc's version number
This helps people figuring out that they are still building their modules for
the wrong znc version since they have more than one installation on their box.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-13 19:56:48 +02:00
Alexey Sokolov 63e8d42e3d Don't fail to load if can't find fixfreenode. 2011-07-10 19:46:34 +07:00
Alexey Sokolov 7ea5e1fd4c Remove fixfreenode module.
Old CAPAB method doesn't work with freenode now, and new CAP method is
handled by CAP support in the core.
2011-07-06 00:52:18 +07:00
Uli Schlachter 88e7f093a1 Update to latest Csocket
Fixes:

- A possible crash bug for empty DNS replies with c-ares. E.g. a AAAA lookup for
  google.com doesn't give any reply but is still successful. This might be a
  c-ares bug (there is ARES_ENODATA) or c-ares just changed its behavior?
  (No bug report, just noticed accidentally)
- Connecting to ipv4-only hosts with a v6 bindhost caused weird errors:
  https://github.com/znc/znc/issues/47
- There was a pull request for some DSA server certificate thingy:
  https://github.com/znc/znc/pull/46
- Busy loop waiting for an SSL handshake to finish:
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631590
- Some other stuff? No idea what some of the changes in here are actually doing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-26 12:11:40 +02:00
Uli Schlachter 554429a61f Fix a bug in MCString::Encode()
For character values above 127, the signed char that could be used here did the
wrong thing. That is, *it >> 4 returned a negative value and the array hexdigits
was read indexed with that wrong value.

Fix this by explicitly using unsigned char.

Thanks to crocket for reporting this bug which he found with perform (broken
entries after a restart/reload).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-13 15:19:17 +02:00
Uli Schlachter 25ce7de020 Only export a single function from modules
This moves the version check into the function which loads the module info. That
way, we just need a single dlsym() call per module and thus can't get any errors
from the second dlsym() call. And IMHO this feels nicer anyway. ;-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-11 18:33:50 +02:00
Uli Schlachter ca97dca6dc Use references instead of pointers for CModInfo
This works fine and reduces the chances of memory leaks.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-11 18:16:00 +02:00
Alexey Sokolov d683aea48d Merge branch 'modinfo' 2011-06-11 18:32:09 +07:00
Alexey Sokolov f7c4f5459c Support wiki pages names in python modules.
Also this fixes showing python modules in available modules list.
2011-06-11 18:28:46 +07:00
Alexey Sokolov 79e78608b3 Support wiki pages names for perl modules. 2011-06-11 18:21:06 +07:00
Alexey Sokolov 262216731b Add link to wiki page from any nonextra module. 2011-06-11 18:09:56 +07:00
Alexey Sokolov 0c840f922d Modules can now provide its wiki page name.
It's shown on webadmin as a link.
2011-06-11 17:46:37 +07:00
Alexey Sokolov e6e3331457 Add a way for module to customize additional info.
For that you need to write a specialization of template function
void TModInfo<CYourModule>(CModInfo&), and inside it put needed values
to the argument.
2011-06-11 17:28:15 +07:00
Alexey Sokolov ad9f1f8ab9 Change a way for modules to provide description.
Now there're only 2 functions which modules export:
ZNCModVersion() and ZNCModInfo().

ZNCModInfo() returns CModInfo instance, which contains
description, globality, function for loading the module. It needs to be
deleted afterwise.
2011-06-11 17:19:36 +07:00
Uli Schlachter 5ca6291f8a Check the for our minimum required autoconf version
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-10 16:39:51 +02:00
Uli Schlachter 76010c16bd Merge pull request #55 from Un1matr1x/bugfix/white_space_edition
remove evil trailing white space
2011-06-09 12:38:59 -07:00
Un1matr1x 708366d9ae remove some more of the evil trailing white spaces & tabs 2011-06-09 21:29:13 +02:00
Un1matr1x 43d0f6d121 Merge branch 'master' of git://github.com/znc/znc into white_space_edition 2011-06-09 21:00:33 +02:00
Alexey Sokolov 4dbd088fd7 Support compiling python modules in cwd 2011-06-08 14:14:53 +07:00
Un1matr1x d77298545e tabs in newlines could be removed² 2011-06-08 06:51:13 +02:00
Un1matr1x 7a4a0e9537 Merge branch 'master' of git://github.com/znc/znc into bugfix/white_space_edition 2011-06-08 06:47:46 +02:00
Kyle Fuller 98d8e5e37e CUser: remove some non-existant methods from the headers
These include:

- SendFile
- GetFile
- ResumeFile

Which were removed when DCC was moved out of the core
2011-06-08 04:04:08 +01:00
Brian 3a16fe54c1 Redo commands for send_raw modules. Also, use the new CModCommand stuff. 2011-06-07 23:31:24 +01:00
Un1matr1x 718d28070a remove evil trailing white space 2011-06-07 21:39:25 +02:00
Uli Schlachter f6113b322d Merge pull request #50 from bpcampbe/TrimBuffer
Add CChan::TrimBuffer and have SetBufferCount call it.
2011-06-07 09:23:05 -07:00
Kyle Fuller ea19e3f3dc Improve the debug messages from identfile module 2011-06-04 17:00:10 +01:00
Alexey Sokolov 797b0a7ff9 Check what make should user use and ask user to do that. 2011-06-04 14:19:54 +07:00
Alexey Sokolov 4a4104a480 Add regex comment for CUser::IsValidUserName() 2011-06-02 08:10:46 +07:00
Kyle Fuller e83e14ab67 Do not include DCCSock in mod(perl|python) 2011-06-01 22:19:30 +01:00
Kyle Fuller d71da02a81 Make schat use DCCBindHost 2011-06-01 20:21:27 +01:00
Kyle Fuller c635caeab2 Use the module save path for dcc's, and remove DLPath since it is no longer used. 2011-06-01 20:21:27 +01:00
Kyle Fuller 16047eaf81 Move dcc file transfers to their own module 2011-06-01 20:21:27 +01:00
Kyle Fuller 8f508cb4a5 Migrate dcc bouncing to its own module 2011-06-01 20:21:27 +01:00
Kyle Fuller 0b360c0102 Remove OnDCCUserSend module hook 2011-06-01 20:21:27 +01:00
Kyle Fuller 611e086cbf Rename "str" to "String" in the admin panel.
This was accidentally renamed in abed808121.
2011-05-31 02:00:23 +01:00
Brian c3a15bf695 Add CChan::TrimBuffer and have SetBufferCount call it. 2011-05-29 18:37:05 -06:00
Kyle Fuller 456dfde05f Add a web interface to the certauth module 2011-05-25 23:52:05 +01:00
Kyle Fuller 1c0edff722 Make certauth accept a optional argument of the key when you add a key 2011-05-25 23:52:05 +01:00
Kyle Fuller 66e250783d Make certauth use the CModCommand API 2011-05-25 23:52:05 +01:00
Kyle Fuller abed808121 Rename a variable from 'string' to 'str' because 'string' shadows a global declaration 2011-05-25 16:48:02 +01:00
Uli Schlachter 4324d5ff02 Merge branch 'master' of https://github.com/pfn/znc
Conflicts:
	modules/extra/away.cpp

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-21 13:58:41 +02:00
Uli Schlachter 6deae62c5b autoattach: Allow limiting by hostmask
This adds hostmasks to autoattach. E.g. if you don't like me, you add an entry
of "! * psychon!*" and autoattach won't attach you to channels just because I
said something. The same can be done in the non-negated case, "only attach when
foo says something".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-15 13:15:51 +02:00
Uli Schlachter 2985efb524 Correctly handle excessive web sessions
The old code didn't actually destroy the session, but only made sure we couldn't
use it anymore. What a waste of memory.

This was tested by adding a DEBUG()-call to CWebSock::~CWebSock():

Before this patch:

 Page Request [/]
 Remote IP:   127.0.0.1; discarding session [ca104adaa54f933b6b8394e88e68ab0d22e0fc227ed23e93d1421e4d3fda8211]
 Auto generated session: [d40364e8d0a55432b86a1b2598865c2323e35cc6e77cade35b9a1b7605712ca6]

After this patch:

 Page Request [/]
 Remote IP:   127.0.0.1; discarding session [707e3b262fe47b93d8c796354574506c398cc5b5d84aa2972dc3d031d8f731f5]
 Destroying session [707e3b262fe47b93d8c796354574506c398cc5b5d84aa2972dc3d031d8f731f5, 127.0.0.1 for <unknown>
 Auto generated session: [47de1c82a8b6eaae54a9cc8c29163ab53ec2add7198cf1df7f80506ea1bda2b6]

Obviously, the destructor is only called after this change.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 18:19:08 +02:00
Uli Schlachter 3e591e7043 Set errno in CListener::Listen()
CSocket doesn't necessarily set errno, but the callers of Listen() assume an
error message in errno.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 17:24:10 +02:00
Uli Schlachter 3034d1f81a Make it possible to use ExpandString-stuff in QuitMsg
You can now use "Uptime: %uptime%" as your quit message, yay!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 16:40:40 +02:00
Uli Schlachter eb229659e5 Warn if a *module message is ignored
Some modules (e.g. webadmin) don't handle messages to *module in any way. Make
it clear to the user why they didn't get any reply back in this case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 15:48:47 +02:00