r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL2 Releases] Discuss 2.x releases

Graham
1-Sep-2010
[1993]
for 2.7.8, I have submitted this to rambo http://www.rebol.net/cgi-bin/rambo.r?id=-4776&
BrianH
1-Sep-2010
[1994x2]
R2/Forward is MIT. Use it as you will. Actually, that use is part 
of the reason for its existence. If you run into any compatibility 
problems with older versions of R2 please mention them here. I eventually 
plan to make R2/Forward work on versions as far back as 2.5.0.
If you like you can attribute what you use, but MIT was specificly 
chosen so that wouldn't be required.
Anton
2-Sep-2010
[1996]
Graham, the id in your link is negative(!), and gives this:
	ERROR: Ticket not found. Go back and check your input.
BrianH
2-Sep-2010
[1997]
Before a RAMBO ticket is reviewed and accepted it has a negative 
ID. If it doesn't work now, it must have been reviewed. Don't know 
the current ID.
Graham
2-Sep-2010
[1998x3]
http://www.rebol.net/cgi-bin/rambo.r?id=4400&
As Gab says, the username has to be double url encoded for this to 
work
Can anyone think of any side effects from adding a 'dehex to the 
protocol rules ?
BrianH
2-Sep-2010
[2001]
Yeah. The problem is that it dehexes too soon, not that it doesn't 
dehex soon enough.
Graham
2-Sep-2010
[2002]
Eh?
BrianH
2-Sep-2010
[2003]
Just posted a ticket about this for R3 (by request). This shows the 
problem:
>> http://user%40rebol.com:[blah-:-www-:-rebol-:-com]/
== http://[user-:-rebol-:-com]:[blah-:-www-:-rebol-:-com]/
; should be http://user%40rebol.com:[blah-:-www-:-rebol-:-com]/
Graham
2-Sep-2010
[2004]
>> decode-url http://rebol%2540rebol.com:[password-:-www-:-rebol-:-com]

== [scheme: 'http pass: "password" user: "rebol%40rebol.com" host: 
"www.rebol.co
m"]
BrianH
2-Sep-2010
[2005]
The scheme handler should have to do a dehex in some cases, but isn't 
because the dehex is being done in DECODE-URL first, when it shouldn't 
be.
Graham
2-Sep-2010
[2006]
decode-url should not dehex
BrianH
2-Sep-2010
[2007x2]
Right. And once I figure out how to make it not do so in R3 (based 
on Gabriele's code) then I will port that to R2.
Perhaps DECODE-URL should dehex the split-out parts, but after it 
splits them out. And since it doesn't fully decode the path section, 
it shouldn't dehex it - and probably not dehex the rest, just for 
consistency. If the reconstructed url doesn't rehex the parts then 
it shouldn't dehex them in the first place.
Graham
2-Sep-2010
[2009]
If you feed a url to a function, the only thing you really need to 
dehex is the username and password... nothing else
BrianH
2-Sep-2010
[2010]
It depends on what you mean by "you": "you" the user, "you" the writer 
of DECODE-URL, or "you" the writer of the schemes.
Graham
2-Sep-2010
[2011]
the latter two euwes
BrianH
2-Sep-2010
[2012]
Well, DECODE-URL should probably not dehex the username and password 
unless the (unknown to me) code that reassembles the url! can be 
changed to rehex them. As it should, but I don't know which code 
to fix. The scheme, host and path should not be dehexed in any case.
Graham
2-Sep-2010
[2013]
Probably don't dehex anything in decode-url ...leave it to the schemes
Maxim
2-Sep-2010
[2014]
true... since a scheme can potentially not even represent anything 
network related.
BrianH
2-Sep-2010
[2015]
The problem is that while the scheme might not represent anything 
network-related, the standard for URI syntax is independent of network 
issues. And that standard is pretty strict about hex encoding, regardless 
of the scheme's internal rules. So schemes need to be hex-encoding-aware 
for their specs, whether they are network-related or not.
Graham
2-Sep-2010
[2016]
parse-url should not dehex .. we can fix the rest in the schemes
Maxim
2-Sep-2010
[2017x2]
brian, true.  my error... I'm deep in calculus... my brain is a bit 
mushy ;-)


IIRC the RFC has an BNF-style breakdown, so there should be no surprise 
as to where hexing can and should be interpreted.
I did a fully compliant RFC URL parser which works better than the 
internal one... maybe I should look at it for more details...
BrianH
2-Sep-2010
[2019]
My only concern is that I don't know where is the code that reassembles 
the url! from the results of DECODE-URL. So I don't know how to fix 
any issues in it.
Graham
2-Sep-2010
[2020]
the code is in the sdk
BrianH
2-Sep-2010
[2021]
Which file? What is the function named?
Graham
2-Sep-2010
[2022]
Why do you think it is reassembled?
Maxim
2-Sep-2010
[2023]
IIRC its all in a context.
Graham
2-Sep-2010
[2024]
All urls are deconstructed into an object
BrianH
2-Sep-2010
[2025x3]
Right. But the problem I am trying to fix is this:
>> http://user%40rebol.com:[blah-:-www-:-rebol-:-com]/
== http://[user-:-rebol-:-com]:[blah-:-www-:-rebol-:-com]/
Somewhere in the middle of that process, DECODE-URL is called. What 
is called after that to reassemble the result into a url! value?
The dehex in that process is the one that we need to get rid of.
Graham
2-Sep-2010
[2028]
I suspect we don't have the source to that...
Maxim
2-Sep-2010
[2029]
look in the URL-parser context within the prot-utils.r file.

that is where the url decoding occurs.
Graham
2-Sep-2010
[2030]
There's no 'dehex there
Maxim
2-Sep-2010
[2031]
but I remember having the same issue a while back and traced it to 
the actual datatype always handling the hex values.
Graham
2-Sep-2010
[2032x2]
I don't think it matters
yes, Max ..
Maxim
2-Sep-2010
[2034]
just using the to-url created the same headaches... IIRC
Graham
2-Sep-2010
[2035]
Brian's issue is not a problem
BrianH
2-Sep-2010
[2036]
That is exactly where it matters. That is the whole problem.
Graham
2-Sep-2010
[2037]
We can fix it without worrying about that part
BrianH
2-Sep-2010
[2038]
That part is the only part that needs fixing.
Maxim
2-Sep-2010
[2039x2]
brian .. I agree.. the hexing should stay in the url datatype until 
the actual network scheme requires to handle it.  % characters are 
valid url so they should not get "fixed"
%XX  that is.
Graham
2-Sep-2010
[2041]
But you can't fix it because it's the way Rebol evaluates datatypes 
.. only Carl can fix that.
Maxim
2-Sep-2010
[2042]
exactly.