Commit Graph

82 Commits

Author SHA1 Message Date
Boris Pek cf3a6e06df Secure URLs: http --> https (part 2) 2019-04-23 15:59:03 +02:00
Boris Pek d25fead3a8 Fix spelling errors 2019-02-25 19:46:24 +01:00
Boris Pek ef83b31cec Fix spelling errors 2019-02-25 19:46:24 +01:00
Felix Brucker 99711a5c6e Allow many large messages 2018-10-11 23:29:32 +02:00
Jan Vidar Krey dc80644471 Merge pull request #28 from klondi/unrestricted_users
Allow unrestricted users on uhub
2014-12-15 09:36:49 +01:00
klondike c15f201d70 Add auth_cred_is_unrestricted 2014-11-24 12:11:41 +01:00
klondike d86ef503b3 Add opbots and unrestricted bots 2014-11-24 12:11:11 +01:00
Francisco Blas (klondike) Izquierdo Riera 8a7e892aeb Add support for 4 byte UTF-8 characters and stricter character checking 2014-11-24 10:28:50 +01:00
Tillmann Karras c0ee55325c Release all memory in tests and fix comment 2014-10-06 21:06:33 +02:00
Jan Vidar Krey 1526d63403 Simplify list_clear(), allow NULL as free() function pointer.
This makes it redundant to create a null_free() or dummy_free() function
that does nothing.
2014-08-05 13:08:46 +02:00
Jan Vidar Krey 7706e1cb8a Fix copyright year. 2014-05-14 11:39:18 +02:00
Jan Vidar Krey 5e06b46deb Fix compile warning due to missing newline at EOF. 2014-05-14 11:00:04 +02:00
Jan Vidar Krey e2b0757f4a Improved flood control counting to strictly not allow more than
the given amount of messages in the configured interval.

The previous behavior allowed n+2 messages in the interval, due to
two off by one comparison rules.

In addition, if flooding is detected then each new message after the flooding
is detected will reset the interval timer, which means the client
cannot send another message until the timeout interval expires.
2014-05-08 13:30:09 +02:00
Jan Vidar Krey cd5c4ee622 Optimize lookups by CID and nick.
This used to be a linear search O(n), but is now done
as a red-black tree O(log n) instead.

These operations can be further opimized with a hash-table
which would acheive near constant time lookups.
2013-03-23 22:11:05 +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 2d6f69d299 Cleaned up usage of linked lists and added missing functionality.
- Added a list_remove_first() which is generally better than list_remove()
  provided you want to remove the first element.
- Added a list_append_list() to append and move all nodes from one list to
  another.
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
Emery ce68c446d1 Optional systemd journal logging 2012-11-11 15:21:00 -06:00
Jan Vidar Krey 594801df46 Fix windows compile issues. 2012-11-01 21:52:33 +01:00
Jan Vidar Krey 3dcbb63a31 Implemented a simlpe red-black tree which should give better performance
for certain lookups.

The rb_tree will act as a general purpose key/value storage, and
also give a performance boost in the cases where the other
simple alternative would be to use a linked_list.

On average this should give on average O(log n) lookups, while the linked_list
would be O(n) at worst.
2012-11-01 21:46:44 +01:00
Jan Vidar Krey d106ecdc65 Bugfixes for pthreads. 2012-10-25 04:10:42 +02:00
Jan Vidar Krey 99a2307d1d Simple compile fix. 2012-10-25 00:44:21 +02:00
Jan Vidar Krey 168fc5bfcc Abstracted the threading code so that it works with Winthreads and pthreads. 2012-10-25 00:39:44 +02:00
Jan Vidar Krey 8086d89e23 Better formatting of byte sizes. 2012-10-02 23:59:11 +02:00
Jan Vidar Krey 10d8157477 Added a utility function to convert an arbitrary byte size into a human readable string.
E.g. 849484 becomes "829.57 KB".
2012-10-09 10:20:12 +02:00
Tillmann Karras 16ee65422d Fix cbuffer initialization
If no data was appended, cbuf_get() would return a pointer to
uninitialized memory. Now it returns a pointer to a string of zero
length.
2012-10-03 22:40:33 +02:00
Jan Vidar Krey 20a847e1b4 Moved the ipcalc code to the network directory. 2012-10-03 12:59:05 +02:00
Jan Vidar Krey f3754fb4e4 Fix Windows file read discrepancy. 2012-05-14 23:33:54 +02:00
Tilka 274f17bce0 use "I64u" instead of PRIu64 on Windows 2012-05-11 16:45:07 +02:00
Tilka 8365278cbf fix uhub_itoa() and uhub_ulltoa() 2012-05-10 23:24:42 +02:00
Tilka 05fd6bb723 minimal changes 2012-05-09 23:27:06 +02:00
Tilka d49127b507 changed all calls to assert() to uhub_assert() 2012-05-02 21:06:46 +02:00
Jan Vidar Krey 458c7fa741 Remove list assertion when removing element that is not in the list.
Breaks autotest.
2012-05-01 20:40:27 +02:00
Tilka 776f7d0bff use "0" instead of "false"
otherwise compilation breaks when using a C90 compiler
2012-04-21 13:35:06 +02:00
Tilka c5036a3ff8 fix random crashes upon !reload
A struct plugin_hub_internals was falsely casted to struct
plugin_callback_data. This caused the contained commands list pointer to point to
a struct hub_info and commands->size took the value of a pointer to a struct
net_connection. Since size is increased/decreased every time an item is
added to/removed from the list, this resulted in some funny crashes.

This fix is a little dirty as it exports some internals.
2012-04-21 09:22:06 +02:00
Jan Vidar Krey a9b5c6db38 Fixed minor issues found with static code analyzis (Clang). 2012-01-13 01:31:34 +01:00
Jan Vidar Krey b24d4b85cd Split out the command buffer code to a generic buffer. 2011-12-21 13:53:53 +01:00
Jan Vidar Krey f2cb84180a Refactored command parsing.
Allows for automatically tested command parsing by splitting parsing
and invokation of the commands.
2011-12-19 00:34:45 +01:00
Jan Vidar Krey afda1d7b9d Added a LOG_PLUGIN macro for plugin output debug messages.
Converted all TRACE messages related to plugins to LOG_PLUGIN.
2011-12-09 16:38:11 +01:00
Jan Vidar Krey 1dc79c641c Cleanup: do not use strcat(). 2011-12-09 15:58:58 +01:00
Jan Vidar Krey 9f16298688 Fix minor valgrind issues
- Fix valgrind invalid write of 1 byte.
- Fix a few plugin related memory leaks.
2011-12-01 15:14:01 +01:00
Jan Vidar Krey 2396d8555c Fix bug #167 - Build errors on OpenBSD.
- Don't link with -ldl, as it is not needed in most cases
- Don't compile plugins if USE_PLUGINS=NO
- Fix warning about missing newline at end of getopt.h
- Removed the O_NOATIME open() flag from the logging plugin.
- Removed the O_LARGEFILE open() flag. _FILE_OFFSET_BITS is 64.
- Use fsync() if fdatasync() is not available for log file writing.
- Replaced some sprintf() with snprintf() due to compiler warnings (though, they were length limited otherwise).
- Replaced two occurences of strcpy() with memcpy().
2011-11-30 13:43:39 +01:00
Jan Vidar Krey 3b4a199673 Fix null pointer crash while encountering configuration file errors during parsing. 2011-10-17 09:50:14 +02:00
Jan Vidar Krey d01813ef48 Added project files for Visual Studio 2010. 2011-02-05 17:13:26 +01:00
Jan Vidar Krey 03b4252ab5 Link fix in case not everything is linked as one binary. 2011-01-06 12:25:28 +01:00
Jan Vidar Krey 4c238dd946 Fix compile warning. 2011-01-03 00:12:40 +01:00
Jan Vidar Krey 9b57279628 Many Visual C++ compile warnings and errors fixed. 2011-01-03 00:03:07 +01:00
Jan Vidar Krey b993e97bb4 Fix bug in config parser where 'foo=bar' did not work, but 'foo = bar' did work due to extra whitespace between tokens. 2010-11-18 22:43:48 +01:00
Jan Vidar Krey 16fc3ea68e Clean up argument parsing for plugins. 2010-11-12 18:03:39 +01:00