bugmonotone - Bugs: bug #31106, 'localhost:port?branch' not...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #31106: 'localhost:port?branch' not accepted as netsync URI

Submitter:  Stephen Leake <stephen_leake>
Submitted:  Thu 23 Sep 2010 08:59:14 AM UTC
   
 
Category:  networking Severity:  3 - Normal
Item Group:  incorrect behavior Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
mtn version --full: 

0.99dev

Fri 24 Sep 2010 10:36:22 AM UTC, comment #4: 

Actually not, because I remember I did set a default there, but apparently this only works for URLs without port specification. See network/connection_info.cc line 250. For "localhost:123" localhost is apparently wrongly assumed as scheme and not as host and thus the scheme.empty() check fails there.

We could certainly change the parse_uri() implementation in uri.cc line 114ff here a bit to check whether a slash follows the colon and only then recognize it as scheme (line 118).

Thomas Keller <tommyd>
Group administrator
Fri 24 Sep 2010 08:58:27 AM UTC, comment #3: 

The real answer is that the scheme is not optional; it does not default to 'mtn'. monotone.texi fixed in 32c5dc1fac5aded74dcb3ef0570b255a0e5963a3

Stephen Leake <stephen_leake>
Group Member
Thu 23 Sep 2010 12:57:53 PM UTC, comment #2: 

So if the URL contains a port, the scheme must be present, in order to disambiguate the colon. That makes sense. It would help if monotone.texi pointed this out.

Stephen Leake <stephen_leake>
Group Member
Thu 23 Sep 2010 10:27:16 AM UTC, comment #1: 

The invariant should probably be fixed, but the code works correctly - since you've missed to add mtn:// as scheme (and technically or rather URL-wise a scheme does not need to have the double '//' slashes in it - see f.e. newsgroup urls) mtn treats the "localhost" part as scheme and the number as host and bails out.

Thomas Keller <tommyd>
Group administrator
Thu 23 Sep 2010 08:59:14 AM UTC, original submission:  

I'm attempting to eliminate the 'deprecated' warnings from
tests/automate_netsync. However, the URI parser fails.

Here's the old command:

check(mtn2("automate", "pull", srv.address, "bar"), 0, nil, nil)

this generates the command:

automate pull localhost:45056 bar

which gives the warning:

mtn: warning: separate server and pattern arguments are deprecated, please consider using the URI calling syntax instead

Here's my update:

check(mtn2("automate", "pull", srv.address .. "?bar"), 0, nil, nil)

this generates the command:

automate pull localhost:45056?bar

which gives the error:

mtn: connecting to localhost://27145
mtn: fatal: error: ../monotone.netsync.automate/netsync.cc:89: I(!host.empty())

monotone.texi says the URI syntax is:

<scheme>://[[<user>@@]<host>[:<port>]][/<path>][?<pattern>[;-<exclude-pattern>[...]]]

So this should be accepted.

Stephen Leake <stephen_leake>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tommyd (Posted a comment)
  • -email is unavailable- added by stephen_leake (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-24 stephen_leake StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code