New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket URI with a port needs '/' suffix #1519

Closed
michaelrsweet opened this Issue Mar 29, 2006 · 3 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Collaborator

michaelrsweet commented Mar 29, 2006

Version: 1.2-current
CUPS.org User: kmuto.debian

I noticed "socket://hostname:9100" style won't work when I'd like to use another port, such as "socket://hostname:9101".
This is because httpSeparateURI() requires "/" after custom port number.

It's nice if you can fix to allow both "backend://hostname:port" and "backend://hostname:port/", but just modifing socket example URI of choose-uri.tmpl is maybe enough.

@michaelrsweet

This comment has been minimized.

Collaborator

michaelrsweet commented Mar 29, 2006

CUPS.org User: mike

This is a definite bug in httpSeparateURI() - it should allow for URIs without a trailing slash - and it explains a recent report on the mailing lists.

@michaelrsweet

This comment has been minimized.

Collaborator

michaelrsweet commented Mar 29, 2006

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet

This comment has been minimized.

Collaborator

michaelrsweet commented Mar 29, 2006

"str1519.patch":

Index: http-support.c

--- http-support.c (revision 5348)
+++ http-support.c (working copy)
@@ -1057,7 +1057,7 @@

   *port = strtol(uri + 1, (char **)&uri, 10);
  •  if (*uri != '/')
    
  •  if (_uri != '/' && *uri)
    

    {
    *port = 0;
    return (HTTP_URI_BAD_PORT);
    Index: testhttp.c

    --- testhttp.c (revision 5348)
    +++ testhttp.c (working copy)
    @@ -114,6 +114,8 @@
    /_ Missing resource */
    { HTTP_URI_MISSING_RESOURCE, "socket://[::192.168.2.1]",
    "socket", "", "::192.168.2.1", "/", 9100, 0 },
  •         { HTTP_URI_MISSING_RESOURCE, "socket://192.168.1.1:9101",
    
  •           "socket", "", "192.168.1.1", "/", 9101 },
    
          /* Bad URI */
          { HTTP_URI_BAD_URI, "",
    

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment