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

Dockimbel
14-Jan-2010
[7524x3]
Carl, it's possible to SU to any user while started as root, but 
that will only work for the processes forked, not the first one (the 
Cheyenne/Uniserve main process). In config file, just uncomment those 
lines, choose the adequate user/group targets and restart the server 
:

	;	user  nobody
	;	group nobody


I need to investiguate more in Apache's sources to see how they achieve 
full SU on all processes.
Terry: on-message function => yes, loading a script on each request 
is ok for debugging, but bad pratice for production. I'm not sure 
that WAIT is safe in Cheyenne callbacks, never tested that, this 
function is not supposed to be used in user code inside Cheyenne 
main process (it would work in a RSP script, but will block valuable 
resources and reduce scalability).
You should try with a timer event instead (if you really need to 
delay it server-side).
Will
14-Jan-2010
[7527]
Carl, good to hear you trying out Cheyenne 8-)  now you know why 
we need threading in R3 to replace the worker processes.

BTW, I see you are running version 0.9.19 which is a bit old, I really 
suggest you dowload latest SVN from here:
  svn checkout http://cheyenne-server.googlecode.com/svn/trunk/
I personally run it from source. W la Rebolution!
Carl
14-Jan-2010
[7528x2]
Will: thanks for the info. We can update to it.
Doc: if there's any small thing we can do on our side in 2.7.8 to 
help with SU situation, let me know.  As you know, running the server 
as SU will be a problem for many folks.
Dockimbel
15-Jan-2010
[7530]
Thanks Carl, I'll investiguate that and will send a report of requirements 
to BrianH if necessary.
Terry
15-Jan-2010
[7531x2]
Doc, have you looked at eventmachine for Ruby?
I have Cheyenne and EventMachine arguing with each other via sockets 
:)
Dockimbel
15-Jan-2010
[7533]
EventMachine: no, looks like yet another event-driven network engine.
Terry
15-Jan-2010
[7534x2]
It is.
but has threading
Graham
15-Jan-2010
[7536]
Any clues on running R3 for cgi ?
Dockimbel
16-Jan-2010
[7537]
R3 should work as CGI with Cheyenne as long as you provide a correct 
shebang line.
Graham
16-Jan-2010
[7538]
on windows?
Dockimbel
16-Jan-2010
[7539x2]
On all platforms where Cheyenne can run.
You can test with Perl's examples in %www/perl/.
Terry
17-Jan-2010
[7541x2]
Doc, this lastest ws:// demo I've been working on is so killer, that 
I'm going to send you $100 to put towards Cheyenne/ websocket development.

All you need is a donation box.... https://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/rec/donate-intro-outside
Didn't know you could do this, but  Ogg Vorbis files can be stiched 
together using read/binary. (There's a hint :)
Will
17-Jan-2010
[7543]
Terry we are eager to see your new demo 8-)
Dockimbel
17-Jan-2010
[7544x4]
Terry: waouh, a brand new pair of shoes! Thanks! :-) I'll look at 
how to add that donation button on Cheyenne's web site.
SVN r62


FEAT: RSP scripts can now set response/buffer to a file! value allowing 
main process to transfer it optimally (see changelog.txt)

FEAT: worker tasks now have a more readable and cleaned-up command 
line.

FIX: fixed a bug with internal UniServe's DNS cache querying preventing 
'open-port from working in some cases.
This last fix was blocking sometimes the builtin MTA to connect to 
DNS or MX servers.
<last bug>
NickA
17-Jan-2010
[7548]
Graham,  I've used this code to obtain get/post data in Cheyenne:

REBOL [title: "sitebuilder" file: %sitebuilder.cgi]
print "content-type: text/html^/"
print [<HTML><HEAD><TITLE>"Sitebuilder"</TITLE></HEAD><BODY>]
either system/options/cgi/request-method = "POST" [
    submitted-bin: make string! input
] [
    submitted-bin: system/options/cgi/query-string
]
submitted: decode-cgi submitted-bin

That replaces this Apache CGI code:

#!./rebol276 -cs
REBOL []
print "content-type: text/html^/"
print [<HTML><HEAD><TITLE>"Sitebuilder"</TITLE></HEAD><BODY>]
read-cgi: func [/local data buffer][
    switch system/options/cgi/request-method [
        "POST" [
            data: make string! 1020
            buffer: make string! 16380

            while [positive? read-io system/ports/input buffer 16380][
                append data buffer
                clear buffer
            ]
        ]
        "GET" [data: system/options/cgi/query-string]
    ]
    data
]
submitted: decode-cgi submitted-bin: read-cgi

HTH :)
Graham
17-Jan-2010
[7549]
Nick .. I'm using R3alpha ..and initial testing showed I can't get 
the command line in r3alpha
Dockimbel
18-Jan-2010
[7550]
Donation buttons added to Cheyenne web site at bottom if some of 
you feel inclined to help me spend more time on this project. ;-)
Graham
18-Jan-2010
[7551x2]
I sent you enough money to buy the right shoe!
Someone else can pay for the left one :)
Carl
18-Jan-2010
[7553]
Graham... could be unicode problem.  R3 expects the args as unicode. 
See host-kit os/host-main.c  -- really simple.
Graham
18-Jan-2010
[7554]
Seems I should get the host-kit :)
Dockimbel
19-Jan-2010
[7555]
Graham: thank you, I'll go buy the right one today and hope that 
nobody else buy the left one before I get new donations. :-)
Graham
19-Jan-2010
[7556]
hehe
Terry
19-Jan-2010
[7557]
Ok.. there's a pair of shoes.. that's 1.5 . Just need one more person 
and you'll have 2 pairs.
Dockimbel
19-Jan-2010
[7558]
Carl: after testing, SUing Cheyenne to a non-root user works, but 
not for the helper processes that REBOL starts itself in its boot 
process (only for main process, other processes started with LAUNCH 
or CALL all get the proper user id). I'll make a documented report 
to BrianH.
Terry
19-Jan-2010
[7559]
Here's another teaser demo.. I think it's a first.  Broadcasting 
TTS to a page via  websocket.
http://shinyrockets.com/echo.html
Dockimbel
19-Jan-2010
[7560]
Terry: thanks! Looks like I will even get a pair of dancing shoes 
for saturday nights! :-)
Terry
19-Jan-2010
[7561]
hmm.. your chat an mine came through at the same time.. must be the 
queueing
Dockimbel
19-Jan-2010
[7562]
Echo has a nice voice, spelling is very good AFAICT.
Terry
19-Jan-2010
[7563]
Yeah, one of the better TTS. Ogg Vorbis 16bit
Dockimbel
19-Jan-2010
[7564x2]
Yep, got both at the same time too. Could the lag between the button 
click and the response be reduced? I guess that having all the voice 
processing done locally (using a REBOL app) could make it realtime?
How much data does it send to the client browser for, e.g. "hello 
word"?
Terry
19-Jan-2010
[7566]
The first message takes some time.. every repeat is quicker.
Dockimbel
19-Jan-2010
[7567x2]
Got your last message 3 times...looks like a cache or block needs 
to cleared.
to <be> cleared.
Terry
19-Jan-2010
[7569x2]
i clicked it 3 times in rapid sucession.
I have a forever loop that checks the processing of the TTS.. once 
it's ready, it pushes it.. That's where the lag comes from. But then 
the .ogg file is cached, and much faster.
Dockimbel
19-Jan-2010
[7571]
Oh, it was just a cheering up! :-)
Terry
19-Jan-2010
[7572x2]
Yeah :)
There is a faster method, but saving it for other stuff.