Git Product home page Git Product logo

ape-project / ape_server Goto Github PK

View Code? Open in Web Editor NEW
389.0 389.0 107.0 71.38 MB

Ajax Push Engine : Lightweight HTTP Streaming server. Fully written in C language, it provides best performances, making it the faster Comet server to date. APE now support server-side javascript modules through spidermonkey

Home Page: www.ape-project.org

License: GNU General Public License v2.0

PHP 0.03% Shell 0.79% R 0.01% Perl 0.98% JavaScript 8.43% C 89.56% C++ 0.21%

ape_server's People

Contributors

ape-project avatar catwood avatar efyx avatar fy- avatar harmer avatar hurdad avatar jdtcdr avatar lcharette avatar lnx85 avatar paraboul avatar ptejada avatar svogl avatar vagabond avatar verpeteren avatar wesgarland 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ape_server's Issues

Crash on OS X? - "pointer being freed was not allocated"

Hello Folks,

I am running into some issues with a clean install of the latest development version of APE Server on OS X.

Basically, I'm sending a little bit of data to the inlinepush demo page with the python script (found below the gdb output). Things work fine, eventually I stop the python script. A couple of minutes later (with no activity or connections) the APE server crashes with the above error.

Any suggestions with how to troubleshoot this? Please let me know if you need any additional information.

me@my-mac ~/ape/APE-Project-APE_Server-0eff8f0/bin $ gdb ./aped
GNU gdb 6.3.50-20050815 (Apple version gdb-1515) (Sat Jan 15 08:33:48 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done

(gdb) run
Starting program: /Users/dan/ape/APE-Project-APE_Server-0eff8f0/bin/aped 
Reading symbols for shared libraries +. done
[WARN] You have to run 'aped' as root to increase r_limit
   _   ___ ___ 
  /_\ | _ \ __|
 / _ \|  _/ _| 
/_/ \_\_| |___|
AJAX Push Engine

Bind on port 6969

Version : 1.1.2-dev
Build   : Jul  4 2011 18:40:16
Author  : Weelya ([email protected])

Reading symbols for shared libraries .. done
[Module] [spidermonkey] Loading module : Javascript embeded (0.01) - Anthony Catel
[JS] Loading script ../scripts/framework/mootools.js...
[JS] Loading script ../scripts/framework/Http.js...
[JS] Loading script ../scripts/framework/userslist.js...
[JS] Loading script ../scripts/utils/utils.js...
[JS] Loading script ../scripts/commands/proxy.js...
[JS] Loading script ../scripts/commands/inlinepush.js...
[JS] Loading script ../scripts/examples/nickname.js...
[JS] Loading script ../scripts/examples/move.js...
[JS] Loading script ../scripts/utils/checkTool.js...
aped(50400) malloc: *** error for object 0x100957000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT, Aborted.
0x00007fff805b25d6 in __kill ()
(gdb) bt
#0  0x00007fff805b25d6 in __kill ()
#1  0x00007fff80652cd6 in abort ()
#2  0x00007fff8056a6b5 in free ()
#3  0x0000000100002e01 in close_socket (fd=9, g_ape=0x100100770) at src/sock.c:211
#4  0x0000000100003af2 in sockroutine (g_ape=0x100100770) at src/sock.c:434
#5  0x0000000100002279 in main (argc=1, argv=0x7fff5fbff638) at src/entry.c:306
(gdb)

Our Python script that generates some random data for APE_JSF/Demos/Controller/demo.html

It may be unrelated, but this is how I am sending data to the APE server.

import urllib2
import json
import time

x = 0

while 1:

    x += 1

    server = 'http://127.0.0.1:6969/0/?'
    cmd = [{'cmd': 'inlinepush',
            'params': {
               'password': 'whatever the default password was, yes, i changed it',
               'raw': 'postmsg',
               'channel': 'testchannel',
               'data': {
                    'message': str(x)
               }
            }
           }]

    url = server + urllib2.quote(json.dumps(cmd))
    print url
    response = urllib2.urlopen(url)
    time.sleep(1)

Segfault in ape_disconnect() roughtly once a day on production server

Hi,

I have a chat-like app using APE. Like once a day, the APE server crash.
I use Debian 6 and APE 1.1.1 from .deb file.

Sometimes I can see a "glibc crash detected [...] double free or corruption" in the logs. Sometimes not.

Yesterday I tried that :

  • "git checkout" the current head of master branch
  • "make" it with -g (instead of -O2)
  • clone the main config file and set "daemon = no"
  • run it in a screen with "gdb ./aped" then :
    set args --cfg /etc/ape/ape_debug.conf
    handle SIGPIPE nostop
    run

It start well, server works as in daemon mode.
After around 8 hours, Nagios have said that the port 6969 has cease to respond.

4 new lines in the screen :
Error: Cannot write to socket 230; Connection timed out

Program received signal SIGSEGV, Segmentation fault.
0x00000000004186ae in ape_disconnect (co=0x86bf40, g_ape=0x62aa90) at src/servers.c:59
59 if (co->fd == sub->client->fd) {
(gdb)

I am currently tring to run in debug the server with a slight change in the code : before the problematic line, I have added a "if ( sub->client != NULL)".
I have added also a else with a ape_log() and a printf() call...

I will post some news in few days.

Regards,
Ludovic

Ape.log does not log when running in foreground

APE should log to the file specified in the configuration file regardless of running mode (daemon of foreground). I'm trying to use upstart to supervise the aped process. Upstart doesn't play well with daemons that fork, so I want to set daemon = no, which works fine, however Ape.log logging stops working, even though logging from the core server still works. There's no good way of logging stdout to a file in upstart (especially since ape.log is already being written to by the server).

Replication:

  1. Use Ape.log in a server side JS module,
  2. Set daemon = yes in the config and restart -> logging works,
  3. Set daemon = no in the config and restart -> logging doesn't work.

End of life

Just amazed that this project closed.
What is the alternative that made this end?

Http.js bugged?

Examples like

Exemple 1:
// URL to call
var request = new Http('http://www.google.fr/');
request.getContent(function(result) {
Ape.log(result);
});

don't work to me.
It seems the request is created but it never enters the getContent block. No errors returned. I couldn't find any useful information. Tried to use the last Http.js from github but the problem is not solved.

Thanks

Segfault while removing channels

I found 2 ways:

method 1:

Ape.addEvent('init', function() {
    var channel = Ape.mkChan('diediediemydarling');
});
Ape.addEvent("mkchan", function(channel) {
    Ape.log(channel.getProperty('name') + " created");
    Ape.rmChan(channel.getProperty('name'));
})

method 2

Ape.addEvent('init', function() {
    var channel = Ape.mkChan('diediediemydarling');
    Ape.setTimeout(
        function() {
            Ape.log("stopping now");
            Ape.rmChan(channel.getProperty('name'));
        }, 3000);
});

Ape.addEvent('mkChan', function(channel) {
    Ape.log(channel.getProperty('name') + " created");
});

Ape.addEvent("rmchan", function(channel) {
    Ape.log(channel.getProperty('name') + " deleted");
    Ape.rmChan(channel.getProperty('name'));
});

subuser object status

I have not checked other versions, but on master the subuser object seems to be blank slate. None of the documented methods are defined.

Ape.registerCmd('foo', true, function(params, info) {
    info.subuser.sendRaw('bar', {'ok':'true'});
});

will generate the following error: TypeError: info.subuser.sendRaw is not a function

1.1.2 dev with MySQL does not work on Ubuntu

I believe I have all the libraries needed installed.
Running build.sh first gave an error of "/usr/bin/ld: cannot find -lmysac"
Running it again worked. It seems to compile fine since running "make" in modules/deps/mysac says "nothing to be done" or something to that effect.

When I try use Ape.MySQL it doesn't throw any error, but there is no onConnect() callback triggered. No mysql queries work, either.

That is all using the latest git hub version built from source.
Using the deb package I get ""symbol lookup error: /usr/lib/ape/libmod_spidermonkey.so: undefined symbol: scramble" "

I can only get aped working with mysql using a really old version I had on my HD. This old version, however, crashes every day.

events_poll() Interrupted system call

I was looking at my log and i found events_poll() : Interrupted system call and then the server restarts itself. Could this be causing the bad session raw sent to clients? Below is a snippet of the log

2012-04-21 15:00:02 - src/entry.c:251 - Starting daemon
2012-04-21 21:13:09 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-21 21:13:34 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-21 21:16:08 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-21 21:27:31 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-21 21:48:31 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-21 21:52:34 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-21 21:54:45 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-21 21:55:28 - src/sock.c:279 - events_poll() : Interrupted system call
2012-04-21 21:55:30 - src/entry.c:188 - APE starting up - pid : 2806
2012-04-21 21:55:30 - src/entry.c:246 - You have to run 'aped' as root to increase r_limit
2012-04-21 21:55:30 - src/entry.c:251 - Starting daemon
2012-04-21 21:55:36 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-21 22:01:46 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-22 00:08:47 - src/users.c:180 - New user - (ip : 127.0.0.1)
2012-04-22 00:53:14 - src/users.c:180 - New user - (ip : 127.0.0.1)

Mysql Prepared Statements

The APE server could immensely benefit from the use of so called mysql prepared statements. How can this be done?

Info:

For repeated execution of a SQL command, where only parameters change, the MySQL C API offeres a function that employs the binary protocol to pass the arguments and execute it, which is extremly fast compared to usual way,
because the query does not have to be parsed every time and parameters are send as binary data which is way more efficient!

http://dev.mysql.com/doc/refman/5.0/en/c-api-prepared-statements.html

scripts/framework/HTTP.js ignores port parameter and protocoll

  1. the protocoll is complete ignored, so you change you example (which uses http://host into just "host")
    As only http:// seems to be possible on APE that would be enough for now.
  2. If no port is given in the url via url:port, then the port is always set to 80 even if one is given in the constructor!

My fix is to have he following priority: Constructor Agrument or, if none given: port in url, or if none given: 80

initialize: function(url, port) {
    this.url            = url;
    this.port           = port;
    this.parseURL();
},

parseURL: function() {
    var result  = this.url.match("^.*?://(.*?)(:([0-9]+))?((/.*)|)$");
    this.host   = result[1];
    this.port   = this.port || result[3] || 80;
    this.query  = result[4];
},

Server crashes within 5 minutes running MySQL queries every 5 seconds

Run this script with valgrind and the APE server crashes in 5 minutes or less, my events table has 9 columns with a long description column that can be up to 2K, and a couple of timestamp fields of html text

I am running version 1.1.1 of the server

valgrind --leak-check=full --track-origins=yes --show-reachable=yes -v ./aped >a.out 2>b.out

Ape.log(' =====================================>>> Start up for mysql_test.js ' );

var dbbm = new Ape.MySQL( "1.1.1.1:3306", "mysql", "mysql", "events" );

var events_Chan = false;
var events_timeoutID;

//------------------------------------------
Ape.addEvent("mkchan", function(chan) {

        var cj = chan.getProperty('name');
        Ape.log("New channel => " + cj );

        switch( cj )
        {
                case '*events':
                        Ape.log( 'Starting EVENTS thread at 5 seconds' );
                        events_timeoutID = Ape.setInterval(EventsTick, 5000, chan );
                        break;
        }

        Ape.join( cj );
});

//------------------------------------------
Ape.addEvent("join", function(user, channel) {
        Ape.log("New user has joined the channel (" + channel.getProperty('name') + ")");
        // Do nothing this is just a crash test
});

//------------------------------------------
dbbm.onConnect = function() {
        Ape.log('Connected to mysql server, Creating *events channel');
        events_Chan = Ape.mkChan('*events');
}

//------------------------------------------
dbbm.onError = function(errorNo) {
   Ape.log('Connection Error : ' + errorNo + ' : '+ this.errorString());
}

//------------------------------------------
function
EventsTick( _chan )
{
        var SQL = 'SELECT * ' +
                'FROM events '+
                'LIMIT 25';

        dbbm.query( SQL , function(res, errorNo) {
                if (errorNo)
                {
                        Ape.log('Request error : ' + errorNo + ' : '+ this.errorString());
                }
                else
                {
                        Ape.log('Fetched => ' + res.length + ' ROWS');
                        Ape.log( "SQL completed" );
                }

        });
}

There is a memory leak in the MYSQL SpiderMonkey code I can help and test with anything, this get this bug fixed

APE convert float to int values with inlinepush

When i use the inlinepush module the float values are converted to int value.

ex:

send to the APE server using inline push:
[{"cmd": "inlinepush", "params":
{"raw": "ping", "password": "testpasswd", "data":
{"content": {"timestamp": 1264062569.54, "coord":
{"y": 1.0957805, "x": 49.449257}}}, "channel": "*TEST"}}]
[{"time":"1264012321","raw":"pushed","data":{"value":"ok"}}]

X and Y became:
[{"time":"1264013251","raw":"ping","data":{"content":{"timestamp":1264063517,
"coord":{"y":1,"x":48}
}}}]

Malformed JSON in multipipeCreate event

multipipeCreate event returns a MALFORMED JSON which causes JSON.parse on line 180 of Core.js to fail. It's because after the CHANNEL raw data... if there are other events like JOIN LEFT or DATA, then instead of a comma the json is formed like ....}][{"time":"1289577226","raw":"DATA",.... Notice the ][. There should be a , instead of that.

QUICK FIX
Put this before line 180 to fix it till a proper server side fix is released:

raws = raws.replace(/][/gi,",");

can't create ape server on ip

hi i user grey ip like 10.10.50.50 on my work portal with apache, how i can run ape server without subdomain?
please help, thanks

ape project wiki doesnt show anything

hello

your ape-project website introduce your project so well but when i go to docs and wiki pages,,they redirect to the same page and show nothing

Ape behind proxy support

If an APE server is behind a proxy server all requests have the IP 127.0.0.1

APE should check for the X-Forwarded-For first in case the request is been forwarded from a proxy server.

socket.onRead cannot triggered

I write a script named “test.js” ,I put it to "example" directory so that it can be included when APE server start up. And then, I write a TCP socket program by using netty, it listen port 6666 on the same host. I can recieve message from netty program by using telenet. however, test.js can only trigger onConnect and onDisconnect event. I was wondering why onRead can not be triggered

Here is my script below:

var socket = new Ape.sockClient(6666, "127.0.0.1", {flushlf: true});
socket.onConnect = function(){
Ape.log("we are connected!");
socket.write("ape");
}
socket.onRead = function(data){
Ape.log("yes");
}
socket.onDisconnect = function(data){
Ape.log("Gone!");
}

In APE_Server-1.1.2-i386.bin, on running aped getting error.. Failed to load ../modules/lib/libmod_spidermonkey.so

In APE_Server-1.1.2-i386.bin, on running aped getting error.

[Module] Failed to load ../modules/lib/libmod_spidermonkey.so [Invalid library](libmysqlclient_r.so.16: cannot open shared object file: No such file or directory)

I am currently using APE Server 1.1, I don't have any issues in using the current version. After so many years found a new version. Thought there will be improvements but i could not upgrade to latest stable version.

I don't connect to MySQL / execute any MySQL query in my APE Client but why the spider monkey is looking for mysql client.

Can you please help me to resolve this issue.

Nickname and checkTool as default files in main.ape.js

Nickname.js should be enabled by default since the demos bundled with APE JSF requires it. I know this command is kind of useless in the real world, but one should be able to get the demos working without changing something in the server scripts.

That or we update the demos files.

I didn't checked, but I guess the doc mention nickname also?

Also, I guess 'utils/checkTool.js' shouldn't be commented by default.

Aped dies on me, like 5 times per day.

Here is what I saw in my console.

*** glibc detected *** /usr/local/src/ape_server/bin/aped: double free or corruption (!prev): 0x0a8d32b8 ***
======= Backtrace: =========
/lib/libc.so.6[0xaa15a5]
/lib/libc.so.6(cfree+0x59)[0xaa19e9]
/usr/local/src/ape_server/bin/aped[0x805b0e8]
/usr/local/src/ape_server/bin/aped(sockroutine+0x5e5)[0x804dd85]
/usr/local/src/ape_server/bin/aped(main+0x92b)[0x804cc7b]
/lib/libc.so.6(__libc_start_main+0xdc)[0xa4de9c]
/usr/local/src/ape_server/bin/aped[0x804c281]
======= Memory map: ========
00110000-00118000 r-xp 00000000 08:03 14131923 /usr/lib/libkrb5support.so.0.1
00118000-00119000 rw-p 00007000 08:03 14131923 /usr/lib/libkrb5support.so.0.1
00119000-00129000 rwxp 00119000 00:00 0
0012b000-00135000 r-xp 00000000 08:03 22741031 /lib/libnss_files-2.5.so
00135000-00136000 r--p 00009000 08:03 22741031 /lib/libnss_files-2.5.so
00136000-00137000 rw-p 0000a000 08:03 22741031 /lib/libnss_files-2.5.so
00137000-0025a000 r-xp 00000000 08:03 14484914 /usr/lib/mysql/libmysqlclient_r.so.15.0.0
0025a000-0029c000 rw-p 00123000 08:03 14484914 /usr/lib/mysql/libmysqlclient_r.so.15.0.0
0029c000-0029d000 rw-p 0029c000 00:00 0
002c5000-003f8000 r-xp 00000000 08:03 14488144 /usr/local/src/ape_server/modules/lib/libmod_spidermonkey.so
003f8000-00402000 rw-p 00132000 08:03 14488144 /usr/local/src/ape_server/modules/lib/libmod_spidermonkey.so
00402000-00403000 rw-p 00402000 00:00 0
00403000-0052d000 r-xp 00000000 08:03 22742255 /lib/libcrypto.so.0.9.8e
0052d000-00540000 rw-p 00129000 08:03 22742255 /lib/libcrypto.so.0.9.8e
00540000-00544000 rw-p 00540000 00:00 0
0056b000-0064b000 r-xp 00000000 08:03 14132481 /usr/lib/libstdc++.so.6.0.8
0064b000-0064f000 r--p 000df000 08:03 14132481 /usr/lib/libstdc++.so.6.0.8
0064f000-00650000 rw-p 000e3000 08:03 14132481 /usr/lib/libstdc++.so.6.0.8
00650000-00656000 rw-p 00650000 00:00 0
0065d000-0068a000 r-xp 00000000 08:03 14134261 /usr/lib/libgssapi_krb5.so.2.2
0068a000-0068b000 rw-p 0002d000 08:03 14134261 /usr/lib/libgssapi_krb5.so.2.2
00697000-006bc000 r-xp 00000000 08:03 14133852 /usr/lib/libk5crypto.so.3.1
006bc000-006bd000 rw-p 00025000 08:03 14133852 /usr/lib/libk5crypto.so.3.1
006bf000-00703000 r-xp 00000000 08:03 22742256 /lib/libssl.so.0.9.8e
00703000-00707000 rw-p 00043000 08:03 22742256 /lib/libssl.so.0.9.8e
0071d000-0071e000 r-xp 0071d000 00:00 0 [vdso]
0071e000-007b1000 r-xp 00000000 08:03 14134259 /usr/lib/libkrb5.so.3.3
007b1000-007b4000 rw-p 00092000 08:03 14134259 /usr/lib/libkrb5.so.3.3
0081e000-0082e000 rwxp 0081e000 00:00 0
00a14000-00a2f000 r-xp 00000000 08:03 22741009 /lib/ld-2.5.so
00a2f000-00a30000 r--p 0001a000 08:03 22741009 /lib/ld-2.5.so
00a30000-00a31000 rw-p 0001b000 08:03 22741009 /lib/ld-2.5.so
00a33000-00a35000 r-xp 00000000 08:03 22742250 /lib/libkeyutils-1.2.so
00a35000-00a36000 rw-p 00001000 08:03 22742250 /lib/libkeyutils-1.2.so
00a38000-00b8b000 r-xp 00000000 08:03 22741016 /lib/libc-2.5.so
00b8b000-00b8d000 r--p 00152000 08:03 22741016 /lib/libc-2.5.so
00b8d000-00b8e000 rw-p 00154000 08:03 22741016 /lib/libc-2.5.so
00b8e000-00b91000 rw-p 00b8e000 00:00 0
00b93000-00b96000 r-xp 00000000 08:03 22741044 /lib/libdl-2.5.so
00b96000-00b97000 r--p 00002000 08:03 22741044 /lib/libdl-2.5.so
00b97000-00b98000 rw-p 00003000 08:03 22741044 /lib/libdl-2.5.so
00b9a000-00bc1000 r-xp 00000000 08:03 22741070 /lib/libm-2.5.so
00bc1000-00bc2000 r--p 00026000 08:03 22741070 /lib/libm-2.5.so
00bc2000-00bc3000 rw-p 00027000 08:03 22741070 /lib/libm-2.5.so
00bc5000-00bda000 r-xp 00000000 08:03 22741024 /lib/libpthread-2.5.so
00bda000-00bdb000 r--p 00015000 08:03 22741024 /lib/libpthread-2.5.so
00bdb000-00bdc000 rw-p 00016000 08:03 22741024 /lib/libpthread-2.5.so
00bdc000-00bde000 rw-p 00bdc000 00:00 0
00be0000-00bf2000 r-xp 00000000 08:03 14131443 /usr/lib/libz.so.1.2.3
00bf2000-00bf3000 rw-p 00011000 08:03 14131443 /usr/lib/libz.so.1.2.3
00bf5000-00c30000 r-xp 00000000 08:03 22742252 /lib/libsepol.so.1
00c30000-00c31000 rw-p 0003b000 08:03 22742252 /lib/libsepol.so.1
00c31000-00c3b000 rw-p 00c31000 00:00 0
00c3d000-00c53000 r-xp 00000000 08:03 22742253 /lib/libselinux.so.1
00c53000-00c55000 rw-p 00015000 08:03 22742253 /lib/libselinux.so.1
00c62000-00c77000 r-xp 00000000 08:03 22741040 /lib/libnsl-2.5.so
00c77000-00c78000 r--p 00014000 08:03 22741040 /lib/libnsl-2.5.so
00c78000-00c79000 rw-p 00015000 08:03 22741040 /lib/libnsl-2.5.so
00c79000-00c7b000 rw-p 00c79000 00:00 0
00d5e000-00d67000 r-xp 00000000 08:03 22741898 /lib/libcrypt-2.5.so
00d67000-00d68000 r--p 00008000 08:03 22741898 /lib/libcrypt-2.5.so
00d68000-00d69000 rw-p 00009000 08:03 22741898 /lib/libcrypt-2.5.so
00d69000-00d90000 rw-p 00d69000 00:00 0
00d92000-00d9d000 r-xp 00000000 08:03 22741206 /lib/libgcc_s-4.1.2-20080825.so.1
00d9d000-00d9e000 rw-p 0000a000 08:03 22741206 /lib/libgcc_s-4.1.2-20080825.so.1
00da0000-00da2000 r-xp 00000000 08:03 22742254 /lib/libcom_err.so.2.1
00da2000-00da3000 rw-p 00001000 08:03 22742254 /lib/libcom_err.so.2.1
00da5000-00db5000 r-xp 00000000 08:03 22742251 /lib/libresolv-2.5.so
00db5000-00db6000 r--p 0000f000 08:03 22742251 /lib/libresolv-2.5.so
00db6000-00db7000 rw-p 00010000 08:03 22742251 /lib/libresolv-2.5.so
00db7000-00db9000 rw-p 00db7000 00:00 0
08048000-08065000 r-xp 00000000 08:03 14425222 /usr/local/src/ape_server/bin/aped
08065000-08066000 rw-p 0001d000 08:03 14425222 /usr/local/src/ape_server/bin/aped
09edb000-0c300000 rw-p 09edb000 00:00 0 [heap]
b78a2000-b798b000 rw-p b7c74000 00:00 0
b7a00000-b7c00000 rw-p b7a00000 00:00 0
b7c8e000-b7fb5000 rw-p b7c8e000 00:00 0
b7fbf000-b7fc0000 rw-p b7fbf000 00:00 0
bfb98000-bfbad000 rw-p bffe9000 00:00 0 [stack]

Some Ape.conf:
Server {
daemon = yes
rlimit_nofile = 1000000
}
Log {
debug = 1
}
JSONP {
eval_func = Ape.transport.read
allowed = 1
}

Server "crash" on chat demo multi-tab

To replicate:
Open the Chat demo app in Firefox in one tab. Then open it in another tab. Firebug shows repeated (fast) requests to server and page is left blank... If this tab is closed and the first tab is reloaded it has the same bug now. Must restart server for it to work again...

outgoing HTTPS request

Will APE Server be able to request a thrid party website via https?

This is important for openID or OAuth stuff

Segfault in 2 lines of code

Ape.addEvent("beforeJoin", function(user, channel) {
    user.quit();
});
Program received signal SIGSEGV, Segmentation fault.
json_set_property_strN (obj=obj@entry=0x8138448, key=key@entry=0x8064070 "pubid", keylen=keylen@entry=5, 
    value=0x59 <Address 0x59 out of bounds>, valuelen=valuelen@entry=32) at src/json.c:638
638     if (*value != '\0') {
(gdb) bt
#0  json_set_property_strN (obj=obj@entry=0x8138448, key=key@entry=0x8064070 "pubid", keylen=keylen@entry=5, 
    value=0x59 <Address 0x59 out of bounds>, valuelen=valuelen@entry=32) at src/json.c:638
#1  0x0805fb42 in get_json_object_user (user=0x81617c0) at src/users.c:690
#2  0x0804f5b2 in join (user=0x81617c0, chan=0x81356d8, g_ape=0x806c6f0) at src/channel.c:180
#3  0xb7b34164 in ape_cb_join (user=0x81617c0, chan=0x81356d8, g_ape=0x806c6f0) at libape-spidermonkey.c:5866
#4  0x0804f4fe in join (user=0x81617c0, chan=0x81356d8, g_ape=0x806c6f0) at src/channel.c:138
#5  0x0804fcc1 in cmd_join (callbacki=0xbffff050) at src/cmd.c:508
#6  0x08050668 in process_cmd (ijson=ijson@entry=0x81606e0, pc=pc@entry=0xbffff0c4, iuser=iuser@entry=0xbffff16c, 
    g_ape=g_ape@entry=0x806c6f0) at src/cmd.c:266
#7  0x08050a45 in checkcmd (cget=cget@entry=0xbffff17c, transport=TRANSPORT_LONGPOLLING, iuser=iuser@entry=0xbffff16c, 
    g_ape=g_ape@entry=0x806c6f0) at src/cmd.c:385
#8  0x08051f51 in checkrecv (co=0x81616d0, g_ape=g_ape@entry=0x806c6f0) at src/handle_http.c:265
#9  0x08059681 in parser_ready_http (http_parser=0x81616ec, g_ape=0x806c6f0) at src/parser.c:43
#10 0x08053b44 in process_http (co=0x81616d0, g_ape=0x806c6f0) at src/http.c:613
#11 0x0805d9d1 in sockroutine (g_ape=g_ape@entry=0x806c6f0) at src/sock.c:488
#12 0x0804d831 in main (argc=1, argv=0xbffff684) at src/entry.c:332
(gdb) 

Overwrite daemon flag from command line

Here is a suggestion:

The below block is located in the in the file ape.conf:

Server {
        port = 6969
        daemon = no
        ip_listen = 0.0.0.0
        domain = auto
        rlimit_nofile = 10000
        pid_file = /var/run/aped.pid
}

It would help if this options could be overwritten through the command line

For example consider the below configuration:

Server {
        port = 6969
        daemon = yes
        ip_listen = 0.0.0.0
        domain = auto
        rlimit_nofile = 10000
        pid_file = ./running.pid
}

Executing ./aped would start the server as daemon

To debug this server i have to duplicate the existing ape.conf into debug.conf. In debug.conf i just change daemon = no and then run ./aped --cfg debug.conf

It would be nice if one could just run somthing like ./aped -daemon no to debug a server which is configured to start as damon by default.

IPv6

Does APEd have IPv6 support?

APE doesn't send the Demo-Msg

Hi there.

You can watch the Bug by yourself.
Here: http://riyuk.de/jsclient/Demos/Controller/demo.html you can find the Demo of the Controller.
If you now just open the "test.php" APE isn't able to send the given Msg.
If you open the printet URL by yourself the Message will be sent.

APE is running as "stand alone" as daemon. It's not used with mod_proxy.
APE got his own IP Adress with Port 80.

~$ host ape.riyuk.de

ape.riyuk.de A 88.198.120.222

~$ host 4.ape.riyuk.de

4.ape.riyuk.de A 88.198.120.222

My Webserver got this A-Record:
~$ host riyuk.de

riyuk.de A 78.46.93.206

Any solutions?

Bug while changing transports

Ok so i've been developing a few little demos to showcase the use of APE. While testing i had different apps using different transports. If i first navigate to a demo that uses websockets it will connect to APE for the first time and create the session. Then if i navigate to another demo which uses long-poling and the same session, the response of the very first request will have a few extra bits/characters which breaks the JSON parsing process. Below is a screenshot of firebug

Imgur

It might not be relevant since in a production environment you will most likely want to be consistent with the transport of choice.

ape server on squeeze (with libc6 2.11)

Hello,
I need your help for install ape server on my server in debian squeeze. My problem is ape server need libc6 > 2.14 but squeeze dont have this version.

Can you help me plz ?

thx

missing ) after argument list (w/JSONP transport method)

the error message "missing ) after argument list" appears when I send an inlinepush message enabling JSONP transport method

I modified the file "APE_Server/scripts/commands/inlinepush.js"
I do not know if this is the correct procedure:

adding:

params.data.message = escape(params.data.message);

before:

chan.pipe.sendRaw(params.raw, params.data);

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.