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

Submitted by:  Stephen Leake <stephen_leake>
Submitted on:  Thu 23 Sep 2010 08:59:14 AM UTC  
 
Category: networkingSeverity: 3 - Normal
Item Group: incorrect behaviorStatus: Fixed
Privacy: PublicAssigned 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 24 Sep 2010 08:58:27 AM UTCstephen_leakeStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1