Giter Club home page Giter Club logo

zerogw's Introduction

Zerogw

Zerogw is a http to zeromq gateway. Which means it listens HTTP, parses request and sends it using zeromq socket (ZMQ_REQ). Then waits for the reply and responds with data received from zeromq socket.

Starting with v0.3 zerogw also supports WebSockets. Websockets are implemented by forwarding incoming messages using ZMQ_PUB socket, and listening commands from ZMQ_SUB socket. Each WebSocket client can be subscribed to unlimited number of topics. Each zeromq message it either control message (e.g. subscription) or message to a specified topic which will be efficiently sent to every WebSocket subscribed to that particular topic.

Zerogw is written in C and uses libwebsite library for handling HTTP (which itself uses libev).

Zerogw is not a full-blown http server. It knows nothing about static files, caches, CGI, whatever. It knows some routing and that's almost it. That makes it very fast and perfectly scalable.

Use it for:
  • RPC's
  • REST API's
  • Ajax
  • WebSockets

Resources

Installing

Ubuntu:

sudo add-apt-repository ppa:tailhook/zerogw
sudo apt-get update
sudo apt-get install zerogw

ArchLinux:

yaourt -S zerogw

For other distributions refer to Compiling section.

We currently support only Linux.

Dependencies

  • linux with kernel at least 2.6.28 (need accept4)
  • libwebsite for handling http
  • coyaml for handling configuration
  • python3 needed for coyaml to build configuration parser
  • libzmq and libev of course
  • libyaml for parsing configuration

First two usually compiled statically, so you don't need them at runtime. Same with python. (Eventually, I'll release a bundle with precompiled configuration parser and embedded few other libraries for easier compiling :) )

Compiling

./waf configure --prefix=/usr
./waf build
./waf install

zerogw's People

Contributors

asvetlov avatar black-snow avatar tailhook avatar towhans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zerogw's Issues

Compile Fails On Missing libev But Is Installed

I have tried with libev 4.0.4 installed in /usr and in /usr/local but neither seem to work, i keep getting this:

$ python3 ./waf build
Waf: Entering directory `/home/xevix/zerogw/build'
[ 1/23] cprogram: build/src/main.c.0.o build/src/log.c.0.o build/src/websocket.c.0.o build/src/sieve.c.0.o build/src/zutils.c.0.o build/src/http.c.0.o build/src/resolve.c.0.o build/src/uidgen.c.0.o build/src/request.c.0.o build/src/polling.c.0.o build/src/disk.c.0.o build/src/commands.c.0.o build/src/pool.c.0.o build/src/msgqueue.c.0.o build/src/config.c.0.o -> build/zerogw                            
/usr/lib/libwebsite.a(core.c.0.o): In function `ev_default_loop':                                                                                                                                         
core.c:(.text+0x25): undefined reference to `ev_default_loop_init'
collect2: ld returned 1 exit status
Waf: Leaving directory `/home/xevix/zerogw/build'
Build failed
 -> task failed (exit status 1):                                                                                                                                                                          
        {task 155695436: cprogram main.c.0.o,log.c.0.o,websocket.c.0.o,sieve.c.0.o,zutils.c.0.o,http.c.0.o,resolve.c.0.o,uidgen.c.0.o,request.c.0.o,polling.c.0.o,disk.c.0.o,commands.c.0.o,pool.c.0.o,msgqueue.c.0.o,config.c.0.o -> zerogw}                                                                                                                                                                       
['/usr/lib/ccache/gcc', '', 'src/main.c.0.o', 'src/log.c.0.o', 'src/websocket.c.0.o', 'src/sieve.c.0.o', 'src/zutils.c.0.o', 'src/http.c.0.o', 'src/resolve.c.0.o', 'src/uidgen.c.0.o', 'src/request.c.0.o', 'src/polling.c.0.o', 'src/disk.c.0.o', 'src/commands.c.0.o', 'src/pool.c.0.o', 'src/msgqueue.c.0.o', 'src/config.c.0.o', '-o', '', '/home/xevix/zerogw/build/zerogw', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lyaml', '-lzmq', '-lev', '-lcoyaml', '-lwebsite', '-lssl']

I compiled/installed myself, since my version of Kubuntu only has libev3 and zerogw seems to require libev4.

measure response time

It would be nice if there was a stats counter for some kind of response time, for example, average response time since the last time stats were taken.

build problems

I installed coyaml separately but the build fails of zerogw

raise Errors.WafError('No wscript file in directory %s'%d)

waflib.Errors.WafError: No wscript file in directory /mnt/data/home/mdupont/experiments/zerogw/coyaml

this dir is empty :
zerogw/coyaml

.

.

Crash of zerogw while disconnecting websocket

Core was generated by `zerogw -c config/gen/zerogw.yaml'.
Program terminated with signal 6, Aborted.
#0  0x00007fe1aeb30795 in raise () from /lib/libc.so.6
(gdb) bt
#0  0x00007fe1aeb30795 in raise () from /lib/libc.so.6
#1  0x00007fe1aeb31c0b in abort () from /lib/libc.so.6
#2  0x0000000000403c27 in logmsg (level=1, file=0x41ec50 "../src/sieve.c",
   line=57,
   msg=0x41ec60 "Handling of !(sieve->items[holeid]) is not implemented")
   at ../src/log.c:52
#3  0x0000000000408a4d in sieve_empty (sieve=0xd480c0, holeid=69)
   at ../src/sieve.c:57
#4  0x0000000000404f1d in hybi_stop (hybi=0xd71660) at ../src/websocket.c:174
#5  0x000000000040473c in websock_stop (hint=0xd71330) at ../src/websocket.c:56
#6  0x0000000000419fb6 in ws_connection_close ()
#7  0x000000000041a552 in write_websocket ()
#8  0x00007fe1af0bc16f in ev_invoke_pending () from /usr/lib/libev.so.4
#9  0x00007fe1af0c01bd in ev_run () from /usr/lib/libev.so.4
#10 0x0000000000403828 in main (argc=3, argv=0x7fffba630448)
   at ../src/main.c:201
(gdb) quit

Incompatible With zeromq-3.2.2-2 on Arch?

I've been curious to try out zerogw for a while now, and I recently tried to compile it on my Arch Linux boxes. Unfortunately, I have not had success. I'm not a C guy, but it seems like this code might be relying on zeromq<3. Your PKGBUILD for Arch, however, references zeromq, which is currently at 3.2.2.

The ZeroMQ 2 -> 3 upgrade document at http://www.zeromq.org/docs:3-1-upgrade suggests that these references to zmq_send and zmq_recv should become zmq_msg_send and zmq_msg_recv, respectively.

Here's what I'm seeing:

Checking for 'gcc' (c compiler)          : ok 
'configure' finished successfully (0.035s)
Waf: Entering directory `/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/build'
[ 1/23] coyaml: src/config.yaml -> build/src/config.h build/src/config.c
[ 2/23] coyaml: src/config.yaml -> build/src/config.h build/src/config.c
[ 3/23] c: src/openport.c -> build/src/openport.c.2.o
[ 4/23] c: src/main.c -> build/src/main.c.0.o
[ 5/23] c: src/websocket.c -> build/src/websocket.c.0.o
[ 6/23] c: src/msgqueue.c -> build/src/msgqueue.c.0.o
[ 7/23] c: src/sieve.c -> build/src/sieve.c.0.o
[ 8/23] c: src/zutils.c -> build/src/zutils.c.0.o
[ 9/23] c: src/disk.c -> build/src/disk.c.0.o
[10/23] c: build/src/config.c -> build/src/config.c.0.o
[11/23] c: src/request.c -> build/src/request.c.0.o
../src/websocket.c: In function ‘backend_send_real’:
../src/websocket.c:77:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock->_sock, &zmsg, ZMQ_SNDMORE|ZMQ_NOBLOCK) < 0) {
     ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
[12/23] c: src/uidgen.c -> build/src/uidgen.c.0.o
../src/websocket.c:106:5: error: too few arguments to function ‘zmq_send’
     SNIMPL(zmq_send(sock->_sock, &zmsg, ZMQ_NOBLOCK | flag));
     ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c:110:9: error: too few arguments to function ‘zmq_send’
         SNIMPL(zmq_send(sock->_sock, &zmsg, ZMQ_NOBLOCK | flag));
         ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c:122:9: error: too few arguments to function ‘zmq_send’
         SNIMPL(zmq_send(sock->_sock, &zmsg, ZMQ_NOBLOCK));
         ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c: In function ‘websock_process’:
../src/websocket.c:541:9: error: too few arguments to function ‘zmq_recv’
         Z_RECV_START(msg, break);
         ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/main.c: In function ‘flush_statistics’:
../src/main.c:54:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
../src/websocket.c:546:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_NEXT(msg);
             ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/main.c:65:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c:550:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
../src/main.c:76:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:87:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:98:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:562:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_NEXT(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:566:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/main.c:109:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:120:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:131:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:142:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:153:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c:572:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_NEXT(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:579:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/main.c:164:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:175:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:186:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:197:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:208:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
../src/websocket.c:583:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_NEXT(msg);
             ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/main.c:219:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:230:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
../src/websocket.c:586:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:241:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:252:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:263:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:274:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/main.c:285:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(sock, &msg, ZMQ_NOBLOCK) < 0) return;
     ^
In file included from ../src/main.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c:601:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_NEXT(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:603:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:618:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
In file included from ../src/zutils.c:6:0:
../src/zutils.c: In function ‘zmq_open’:
../src/zutils.c:75:39: error: ‘ZMQ_HWM’ undeclared (first use in this function)
         SNIMPL(zmq_setsockopt(result, ZMQ_HWM, &hwm, sizeof(hwm)));
                                       ^
../src/log.h:58:25: note: in definition of macro ‘SNIMPL’
 #define SNIMPL(res) if((res) && LOG_ALERT <= LOGLEVEL) { logstd(LOG_ALERT, __FILE__, __LINE__, #res); }
                         ^
../src/zutils.c:75:39: note: each undeclared identifier is reported only once for each function it appears in
         SNIMPL(zmq_setsockopt(result, ZMQ_HWM, &hwm, sizeof(hwm)));
                                       ^
../src/log.h:58:25: note: in definition of macro ‘SNIMPL’
 #define SNIMPL(res) if((res) && LOG_ALERT <= LOGLEVEL) { logstd(LOG_ALERT, __FILE__, __LINE__, #res); }
                         ^
../src/zutils.c:83:39: error: ‘ZMQ_SWAP’ undeclared (first use in this function)
         SNIMPL(zmq_setsockopt(result, ZMQ_SWAP, &swap, sizeof(swap)));
                                       ^
../src/log.h:58:25: note: in definition of macro ‘SNIMPL’
 #define SNIMPL(res) if((res) && LOG_ALERT <= LOGLEVEL) { logstd(LOG_ALERT, __FILE__, __LINE__, #res); }
                         ^
../src/zutils.c: In function ‘skip_message’:
../src/zutils.c:120:9: error: too few arguments to function ‘zmq_recv’
         SNIMPL(zmq_recv(sock, &msg, 0));
         ^
In file included from ../src/zutils.c:2:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:625:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_NEXT(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:628:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_NEXT(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:632:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV(msg); \
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:698:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_NEXT(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:701:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:719:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_NEXT(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:722:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:730:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c:734:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV_LAST(msg);
             ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/websocket.c: In function ‘heartbeat’:
../src/websocket.c:792:9: error: too few arguments to function ‘zmq_send’
         ZMQ_SNDMORE|ZMQ_NOBLOCK) < 0) {
         ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c:801:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(route->websocket.forward._sock, &msg, ZMQ_NOBLOCK) < 0) {
     ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c: In function ‘send_sync’:
../src/websocket.c:817:5: error: too few arguments to function ‘zmq_send’
     if(zmq_send(socket->_sock, &msg, ZMQ_SNDMORE|ZMQ_NOBLOCK) < 0) {
     ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c:833:9: error: too few arguments to function ‘zmq_send’
         SNIMPL(zmq_send(socket->_sock, &msg, ZMQ_NOBLOCK|ZMQ_SNDMORE));
         ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c:836:9: error: too few arguments to function ‘zmq_send’
         SNIMPL(zmq_send(socket->_sock, &msg, ZMQ_NOBLOCK|ZMQ_SNDMORE));
         ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/websocket.c:842:5: error: too few arguments to function ‘zmq_send’
     SNIMPL(zmq_send(socket->_sock, &msg, ZMQ_NOBLOCK));
     ^
In file included from ../src/websocket.c:1:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c: In function ‘disk_loop’:
../src/disk.c:265:9: error: too few arguments to function ‘zmq_recv’
         if(zmq_recv(sock, &msg, 0) < 0) {
         ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/disk.c:284:13: error: too few arguments to function ‘zmq_send’
             SNIMPL(zmq_send(sock, &msg, 0));
             ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:292:13: error: too few arguments to function ‘zmq_send’
             SNIMPL(zmq_send(sock, &msg, 0));
             ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:301:13: error: too few arguments to function ‘zmq_send’
             SNIMPL(zmq_send(sock, &msg, 0));
             ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:315:13: error: too few arguments to function ‘zmq_send’
             SNIMPL(zmq_send(sock, &result, ZMQ_SNDMORE));
             ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:317:13: error: too few arguments to function ‘zmq_send’
             SNIMPL(zmq_send(sock, &result, 0));
             ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:324:13: error: too few arguments to function ‘zmq_send’
             SNIMPL(zmq_send(sock, &result, ZMQ_SNDMORE));
             ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:326:13: error: too few arguments to function ‘zmq_send’
             SNIMPL(zmq_send(sock, &result, 0));
             ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:335:9: error: too few arguments to function ‘zmq_send’
         SNIMPL(zmq_send(sock, &msg, ZMQ_SNDMORE));
         ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:350:9: error: too few arguments to function ‘zmq_send’
         SNIMPL(zmq_send(sock, &msg, ZMQ_SNDMORE));
         ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:351:9: error: too few arguments to function ‘zmq_send’
         SNIMPL(zmq_send(sock, &result, 0));
         ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c: In function ‘disk_request’:
../src/disk.c:373:5: error: too few arguments to function ‘zmq_send’
     while(zmq_send(root.disk.socket, &msg, ZMQ_SNDMORE|ZMQ_NOBLOCK) < 0) {
     ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:389:5: error: too few arguments to function ‘zmq_send’
     SNIMPL(zmq_send(root.disk.socket, &msg, ZMQ_SNDMORE));
     ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:428:5: error: too few arguments to function ‘zmq_send’
     SNIMPL(zmq_send(root.disk.socket, &msg, 0));
     ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c: In function ‘disk_process’:
../src/disk.c:438:9: error: too few arguments to function ‘zmq_recv’
         Z_RECV_START(msg, break);
         ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/disk.c:449:9: error: too few arguments to function ‘zmq_recv’
         Z_RECV_NEXT(msg);
         ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/disk.c:451:9: error: too few arguments to function ‘zmq_recv’
         Z_RECV(msg);
         ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/disk.c:474:13: error: too few arguments to function ‘zmq_recv’
             Z_RECV(msg);
             ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/disk.c:503:17: error: too few arguments to function ‘zmq_recv’
                 Z_RECV(msg);
                 ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:350:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
../src/disk.c: In function ‘prepare_disk’:
../src/disk.c:591:9: warning: implicit declaration of function ‘pthread_create’ [-Wimplicit-function-declaration]
         SNIMPL(pthread_create(&root.disk.threads[i], NULL, disk_loop, NULL));
         ^
../src/disk.c: In function ‘release_disk’:
../src/disk.c:614:9: error: too few arguments to function ‘zmq_send’
         if(zmq_send(root.disk.socket, &msg, ZMQ_NOBLOCK|ZMQ_SNDMORE) < 0) {
         ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:623:9: error: too few arguments to function ‘zmq_send’
         zmq_send(root.disk.socket, &msg, ZMQ_NOBLOCK); // don't care if fails
         ^
In file included from ../src/disk.c:9:0:
/usr/include/zmq.h:349:16: note: declared here
 ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
                ^
../src/disk.c:627:9: warning: implicit declaration of function ‘pthread_join’ [-Wimplicit-function-declaration]
         SNIMPL(pthread_join(root.disk.threads[i], NULL));
         ^
Waf: Leaving directory `/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/build'
Build failed
 -> task failed (exit status 1): 
    {task 139916836593488: c main.c -> main.c.0.o}
['/usr/bin/gcc', '-march=x86-64', '-mtune=generic', '-O2', '-pipe', '-fstack-protector', '--param=ssp-buffer-size=4', '-D_FORTIFY_SOURCE=2', '-std=gnu99', '-I/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/build/src', '-I/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/src', '-DLOG_STRIP_PATH="../src/"', '', '../src/main.c', '-c', '-o', '', 'src/main.c.0.o']
 -> task failed (exit status 1): 
    {task 139916836602512: c zutils.c -> zutils.c.0.o}
['/usr/bin/gcc', '-march=x86-64', '-mtune=generic', '-O2', '-pipe', '-fstack-protector', '--param=ssp-buffer-size=4', '-D_FORTIFY_SOURCE=2', '-std=gnu99', '-I/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/build/src', '-I/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/src', '-DLOG_STRIP_PATH="../src/"', '', '../src/zutils.c', '-c', '-o', '', 'src/zutils.c.0.o']
 -> task failed (exit status 1): 
    {task 139916836602128: c websocket.c -> websocket.c.0.o}
['/usr/bin/gcc', '-march=x86-64', '-mtune=generic', '-O2', '-pipe', '-fstack-protector', '--param=ssp-buffer-size=4', '-D_FORTIFY_SOURCE=2', '-std=gnu99', '-I/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/build/src', '-I/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/src', '-DLOG_STRIP_PATH="../src/"', '', '../src/websocket.c', '-c', '-o', '', 'src/websocket.c.0.o']
 -> task failed (exit status 1): 
    {task 139916836603664: c disk.c -> disk.c.0.o}
['/usr/bin/gcc', '-march=x86-64', '-mtune=generic', '-O2', '-pipe', '-fstack-protector', '--param=ssp-buffer-size=4', '-D_FORTIFY_SOURCE=2', '-std=gnu99', '-I/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/build/src', '-I/tmp/yaourt-tmp-wheaties/aur-zerogw/src/zerogw-0.6.2/src', '-DLOG_STRIP_PATH="../src/"', '', '../src/disk.c', '-c', '-o', '', 'src/disk.c.0.o']
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build .

Fix error message in zerogwctl

The following is not user-friendly:
{{{
zerogwctl: ../src/zerogwctl.c:103: main: Assertion `rc == 0' failed.
Aborted
}}}

warnings at "python3 ./waf build" process

There are some warnings when i start the build process:
zerogw works, but my c knowledge is not well enough to recognize if there could be any negative side effects due to the warnings.

Waf: Entering directory /home/adminuser/projekte/zerogw/build' [ 1/23] c: src/websocket.c -> build/src/websocket.c.0.o [ 2/23] c: src/sieve.c -> build/src/sieve.c.0.o [ 3/23] c: src/zutils.c -> build/src/zutils.c.0.o [ 4/23] c: src/http.c -> build/src/http.c.0.o [ 5/23] c: src/resolve.c -> build/src/resolve.c.0.o [ 6/23] c: src/uidgen.c -> build/src/uidgen.c.0.o [ 7/23] c: src/request.c -> build/src/request.c.0.o [ 8/23] c: src/polling.c -> build/src/polling.c.0.o [ 9/23] c: src/disk.c -> build/src/disk.c.0.o [10/23] c: src/commands.c -> build/src/commands.c.0.o [11/23] c: src/pool.c -> build/src/pool.c.0.o [12/23] c: src/msgqueue.c -> build/src/msgqueue.c.0.o [13/23] c: build/src/config.c -> build/src/config.c.0.o [14/23] c: src/zerogwctl.c -> build/src/zerogwctl.c.1.o [15/23] c: build/src/config.c -> build/src/config.c.1.o [16/23] cprogram: build/src/zerogwctl.c.1.o build/src/config.c.1.o -> build/zerogwctl [17/23] c: src/openport.c -> build/src/openport.c.2.o [18/23] cprogram: build/src/openport.c.2.o -> build/openport [19/23] c: src/main.c -> build/src/main.c.0.o ../src/main.c: In function ‘flush_statistics’: ../src/main.c:52:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:63:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:74:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:85:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:96:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:107:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:118:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:129:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:140:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:151:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:162:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:173:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:184:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:195:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:206:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:217:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:228:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:239:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:250:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:261:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:272:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] ../src/main.c:283:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat] [20/23] cprogram: build/src/main.c.0.o build/src/log.c.0.o build/src/websocket.c.0.o build/src/sieve.c.0.o build/src/zutils.c.0.o build/src/http.c.0.o build/src/resolve.c.0.o build/src/uidgen.c.0.o build/src/request.c.0.o build/src/polling.c.0.o build/src/disk.c.0.o build/src/commands.c.0.o build/src/pool.c.0.o build/src/msgqueue.c.0.o build/src/config.c.0.o -> build/zerogw Waf: Leaving directory/home/adminuser/projekte/zerogw/build'
'build' finished successfully (4.909s)

zerogw crash

2011-06-01 13:26:49 [WARN] disk.c:420: 1 disk threads ready
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``xlsx'' using ``application/vnd.openxmlformats-officedocument.spreadsheetml.sheet''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``xltx'' using ``application/vnd.openxmlformats-officedocument.spreadsheetml.template''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``spl'' using ``application/futuresplash''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``amr'' using ``audio/amr''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``awb'' using ``audio/amr-wb''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``m3u'' using ``audio/mpegurl''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``ra'' using ``audio/x-pn-realaudio''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``sdf'' using ``application/vnd.stardivision.math''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``asn'' using ``chemical/x-ncbi-asn1''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``ent'' using ``chemical/x-ncbi-asn1-ascii''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``cpt'' using ``application/mac-compactpro''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``csh'' using ``application/x-csh''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``sh'' using ``application/x-sh''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``tcl'' using ``application/x-tcl''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``vrml'' using ``model/vrml''
2011-06-01 13:26:49 [WARN] disk.c:391: Conflicting mime for ``wrl'' using ``model/vrml''
*** glibc detected *** zerogw: double free or corruption (fasttop): 0x00000000025278d0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x78a8f)[0x7f8353e0aa8f]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x73)[0x7f8353e0e8e3]
zerogw[0x4079c3]
/usr/lib/libev.so.4(ev_invoke_pending+0x61)[0x7f835437bfa1]
/usr/lib/libev.so.4(ev_run+0x810)[0x7f83543802f0]
zerogw[0x40396b]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xff)[0x7f8353db0eff]
zerogw[0x402c99]
======= Memory map: ========
00400000-0042d000 r-xp 00000000 08:01 14591488                           /usr/bin/zerogw
0062c000-0062d000 r--p 0002c000 08:01 14591488                           /usr/bin/zerogw
0062d000-00630000 rw-p 0002d000 08:01 14591488                           /usr/bin/zerogw
00630000-00631000 rw-p 00000000 00:00 0 
024f5000-025e6000 rw-p 00000000 00:00 0                                  [heap]
7f834c000000-7f834c05c000 rw-p 00000000 00:00 0 
7f834c05c000-7f8350000000 ---p 00000000 00:00 0 
7f8351018000-7f8351019000 ---p 00000000 00:00 0 
7f8351019000-7f8351819000 rw-p 00000000 00:00 0 
7f8351819000-7f835181a000 ---p 00000000 00:00 0 
7f835181a000-7f835201a000 rw-p 00000000 00:00 0 
7f835201a000-7f835201b000 ---p 00000000 00:00 0 
7f835201b000-7f835281b000 rw-p 00000000 00:00 0 
7f835281b000-7f8352832000 r-xp 00000000 08:01 2232701                    /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f8352832000-7f8352a31000 ---p 00017000 08:01 2232701                    /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f8352a31000-7f8352a32000 r--p 00016000 08:01 2232701                    /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f8352a32000-7f8352a33000 rw-p 00017000 08:01 2232701                    /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f8352a33000-7f8352a35000 r-xp 00000000 08:01 2232628                    /lib/x86_64-linux-gnu/libdl-2.13.so
7f8352a35000-7f8352c35000 ---p 00002000 08:01 2232628                    /lib/x86_64-linux-gnu/libdl-2.13.so
7f8352c35000-7f8352c36000 r--p 00002000 08:01 2232628                    /lib/x86_64-linux-gnu/libdl-2.13.so
7f8352c36000-7f8352c37000 rw-p 00003000 08:01 2232628                    /lib/x86_64-linux-gnu/libdl-2.13.so
7f8352c37000-7f8352c4c000 r-xp 00000000 08:01 2232646                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8352c4c000-7f8352e4b000 ---p 00015000 08:01 2232646                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8352e4b000-7f8352e4c000 r--p 00014000 08:01 2232646                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8352e4c000-7f8352e4d000 rw-p 00015000 08:01 2232646                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8352e4d000-7f8352ed1000 r-xp 00000000 08:01 2232655                    /lib/x86_64-linux-gnu/libm-2.13.so
7f8352ed1000-7f83530d0000 ---p 00084000 08:01 2232655                    /lib/x86_64-linux-gnu/libm-2.13.so
7f83530d0000-7f83530d1000 r--p 00083000 08:01 2232655                    /lib/x86_64-linux-gnu/libm-2.13.so
7f83530d1000-7f83530d2000 rw-p 00084000 08:01 2232655                    /lib/x86_64-linux-gnu/libm-2.13.so
7f83530d2000-7f83531ba000 r-xp 00000000 08:01 14567567                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14
7f83531ba000-7f83533b9000 ---p 000e8000 08:01 14567567                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14
7f83533b9000-7f83533c1000 r--p 000e7000 08:01 14567567                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14
7f83533c1000-7f83533c3000 rw-p 000ef000 08:01 14567567                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14
7f83533c3000-7f83533d8000 rw-p 00000000 00:00 0 
7f83533d8000-7f83533df000 r-xp 00000000 08:01 2232687                    /lib/x86_64-linux-gnu/librt-2.13.so
7f83533df000-7f83535de000 ---p 00007000 08:01 2232687                    /lib/x86_64-linux-gnu/librt-2.13.so
7f83535de000-7f83535df000 r--p 00006000 08:01 2232687                    /lib/x86_64-linux-gnu/librt-2.13.so
7f83535df000-7f83535e0000 rw-p 00007000 08:01 2232687                    /lib/x86_64-linux-gnu/librt-2.13.so
7f83535e0000-7f83535e4000 r-xp 00000000 08:01 2232699                    /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f83535e4000-7f83537e3000 ---p 00004000 08:01 2232699                    /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f83537e3000-7f83537e4000 r--p 00003000 08:01 2232699                    /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f83537e4000-7f83537e5000 rw-p 00004000 08:01 2232699                    /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f83537e5000-7f835394b000 r-xp 00000000 08:01 2228262                    /lib/libcrypto.so.0.9.8
7f835394b000-7f8353b4b000 ---p 00166000 08:01 2228262                    /lib/libcrypto.so.0.9.8
7f8353b4b000-7f8353b58000 r--p 00166000 08:01 2228262                    /lib/libcrypto.so.0.9.8
7f8353b58000-7f8353b71000 rw-p 00173000 08:01 2228262                    /lib/libcrypto.so.0.9.8
7f8353b71000-7f8353b74000 rw-p 00000000 00:00 0 
7f8353b74000-7f8353b8c000 r-xp 00000000 08:01 2232683                    /lib/x86_64-linux-gnu/libpthread-2.13.so
7f8353b8c000-7f8353d8c000 ---p 00018000 08:01 2232683                    /lib/x86_64-linux-gnu/libpthread-2.13.so
7f8353d8c000-7f8353d8d000 r--p 00018000 08:01 2232683                    /lib/x86_64-linux-gnu/libpthread-2.13.so
7f8353d8d000-7f8353d8e000 rw-p 00019000 08:01 2232683                    /lib/x86_64-linux-gnu/libpthread-2.13.so
7f8353d8e000-7f8353d92000 rw-p 00000000 00:00 0 
7f8353d92000-7f8353f1c000 r-xp 00000000 08:01 2232618                    /lib/x86_64-linux-gnu/libc-2.13.so
7f8353f1c000-7f835411b000 ---p 0018a000 08:01 2232618                    /lib/x86_64-linux-gnu/libc-2.13.so
7f835411b000-7f835411f000 r--p 00189000 08:01 2232618                    /lib/x86_64-linux-gnu/libc-2.13.so
7f835411f000-7f8354120000 rw-p 0018d000 08:01 2232618                    /lib/x86_64-linux-gnu/libc-2.13.so
7f8354120000-7f8354126000 rw-p 00000000 00:00 0 
7f8354126000-7f8354172000 r-xp 00000000 08:01 2228318                    /lib/libssl.so.0.9.8
7f8354172000-7f8354372000 ---p 0004c000 08:01 2228318                    /lib/libssl.so.0.9.8
7f8354372000-7f8354373000 r--p 0004c000 08:01 2228318                    /lib/libssl.so.0.9.8
7f8354373000-7f8354379000 rw-p 0004d000 08:01 2228318                    /lib/libssl.so.0.9.8
7f8354379000-7f8354386000 r-xp 00000000 08:01 14550270                   /usr/lib/libev.so.4.0.0
7f8354386000-7f8354585000 ---p 0000d000 08:01 14550270                   /usr/lib/libev.so.4.0.0
7f8354585000-7f8354586000 r--p 0000c000 08:01 14550270                   /usr/lib/libev.so.4.0.0
7f8354586000-7f8354587000 rw-p 0000d000 08:01 14550270                   /usr/lib/libev.so.4.0.0fish: Job 1, “zerogw -c config/zerogw.yaml ” terminated by signal SIGABRT (Abort)

Crash when forcing disconnect when socket already closed

Here is a place of crash in debugger

#0  websock_process (loop=<optimized out>, watch=0xdbb640, revents=<optimized out>) at ../src/websocket.c:654
654             if(hybi->type == HYBI_COMET) {
(gdb) bt
#0  websock_process (loop=<optimized out>, watch=0xdbb640, revents=<optimized out>) at ../src/websocket.c:654
#1  0x00007f6175a07e91 in ?? () from /usr/lib/libev.so.4
#2  0x0000000000000000 in ?? ()
(gdb) l
649             hybi->flags |= WS_HAS_COOKIE;
650         } else if(cmdlen == 10 && !memcmp(cmd, "disconnect", cmdlen)) {
651             LDEBUG("Setting connection cookie");
652             Z_RECV_LAST(msg);
653             hybi_t *hybi = hybi_find(zmq_msg_data(&msg));
654             if(hybi->type == HYBI_COMET) {
655                 comet_close(hybi);
656             } else if(hybi->type == HYBI_WEBSOCKET) {
657                 ws_connection_close(&hybi->conn->ws);
658             }

Zerogw crashes on EMFILE

#0  0x00007fc8843df735 in raise () from /lib/libc.so.6
#1  0x00007fc8843e0bab in abort () from /lib/libc.so.6
#2  0x0000000000418bff in ws_accept_callback (loop=<optimized out>, l=0x12dc010, revents=1) at ../src/core.c:1045
#3  0x00007fc884ac316f in ev_invoke_pending () from /usr/lib/libev.so.4
#4  0x00007fc884ac71bd in ev_run () from /usr/lib/libev.so.4
#5  0x000000000040315e in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.c:216

PPA

Hi,

interesting project. I'm having problem with the PPA

W: Failed to fetch http://ppa.launchpad.net/tailhook/zerogw/ubuntu/dists/raring/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/tailhook/zerogw/ubuntu/dists/raring/main/binary-i386/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

What I did was following the instructions

sudo add-apt-repository ppa:tailhook/zerogw
sudo apt-get update

How does it work?

Hi,
I'm quite new to sockets.

I have ZMQ and Ratchet installed and my socket server is being run from PHP.

I've installed zerogw and it seems "working"-ish. If I go to the page http://localhost:8000/hello it just throws a 404 error and the zerogw process outputs:

2016-08-12 14:55:25 [WARN] disk.c:289: (e2) Can't resolve ``/hello'': No such file or directory

So how do I make it connect to my TCP socket that's on port 5555?

build with zeromq v3 => error: too few arguments to function ‘zmq_send’

Hello,

I have zeromq 3.4.2 @ rhel6, and it seems to be incompatible with zerogw source code from master branch, despite that documentation says "libzmq >= 2.1":


[xxx@localhost zerogw-master]$ ./waf build
Waf: Entering directory /home/dmitry/Downloads/ZEROGW/zerogw-master/build' [ 1/23] coyaml: src/config.yaml -> build/src/config.h build/src/config.c [ 2/23] coyaml: src/config.yaml -> build/src/config.h build/src/config.c [ 3/23] c: build/src/config.c -> build/src/config.c.1.o [ 4/23] c: src/zerogwctl.c -> build/src/zerogwctl.c.1.o ../src/zerogwctl.c: In function ‘main’: ../src/zerogwctl.c:98: error: too few arguments to function ‘zmq_send’ ../src/zerogwctl.c:106: error: too few arguments to function ‘zmq_recv’ Waf: Leaving directory/home/dmitry/Downloads/ZEROGW/zerogw-master/build'
Build failed
-> task failed (exit status 1):
{task 140526144778960: c zerogwctl.c -> zerogwctl.c.1.o}

['/usr/bin/gcc', '-std=gnu99', '-I/home/dmitry/Downloads/ZEROGW/zerogw-master/build/src', '-I/home/dmitry/Downloads/ZEROGW/zerogw-master/src', '', '../src/zerogwctl.c', '-c', '-o', '', 'src/zerogwctl.c.1.o']

Is it supposed to be compiled with zeromq v2 only, no v3 or v4 support available yet or I am missing some instructions?
zmq v4: http://api.zeromq.org/4-0:zmq-send <-- buf* + size
zmq v3: http://api.zeromq.org/3-2:zmq-send <-- buf* + size
zmq v2: http://api.zeromq.org/2-2:zmq-send <-- zmq_msg_t msg

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.