Nginx 1.5.8+ API change for ngx_sock_ntop()

Create issue
Issue #1 resolved
Peter Bowey created an issue

Change for function ngx_sock_ntop() in ngx_http_sticky_misc.c to allow for new Nginx API use of function:

            if (digest->data == NULL) {
                        return NGX_ERROR;
+#if defined(nginx_version) && nginx_version >= 1005003
+            digest->len = ngx_sock_ntop(in, sizeof(struct sockaddr_in), digest->data, len, 1);
            digest->len = ngx_sock_ntop(in, digest->data, len, 1);
            return NGX_OK;
            return NGX_OK;

Comments (14)

  1. Peter Bowey reporter

    I have tested the above 'change' with the latest Nginx branch (Nginx 1.5.11)

    The API change to ngx_sock_ntop() changed in Nginx 1.5.8+

    There is an extra parameter required [socklen]. for the ngx_sock_ntop()

  2. Peter Bowey reporter

    Without the above 'change' all 'users' of Nginx 1.5.8+ will see a compile error - due to the number of parameters expected on the new Nginx API change. I pull builds from Nginx trunk, so I track the [many] changes.

    By the way, this nginx-sticky-module-ng version is a great addition, and I thank you for the changes and enhancements made.

  3. S. Goodman repo owner

    i have this now running on our testservers; looks find so far. if we see no problems i'll push the changes tomorrow; thanx again for your support; we usually test against the stable branch.

  4. Peter Bowey reporter

    The issue is also documented here:

    Additionally, you could checkout another 'patch' for the older IE browsers <9, see:

    This 'patch' allows IE <9 to use "Max-Age" directive instead of "Expires" to set cookie expiration.

    I have recently 'switched' to using SEnginx, see:, which has a more improved version of the methods here.

  5. steve katen

    Just attempted to compile with 1.5.11 and got the error. Will wait patiently for an update.

    PS: Thanks for branching this module and working to make it better. Some of the initial suggestions were mine and I REALLY appreciate it.

  6. steve katen

    Looks to work. No longer getting compile errors. Haven't done any testing yet, but the installation worked with the update. +1

  7. steve katen

    Looks good on this end. I pushed it out on two machine and will monitor tonight, but all of my testing has passed so far. If there are no errors over the next few hours I will get it out of the rest of the environment.

    Thx, you're awesome.

  8. S. Goodman repo owner

    @kdoto, do you see any issues? i tagged the release now as 1.2.2 and included the max-age/expires - patch too.

  9. steve katen

    No issues on this end. I rolled it out to full production over the weekend and haven't had a single issue. Thx for assist, apologize I didn't respond sooner.

  10. Log in to comment