GithubHelp home page GithubHelp logo

zer0-one / praetor Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 2.0 183 KB

A free and open source IRC bot, designed to be robust, portable, and easily extensible

Makefile 1.27% C 96.32% Shell 0.19% Perl 1.61% Dockerfile 0.60%
c c99 irc irc-bot plugins portable posix

praetor's People

Contributors

zer0-one avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

praetor's Issues

Add option to force address family

Modify the inet API to allow for forcing a particular address family. The user should be able to force IPv4 or IPv6, even when the option would fail.

Hash table resolves collisions in unexpected manner

https://github.com/Zer0-One/praetor/blob/master/src/util/hashtable.c#L122-L132

void* htable_lookup(struct htable* table, void* key, size_t key_len){
    size_t index = (hash(key, key_len) % table->bucket_count);
    struct htable_data* entry = &table->bucket_array[index];
    while(entry != 0){
        if(entry->key == key){
            return entry->value;
        }
        entry = entry->next;
    }
    return NULL;
}

The hash table doesn't store the actual indexing key with its mapped value, it only stores a pointer to the key, and then uses this pointer to resolve collisions using a linear search. This will cause unexpected behaviour when a user tries to look up a value using the same key stored at a different address.

irc_msg_send() for messages longer than MSG_SIZE_MAX

When irc_msg_send() is called with a message length greater than MSG_SIZE_MAX, praetor should optionally split the message into as many as needed to send the entire message.

Or, we can defer this to the caller. Not sure yet.

Behavior on failure to connect on startup

If praetor can't connect to any IRC networks, then it can't be issued commands via IRC to attempt more connects and reconnects.

If it fails to connect to any networks on startup, should the daemon exit, or should we define some kind of retry behavior? This sounds like it should be user-configurable. Maybe add an option to the config?

Hash table needs improved documentation

02:38 <+iphy> Does [add] replace the old entry when one exists?
02:39 <+iphy> Does it do so by allocating, or does it modify the existing bucket?
02:39 <+iphy> I.e. in oom situations, can I still replace existing values?
02:39 <+iphy> What comparator is used?
02:43 <+iphy> What happens if load threshold is negative or 0 or above 1?
02:49 <+iphy> The hash function is not specific to add, so it should be specified in the hash table docs, not in the add docs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.