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

Terry
3-Jun-2007
[1017x2]
and change it's return to false, i take it.
which modules do I need to include for stripped down cheyenne?
Dockimbel
3-Jun-2007
[1019x3]
right: FALSE will let other module a chance to process the phase, 
TRUE will close the phase.
mod-static (static pages), mod-action (CGI)
and mod-rsp if you want RSP engine.
Terry
3-Jun-2007
[1022x3]
so.. looks like static returns true?
[HTTPd] Phase access-check done ( mod-static )
Ok.. .. so .. what's up with the first normal last?
Dockimbel
3-Jun-2007
[1025]
humm, not sure you can infer the resulting phase value from that 
log (might be TRUE or FALSE, but not NONE)
Terry
3-Jun-2007
[1026x2]
So, does Cheyenne process all modules phases then moves onto the 
next in all modules?
kinda parallel?
Dockimbel
3-Jun-2007
[1028]
first / normal / last : that's the position in phase list, you'd 
like for your function in a given phase
Terry
3-Jun-2007
[1029]
in other words.. do all url-to-filename for all modules.. then do 
all set-mime-type for all modules... and so on.
Dockimbel
3-Jun-2007
[1030x2]
Right, one phase calls all modules (unless one returns TRUE), then 
go to the next phase (see the 1.1 in developer's guide).
exactly
Terry
3-Jun-2007
[1032x3]
ahh... ok...
that's pretty cool...
why does the position matter?.. is the position related to other 
modules, or to itself?
Dockimbel
3-Jun-2007
[1035]
the position determines the calling order in a given phase
Terry
3-Jun-2007
[1036]
I take it the module order in the config file is a type of position 
as well?   if the tirst module returns true, then the rest not considered?
Dockimbel
3-Jun-2007
[1037]
when you declare : url-translate first, you want your module's url-translate 
to be called the first.
Terry
3-Jun-2007
[1038]
but if phases are in order, why not follow the order?
Dockimbel
3-Jun-2007
[1039]
exactly, modules are competing to close each phases, so order in 
the list, and order in config file matter.
Terry
3-Jun-2007
[1040]
I can see how that could be a bit tricky.. somewhat bug prone
Dockimbel
3-Jun-2007
[1041x2]
if 2 modules declare the same phase's function to be first, which 
one to call ? :-)
this case is solve only by the position in config file.
Terry
3-Jun-2007
[1043x3]
Need some kind of global phase viewer
(sounds like a module :)
normal then is pure config order
Dockimbel
3-Jun-2007
[1046]
This system is very flexible, but if not carefully done, can lead 
to a messy organization. I plan to move to a more simplified system 
(but more restricted too) for Cheyenne 2.0 (not before 2008, I guess).
Terry
3-Jun-2007
[1047x2]
This is fine.  just need to grok the system better.
That helps alot, thanks
Dockimbel
3-Jun-2007
[1049x3]
Graham: still no crash on your server
true
(sorry, wrong channel)
Graham
3-Jun-2007
[1052x2]
I reduced the number of javascript elements on the page.
I'll put them back and see if it happens again.
Terry
3-Jun-2007
[1054x2]
One last question for now if you don't mind.. sending a response 
back to the page.. .. is this correct?
req/out/content: "test"
Do you have a really basic make-response function?
Dockimbel
3-Jun-2007
[1056]
yes, but you have to set the res/out/code (HTTP response code as 
integer! value)
Terry
3-Jun-2007
[1057]
Here's what I have.. 
install-HTTPd-extension [
	name: 'mymodule

	order: [
	url-translate first
	make-response first
	]
	
	url-translate: func [svc req conf][	
	;probe svc/client/remote-ip
	none
	]
	
	 make-response: func [svc req conf /local res sess][
		if all [declined? req none? req/app][return none]	
	req/out/content: "test"
return true	
		 
	]
	
]
Dockimbel
3-Jun-2007
[1058x3]
req/out/code
lacks : req/out/code: 200
and delete the : if all.. line
Terry
3-Jun-2007
[1061]
Eureka!
Dockimbel
3-Jun-2007
[1062]
this line is for testing in mode-rsp/make-response if the request 
should be processed by mod-rsp or not.
Terry
3-Jun-2007
[1063]
That should be Rebol's new name ;)
Dockimbel
3-Jun-2007
[1064]
Agreed ;-)
Terry
3-Jun-2007
[1065]
That's great..   so very extensible.. I have a really basic core 
Chyenne, and can add mods as I go..
Graham
3-Jun-2007
[1066]
Well, I guess it's good as it's not crashing now.