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

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

BrianH
25-Jun-2007
[1796]
It might be faster too.
Graham
25-Jun-2007
[1797x6]
Had the same result ...
Since my encapped applications work fine under Firedaemon, I am going 
to try and encapCheyenne next.
This was all I was doing:


call/wait "gswin32.exe -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=test.pdf 
-f test.ps"
https://www.compkarori.co.nz/cgi-bin/showfile.rsp?key=#{E7F8390D60C36AFFB11252677A3586A5}

gives an empty value for key
remove the # and it's okay.
bug report :)
Oldes
26-Jun-2007
[1803]
it's bug in Rebol's decode-url:

>> probe decode-url https://www.compkarori.co.nz/cgi-bin/showfile.rsp?key=#blabla
make object! [
    user: none
    pass: none
    host: "www.compkarori.co.nz"
    port-id: none
    path: "cgi-bin/"
    target: "showfile.rsp?key="
]
Graham
26-Jun-2007
[1804x6]
Interesting .. should we Rambo it?
Or, is it because # is not a legal character in a url?
Is there a limit to how much you can send in a Post command?
As you might have read from above, I am attempting to post postscript 
to a RSP script to convert to PDF.
4k of postscript sees the script complete.
But 92Kb of postscript - and I get this response

make object! [
    code: 800
    type: 'user
    id: 'message

    arg1: {Error.  Target url: https://www.compkarori.co.nz:443/cgi-bin/createpdf.rsp 
    could not be retrieved.  Server response: none}
    arg2: none
    arg3: none

    near: [page: read/custom https://www.compkarori.co.nz/cgi-bin/createpdf.rsp
    reduce ['POST join "content=" content]]
    where: none
]
I think a POST should be okay with 100kb of text .. so perhaps there 
is problem with Cheyenne's handling?
Maybe I should try and simulate a multipart form post on the client 
side instead??
Dockimbel
26-Jun-2007
[1810x2]
Check your httpd.cfg file to see if you find a 'post-max directive.
If you find one, set it to higher limit (unit is Kb) or just remove 
it.
Chris
26-Jun-2007
[1812]
G: # is used to link to anchors.  e.g. http://www.rebol.com/cgi-bin/blog.r?view=0338#comments
Gabriele
26-Jun-2007
[1813]
you need to encode # with percent encoding, and you need to make 
sure rebol is nod decoding that for you silently (the url! datatype 
does this unfortunately).
Oldes
26-Jun-2007
[1814]
# is a legal url char... Rebol's decode-url is full of bugs for example 
this url is bad decoded as well: http://test/path/target?text/something
Graham
26-Jun-2007
[1815x5]
I did a grep on the sources,and I can only find post-max in 2 files 
...

mod-static
post-max: [integer!] in main

httpd.r
limit: select req/cfg 'post-max
Not in httpd.cfg
I guess I'll just create a limit in httpd.r
Hmm.  Didn't help either.  Still same error.
Checking the server logs .. looks like the post is not even registering 
there either.
Dockimbel
27-Jun-2007
[1820]
does it work if you test it locally without SSL ?
Gabriele
27-Jun-2007
[1821]
oldes, it is legal but NOT part of query args UNLESS percent-encoded. 
special characters in uris must always be percent-encoded when not 
used as separators.
Graham
27-Jun-2007
[1822x4]
Good question .. yes, it works remotely without ssl.
Cheyenne is running on port 8100, and SSL is directed to that from 
stunnel.
So, if you try 


page: read/custom https://www.compkarori.co.nz/show.cgireduce [ 
'post join "content=" content ]  
then this fails if content is a few kbs

but if you do 


page: read/custom http://www.compkarori.co.nz:8100/show.cgi reduce 
[ 'post join "content=" content ]

it works fine.
What a shame.
Dockimbel
27-Jun-2007
[1826]
So it seems that the issue is either with the HTTPS protocol in REBOL 
or with stunnel.
Graham
27-Jun-2007
[1827x3]
I guess so
So, I need to mock up a webpage to do the same post
and check it out in a browser
Dockimbel
27-Jun-2007
[1830]
Exactly.
Graham
27-Jun-2007
[1831x2]
Hmm.
I don't have a https server I can test ...
Dockimbel
27-Jun-2007
[1833]
Be sure to use the latest Cheyenne beta (0.9.15). It fixes a regression 
bug on multipart data decoding.
Graham
27-Jun-2007
[1834x3]
Do you have a log of which files are changed?
Or do I have to update every file?
I guess I'd better download curl and use that to test with
Dockimbel
27-Jun-2007
[1837]
Sorry, no diff file list. You can update just the files having a 
more recent timestamp.
Graham
27-Jun-2007
[1838x6]
Ok
curl seems to work
curl -k -F upload=@test.ps -F press=OK https://www.compkarori.co.nz/show.cgi
So, I guess this means it's a Rebol https problem :(
Wasn't Gabriele asking for people to test a new http(s) protocol 
??
Does anyone wish to independently confirm my findings with https?
Graham
28-Jun-2007
[1844x2]
Rebol []

data: copy/part read %test.ps 1024
content: copy data
for i 1 100 1 [
	cnt: i * 1024

 page: read/custom https://www.compkarori.co.nz/cgi-bin/measure.rsp
 reduce  [ 'post join "content=" content ]
	parse page [ thru <data> copy received to </data> ]
	either found? received [
		received: to integer! trim received 
		either received = cnt [
			print [ "OK at " cnt ]
			append content data
		][
			print [ "oops .. failed at " cnt ]
			break
		]
	][
		print "failed to read ... "
		halt
	]
]
http continues okay.
https fails at 15360 bytes