[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-myserver] Configuration?
From: |
Giuseppe Scrivano |
Subject: |
Re: [bug-myserver] Configuration? |
Date: |
Sun, 13 Mar 2011 23:11:54 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
hey Ludovic,
thanks again for your report. It is an ugly bug that happens when a
virtual host is not found and the server tries to log this error on the
virtual host error log.
I think in your configuration file you need:
<HOST>127.0.0.1:8080</HOST>
instead of:
<HOST>127.0.0.1</HOST>
as MyServer compares it against the Host specified by the client.
I am going to push this patch to fix the segfault:
diff --git a/myserver/src/protocol/http/http.cpp
b/myserver/src/protocol/http/http.cpp
index 11f2f37..c99e8b2 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -1000,12 +1000,13 @@ int Http::controlConnection (ConnectionPtr a, char*,
char*, u_long, u_long,
a->host = newHost;
if (a->host == NULL)
{
- int ret = raiseHTTPError (400);
- logHTTPaccess ();
- if (ret == HttpDataHandler::RET_OK && keepalive)
- return ClientsThread::KEEP_CONNECTION;
- else
- return ClientsThread::DELETE_CONNECTION;
+ Server::getInstance ()->log (MYSERVER_LOG_MSG_WARNING,
+ _("Cannot find host %s on %s (port
%i)"),
+ host ? host->value.c_str () :
"(NULL)",
+ a->getLocalIpAddr (),
+ a->getLocalPort ());
+
+ return ClientsThread::DELETE_CONNECTION;
}
if (td->request.uri.length () > 2 && td->request.uri[1] == '~')
Cheers,
Giuseppe
address@hidden (Ludovic Courtès) writes:
> Hi Giuseppe,
>
> Giuseppe Scrivano <address@hidden> writes:
>
>> the configuration snippet is not correct. We have added the possibility
>> to support different channels for the same log file, in order to do it
>> we had to change the configuration file as well:
>>
>> <VHOSTS>
>> <VHOST>
>> <NAME>Every connection</NAME>
>> <PORT>8080</PORT>
>> <PROTOCOL>HTTP</PROTOCOL>
>> <DOCROOT>web</DOCROOT>
>> <SYSROOT>system</SYSROOT>
>> <HOST>127.0.0.1</HOST>
>> <ACCESSLOG>
>> <STREAM location="file:///dev/null" cycle="1048576"/>
>> </ACCESSLOG>
>> <WARNINGLOG>
>> <STREAM location="file:///dev/null" cycle="1048576"/>
>> </WARNINGLOG>
>> <ALLOW_CGI>NO</ALLOW_CGI>
>> </VHOST>
>> </VHOSTS>
>
> Thanks, it works for me... up to the first connection where MyServer
> segfaults:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x7fffe17f2700 (LWP 23323)]
> 0x00007ffff7aafbd0 in Vhost::warningsLogWrite(char const*, ...) () from
> /nix/store/vqzf5hywvsg27mqi9cl9zpn6qxn2ggvz-myserver-0.10/lib/libmyserver.so.0
> (gdb) bt
> #0 0x00007ffff7aafbd0 in Vhost::warningsLogWrite(char const*, ...) () from
> /nix/store/vqzf5hywvsg27mqi9cl9zpn6qxn2ggvz-myserver-0.10/lib/libmyserver.so.0
> #1 0x00007ffff7ae3754 in Http::raiseHTTPError(int) () from
> /nix/store/vqzf5hywvsg27mqi9cl9zpn6qxn2ggvz-myserver-0.10/lib/libmyserver.so.0
> #2 0x00007ffff7ae1865 in Http::controlConnection(Connection*, char*, char*,
> unsigned long, unsigned long, unsigned long, unsigned long) ()
> from
> /nix/store/vqzf5hywvsg27mqi9cl9zpn6qxn2ggvz-myserver-0.10/lib/libmyserver.so.0
> #3 0x00007ffff7ae5805 in HttpProtocol::controlConnection(Connection*, char*,
> char*, unsigned long, unsigned long, unsigned long, unsigned long) ()
> from
> /nix/store/vqzf5hywvsg27mqi9cl9zpn6qxn2ggvz-myserver-0.10/lib/libmyserver.so.0
> #4 0x00007ffff7a6e30c in ClientsThread::controlConnections() () from
> /nix/store/vqzf5hywvsg27mqi9cl9zpn6qxn2ggvz-myserver-0.10/lib/libmyserver.so.0
> #5 0x00007ffff7a6dd11 in clients_thread(void*) () from
> /nix/store/vqzf5hywvsg27mqi9cl9zpn6qxn2ggvz-myserver-0.10/lib/libmyserver.so.0
> #6 0x00007ffff7679cec in start_thread () from
> /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpthread.so.0
> #7 0x00007ffff57561ed in clone () from
> /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libc.so.6
>
> Ideas? :-)
>
> Thanks,
> Ludo’.