Re: [AOLSERVER] Use of the conn argument in a registered proc

2008-11-28 Thread Eric Lee
Thanks, Scott and Brian, for your help.  The former procedure, now filter, is working. There are a couple things about this I'm still curious about: 1. What is the conn argument in ns_register_filter { conn what why } for?  It provides a value like "cns0".  Is this the extent of the "connection i

Re: [AOLSERVER] Use of the conn argument in a registered proc

2008-11-28 Thread Fenton, Brian
] Use of the conn argument in a registered proc Thanks for the tip about ns_conn headers, which gets me over the immediate problem. My proc is now able to detect a host and ns_returnredirect successfully. However if the test for that host fails the proc now returns nothing, i.e. a page of 0 bytes

Re: [AOLSERVER] Use of the conn argument in a registered proc

2008-11-27 Thread Scott Goodwin
Eric, You really should be using ns_register_filter instead of ns_return_proc. ns_register_filter when method URLpattern myScript ?args? proc myScript {?conn? args why} { # Do stuff... } With ns_register_proc you intercept all matching URLs and *you* must provide valid respons

Re: [AOLSERVER] Use of the conn argument in a registered proc

2008-11-27 Thread Eric Lee
Thanks for the tip about ns_conn headers, which gets me over the immediate problem. My proc is now able to detect a host and ns_returnredirect successfully. However if the test for that host fails the proc now returns nothing, i.e. a page of 0 bytes. What I want it do is just return the page

Re: [AOLSERVER] Use of the conn argument in a registered proc

2008-11-26 Thread Scott Goodwin
I should take my time and read through the entire message -- I guess it's rather late. The HTTP Host information will be located in the request headers which you can grab and put into an ns_set like this: set headers [ns_conn headers] You can then get the HTTP Host header with: set

Re: [AOLSERVER] Use of the conn argument in a registered proc

2008-11-26 Thread Scott Goodwin
You don't actually use the conn argument's value directly. Use ns_conn to access the connection information. For example, set url [ns_conn url] gets you the URL of the HTTP request. (a totally useless example, but you get the point). /s. On Nov 27, 2008, at 12:33 AM, Eric Lee wrote: I'm tr

[AOLSERVER] Use of the conn argument in a registered proc

2008-11-26 Thread Eric Lee
I'm trying to set up an ns_register_proc to redirect requests to what used to be a separate website that now points to mine to a directory on my site. (The client does not want to use a virtual server.) My plan is to test the host of the connection and ns_returnredirect if it matches the forme