Commit Graph

59 Commits

Author SHA1 Message Date
Jan Vidar Krey
76ff2a1a13 Fix TLS protocol mismatch assert causing the hub to shutdown. 2014-10-16 23:08:17 +02:00
Jan Vidar Krey
d7c8c9426d Fix memory leak by creating the SSL context once for ADC client.
This is done using reference counted global memory.
2014-08-06 17:37:06 +02:00
Jan Vidar Krey
4919aea8d5 Send information through ADC client interface about the TLS connection. 2014-08-05 17:45:32 +02:00
Jan Vidar Krey
46bdc77066 Added a notification mechanism for sending messages from
another thread to the mainthread in a safe manner.

This is used for the DNS lookup code, and can also
be used by the signal handler to safely report actions back
to the application mainloop without using global variables.
2014-08-05 16:21:56 +02:00
Jan Vidar Krey
652ac5f9b9 Fix #211 - ADC IINF should have flag AP for application name, and VE for version.
x# Please enter the commit message for your changes. Lines starting
2014-08-03 22:51:47 +02:00
Jan Vidar Krey
b5bedfe9e4 uhub-admin: don't busy loop before a connection has been established.
This happened due to the network polling mechanism had nothing to poll
for, so it returned immediately only to be called again (during DNS lookup).

This fix introduces a control pipe that is polled for reading, althoug nothing
is ever sent to that pipe. But, it can be used instead of the signal
handler approach which is currently used for terminating the program.
2014-07-29 17:35:58 +02:00
Jan Vidar Krey
9f78a2e85f Merge branch 'master' of github.com:janvidar/uhub 2014-05-30 15:06:23 +02:00
Jan Vidar Krey
f472fc9424 Fix Clang compile warnings. 2014-05-14 21:00:42 +02:00
Jan Vidar Krey
7706e1cb8a Fix copyright year. 2014-05-14 11:39:18 +02:00
Jan Vidar Krey
bb5865d368 Fix double free() 2013-03-24 09:47:32 +01:00
Jan Vidar Krey
52211a6bac Updated copyright year. 2013-03-22 20:00:40 +01:00
Jan Vidar Krey
f25015927a Clean up white space. 2013-03-22 20:00:40 +01:00
Jan Vidar Krey
b81bb2cbd9 Cleaned up all list iterations, added macro named LIST_FOREACH.
Previously you would have to do something like this:

for (type foo = (type) list_get_first(list); foo; foo = (type) list_get_next(list)
{
    /* code */
}

Now, you can instead write this as:

LIST_FOREACH(type, foo, list,
{
    /* code */
})

Basically, boilerplate stuff including the casting is gone.
2013-03-22 00:58:14 +01:00
Jan Vidar Krey
1fbde2b0fd Re-factored the ADC client code to use the new connection establishment API. 2013-02-05 22:43:59 +01:00
Jan Vidar Krey
d4763e54db Fixed memory leaks. 2012-10-25 04:13:45 +02:00
Jan Vidar Krey
b34b90f95a Start using the async DNS API. 2012-10-24 23:22:10 +02:00
Jan Vidar Krey
50912bdf75 More work on splitting out OpenSSL specific bits. 2012-10-15 20:39:03 +02:00
Jan Vidar Krey
f20c42d05f Wrapped everything OpenSSL related in a SSL_USE_OPENSSL check macro. 2012-10-02 23:59:11 +02:00
Jan Vidar Krey
cc2ead8136 Use util's format_size. 2012-10-09 10:20:58 +02:00
Jan Vidar Krey
2e8c99b7ec Refurbished the ADC hub stress-tester tool; adcrush 2012-10-02 23:59:11 +02:00
Jan Vidar Krey
cb6236691b Added more functionality to the ADC client test code. 2012-10-02 23:59:11 +02:00
Jan Vidar Krey
f0b11dadf1 Refurbished adcrush (hub stress tester). 2012-10-03 13:51:07 +02:00
Jan Vidar Krey
61073bd304 Fix rare protocol parse error due to incorrect recv queue handling. 2012-10-03 13:49:50 +02:00
Jan Vidar Krey
089966d918 Fix ADC client send queue. 2012-10-03 11:44:07 +02:00
Jan Vidar Krey
5b4467acd5 Minor stuff on the uhub-admin tool based on the changes in the ADC client code. 2012-09-28 15:52:39 +02:00
Jan Vidar Krey
ff2e2a3d4c Misc ADC client fixes. 2012-09-28 15:51:39 +02:00
Jan Vidar Krey
df7bbc094f Command arguments handling + cleanups
Fix bug #185 - Args of !commands lost/damaged.
All string arguments were incorrectly freed after being added to the argument list for a command.
Instead this fix makes sure it is properly copied into a new string, and by doing so this requires
a new API for dealing with hub command arguments in a type safe manner, and also allows for each
argument to be cleaned up properly when the command is no longer needed.

This also fixes issues with parse errors for certain types, and optional arguments (previously it was impossible
to tell the difference for an integer with value 0 or if no integer was given).

All arguments can now be accessed through the new functions
hub_command_arg_reset() and hub_command_arg_next().

These functions are also exposed to plug-ins.

The argument type notations for 'n' has changed to mean nick (string),
and 'u' is used for a user (struct hub_user - must be online).
2012-04-18 23:03:05 +02:00
Jan Vidar Krey
fe15c4cb58 Fix VS2010 build issues. 2011-12-22 01:39:40 +01:00
Jan Vidar Krey
ec3afc3a44 Added a simple tool to create and manipulate the uhub sqlite authentication database. 2011-12-20 16:20:54 +01:00
Jan Vidar Krey
ba26f4c5e2 Update copyright notices and added licenses to files that were missing it. 2011-12-19 10:54:47 +01:00
Jan Vidar Krey
318163c066 Added support for dynamic commands.
Dynamic commands are user commands that can be added dynamically to
the hub by a plugin.

The example plugin (mod_example.c) adds a !example command that when
invoked send a message to the user who invoked it.
2011-12-09 10:29:50 +01:00
Jan Vidar Krey
9981acca08 Supply sid with user information in adcclient test code. 2011-11-30 12:32:59 +01:00
Jan Vidar Krey
99e644597d Cleaned up the ADC client test code.
Now works with ADCS (not very well tested, though)
2011-11-29 16:39:09 +01:00
Jan Vidar Krey
1102a86463 Adcrush fixes. 2011-11-28 16:36:45 +01:00
Jan Vidar Krey
bad4512a37 Fix compiler warnings using gcc 4.6. 2011-11-28 16:30:35 +01:00
Jan Vidar Krey
5e253e8442 Fix compile error. 2010-01-22 16:04:36 +01:00
Jan Vidar Krey
2f09fcea84 Added select() backend which can be used as a fallback if epoll is not available. 2010-01-20 18:39:55 +01:00
Jan Vidar Krey
f84073f7cc Various fixes for epoll handling without libevent.
This should take care of most compile issues as well as busy loops caused by unhandled recv() calls returning 0 and general cleanups.
2010-01-19 17:52:58 +01:00
Jan Vidar Krey
53536f191d Crash fix. 2009-11-21 11:47:26 +01:00
Jan Vidar Krey
2910c571b0 Fix protocol probe. Will detect ADC and TLS handshake - any other request
will simply cause the hub to close the connection.
Fix problems with write events not being processed due to a read event taking presendence.
Fix bug #86: Windows does not have "getrlimit()".
2009-10-08 23:16:15 +02:00
Jan Vidar Krey
11e5683a79 Cleanup code somewhat. 2009-10-06 18:33:06 +02:00
Jan Vidar Krey
17416def35 Make sure we flag JOIN/LEAVE messages as really verbose debug output. 2009-10-06 18:28:16 +02:00
Jan Vidar Krey
234f04f495 Removed extra main block. 2009-10-06 18:25:50 +02:00
Jan Vidar Krey
4898454c91 Removed redundant and ununsed operation mode for adcrush. 2009-10-06 18:24:21 +02:00
Jan Vidar Krey
255255ff20 Allow for command line specified host. 2009-10-06 18:16:38 +02:00
Jan Vidar Krey
582bb58ff9 Refactor the address parsing bits of adcrush. 2009-10-06 17:25:38 +02:00
Jan Vidar Krey
de793ea9d2 Some compile fixes and memory leak fixes for ADCRush. 2009-10-06 14:36:49 +02:00
Jan Vidar Krey
310ddf4e9d More work on the ADC client lib. 2009-10-06 12:39:31 +02:00
Jan Vidar Krey
8592aa80d4 Compile fix. 2009-10-06 12:24:44 +02:00
Jan Vidar Krey
96ce64ee07 Fix memory issues in ADC client lib. 2009-09-04 17:18:52 +02:00