[Libwebsockets] Failed to create default vhost

Andy Green andy at warmcat.com
Wed Nov 16 18:09:06 CET 2016



On November 16, 2016 10:58:22 PM GMT+08:00, satya gowtham kudupudi <satyagowtham.k at gmail.com> wrote:
>Hi,
>
>I have pulled and installed latest libwebsockets. made changes to my
>server
>according to the latest test-server.c
>
>when I ran my  server.c i am having following errors
>
>lwsts[6144]: libwebsockets echo test - (C) Copyright 2010-2013 Andy
>Green <
>andy at warmcat.com> - licensed under LGPL2.1
>
>lwsts[6144]: Running in server mode
>
>lwsts[6144]: Initial logging level 65535
>
>lwsts[6144]: Libwebsockets version: 2.0.3

When you say 'latest libwebsockets' you mean v2.0-stable, is it?

>gowtham at ubuntu-v2.0.2-31-gb40c0b8
>
>lwsts[6144]: IPV6 not compiled in
>
>lwsts[6144]: libev support not compiled in
>
>lwsts[6144]: libuv support not compiled in
>
>lwsts[6144]:  LWS_DEF_HEADER_LEN    : 1024
>
>lwsts[6144]:  LWS_MAX_PROTOCOLS     : 5
>
>lwsts[6144]:  LWS_MAX_SMP           : 32
>
>lwsts[6144]:  SPEC_LATEST_SUPPORTED : 13
>
>lwsts[6144]:  sizeof (*info)        : 280
>
>lwsts[6144]:  SYSTEM_RANDOM_FILEPATH: '/dev/urandom'
>
>lwsts[6144]:  default timeout (secs): 5
>
>lwsts[6144]:  Threads: 1 each 1024 fds
>
>lwsts[6144]:  mem: context:          9512 bytes (5416 ctx + (1 thr x
>4096))
>
>lwsts[6144]:  mem: http hdr rsvd:   68224 bytes (1 thr x (1024 + 3240)
>x
>16))
>
>lwsts[6144]:  mem: pollfd map:       8192
>
>lwsts[6144]:  mem: platform fd map:  8192 bytes
>
>lwsts[6144]:  Compiled with OpenSSL support
>
>lwsts[6144]:  SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
>
>lwsts[6144]: Creating Vhost 'default' port 80, 2 protocols
>
>lwsts[6144]: insert_wsi_socket_into_fds: 0x7f86a0017ab0: tsi=0, sock=7,
>pos-in-fds=1

Hm.

What about if you run the test server without any changes?  That doesn't do this then?

>lwsts[6144]: lws_http_transaction_completed: wsi 0x7f86a0017ab0

Have you done something with threads?

>lwsts[6144]: lws_http_transaction_completed: 0x7f86a0017ab0: close
>connection
>
>lwsts[6144]: Failed to create default vhost
>
>lwsts[6144]: libwebsocket init failed
>
>Any help is much appreciated

If the unchanged test server is also broken, try change the listen port to 81 and see if acts the same way.

If

 - the unchanged test server works ok

 - your changed version breaks

 - you are the only guy with the changes

then

 - why are you asking me?

 - it's your job to debug your code

 - since you have a working 'a' (unchanged test server) and a broken 'b' (your code), and the diff, you can identify what breaks it by restarting at 'a' version and adding back the diff piece by piece until it breaks

If there's a better question to ask then, like "when I do xxx I break vhost init", I might stand a chance.

-Andy

>--
>Gowtham
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list