On 2004.08.11, Artur Meski <[EMAIL PROTECTED]> wrote:
> When I request something from a not defined virtual host I get SIGSEGV.
> I think, that even a configuration error shouldn't cause it.

Indeed -- thanks for reporting this.

>  82913 nsd      GIO   fd 12 read 439 bytes
>        "GET / HTTP/1.1\r
>         Host: not.defined.host.cifrid.net:8000\r
...
> Related sections from etc/main.tcl:
>
>   ns_section ns/modules
>   ns_param nssock nssock.so
>
>   ns_section ns/module/nssock
>   ns_param  port      8000
>   ns_param  hostname  host.cifrid.net
>   ns_param  address   0.0.0.0
>
>   ns_section ns/module/nssock/servers
>   ns_param defined1    defined1.cifrid.net:8000
>   ns_param defined2    defined2.cifrid.net:8000
>   ns_param defined3    defined3.cifrid.net:8000
>
> Please, let me know what would be the best way to deal with this problem.

Ah.  See, I was undecided on how to specify the "default" virtual server
(in the case that it's either not specified in Host: header for
HTTP/1.0, or Host: points to one not found in the list of defined
servers).  I cheated and doubled up the use of the ns/module/nssock
"hostname" parameter ... which may have been a mistake.

In order to specify the default virtual server, you set "hostname" to
one of the values from the ns/module/nssock/servers section.  In your
example above, you might do this:

  ns_section ns/module/nssock
  ns_param  port      8000
  ns_param  hostname  defined2.cifrid.net:8000
  ns_param  address   0.0.0.0

  ns_section ns/module/nssock/servers
  ns_param defined1    defined1.cifrid.net:8000
  ns_param defined2    defined2.cifrid.net:8000
  ns_param defined3    defined3.cifrid.net:8000

This should make the server defined2 the default if Host: isn't sent by
the client OR Host: doesn't map to one of the three servers you've
configured.

Need to better document this ... and/or come up with a better defaulting
mechanism.  Thanks for reporting this, though!

-- Dossy

--
Dossy Shiobara                       mail: [EMAIL PROTECTED]
Panoptic Computer Network             web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to