Menu

Connecting to the HTTP interface fails

Help
2019-10-02
2022-05-15
  • Roy Graeme Harrison

    Connecting to the HTTP interface fails. The HTTP settings are the default 127.0.0.1:6789. I have seen this on 1.73 on Windows 10 and 1.75 on Windows 7. The console and log error is:

    HTTP Client 127.0.0.1, Message Receive failed, WSAError 0

    However looking at the source code, the code to get the error is commented out, so the real cause is a lack of received bytes. I have played with firewalls and failed to change this result.

    Can anyone help please?

    Thanks,

    Roy Harrison

     
  • smegnl

    smegnl - 2019-10-02

    I am having the exact same problem. no https with the DualDhcp product, which is the same as opendhcp with DNS added in.

     
  • Andrew McMahon

    Andrew McMahon - 2019-11-23

    I was having this issue on Windows 10. I'm not sure if this was the actual fix or coincidental, but after clearing the DNS cache (from admin command prompt, "ipconfig /flushdns") and restarting OpenDHCPServer I'm no longer getting the error.

    Edit: I spoke too soon, the server is running now and assigning IPs but the HTTP interface still doesn't work.

    2nd Edit: Eventually got it working. I think the issue is with metrics in the routing table but I could be wrong. I changed HTTPServer to 127.0.0.1 rather than my adapter address (192.168.1.1) and now it will load.

     

    Last edit: Andrew McMahon 2019-11-23
  • Roy Graeme Harrison

    Thanks, Andrew. I have worked around my problem by the fortunate situation of only having to provide a single fixed IP address. My code no longer needs to use the web page to discover the ragne of IP addresses that have been provided. That is no solution for most applications of course.

     
  • Max Senft

    Max Senft - 2022-01-05

    Hi.

    Problem is a bug in OpenDHCPServer.cpp. It exists when OpenDHCPServer is run in the console using the "-v" argument.

    I guess

    void procHTTP(data19 *req)
    {
    ...
        if (verbatim || cfig.dhcpLogLevel >= 1 && (errno || req->bytes <= 0))
        {
            sprintf(logBuff, "HTTP Client %s, Message Receive failed, WSAError %d", IP2String(tempbuff, req->remote.sin_addr.s_addr), errno);
    ...
    }
    

    should be

    void procHTTP(data19 *req)
    {
    ...
        if ((verbatim || cfig.dhcpLogLevel >= 1) && (errno || req->bytes <= 0))
        {
            sprintf(logBuff, "HTTP Client %s, Message Receive failed, WSAError %d", IP2String(tempbuff, req->remote.sin_addr.s_addr), errno);
    ...
    }
    

    --> There are round brackets missing to group the "verbatim || cfig.dhcpLogLevel >= 1" condition section.

    Regards
    Max
    PS: It's sad that it's not possible to create fixes (i.e pull requests as over at GitHub).

     

    Last edit: Max Senft 2022-01-05
  • Taras

    Taras - 2022-05-15

    I made changes to version 1.80 and compiled it

     

Log in to post a comment.