Coder Social home page Coder Social logo

rgolubtsov / dnsresolvd-multilang Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 664 KB

A daemon that performs DNS lookups for the given hostname passed in an HTTP request, with the focus on its implementation using various programming languages.

License: MIT License

Makefile 4.61% C 19.64% JavaScript 3.70% Lua 5.41% Perl 6.00% Python 6.03% Vala 6.32% Elixir 7.13% Erlang 6.53% LFE 7.30% Clojure 4.70% Java 7.37% Shell 3.95% Go 5.06% Genie 6.26%
bash c clojure daemon dns elixir erlang genie http java javascript lfe lua multilang perl python resolver vala

dnsresolvd-multilang's People

Contributors

rgolubtsov avatar

Stargazers

 avatar

Watchers

 avatar  avatar

dnsresolvd-multilang's Issues

libmicrohttpd: Fix Segfaults when there are no request params given at all.

Segfaults raised when making requests (both POST and GET) to the daemon with no request params given. Both Linux builds (Ubuntu Server and Arch Linux) are affected. E.g.:

$ curl 'http://localhost:8765/?'
$ curl 'http://localhost:8765/'
$ curl 'http://localhost:8765'
$ curl -d '' http://localhost:8765

But not the following ones:

$ curl 'http://localhost:8765/?&'
$ curl -XPOST http://localhost:8765

The obvious solution is to add appropriate checks and safeguards. ๐Ÿ‘

Luvit: Ported from Node.js, one-to-one -- emitting events implicitly not working.

Look at the following piece of code: ๐Ÿ˜‘๐Ÿ˜๐Ÿ˜

    daemon:on(aux._EVE_ERROR, function(e)
        ret = aux._EXIT_FAILURE

        if (e == aux._ERR_EADDRINUSE) then
            print(daemon_name .. aux._ERR_CANNOT_START_SERVER
                              .. aux._ERR_SRV_PORT_IS_IN_USE
                              .. aux._NEW_LINE)
        else
            print(daemon_name .. aux._ERR_CANNOT_START_SERVER
                              .. aux._ERR_SRV_UNKNOWN_REASON
                              .. aux._NEW_LINE)
        end

        _cleanups_fixate()

        return ret
    end)

    daemon:on(aux._EVE_LISTENING, function(e)
        print(aux._MSG_SERVER_STARTED_1 .. port_number .. aux._NEW_LINE
           .. aux._MSG_SERVER_STARTED_2)
    end)

    pp.prettyPrint(daemon)

    -- FIXME: Investigate why do we need emitting events explicitly?
    --        This does not affect error events anyway, perplexedly.
    daemon:emit(aux._EVE_LISTENING                 )
--  daemon:emit(aux._EVE_ERROR, aux._ERR_EADDRINUSE)
--  daemon:emit(aux._EVE_ERROR                     )

Do we need emitting events explicitly? ๐Ÿ˜’๐Ÿ˜ฒ๐Ÿ˜•
No. ๐Ÿ˜‰ But what to do โ€“ see subj.? ๐Ÿ˜Š

libsoup/Vala/Genie: Bug: Trying to quit main loop on cleanup when the daemon wasn't yet started.

When there is an attempt to start up the daemon incorrectly (e.g. without any cmd-line args given, wrong port number), the helper method cleanups_fixate(MainLoop) tries to assert that the main loop is already running and hence quitting it. This leads GLib to complain:

$ ./dnsresolvd; echo $?
./dnsresolvd: There must be one or two args passed: 0 args found

Usage: ./dnsresolvd <port_number> [-V]


** (process:37836): CRITICAL **: aux_cleanups_fixate: assertion 'loop != NULL' failed
1

Both Vala and Genie daemon implementations are affected.

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.