libebb

23 views
Skip to first unread message

ry

unread,
Jul 19, 2008, 9:37:07 PM7/19/08
to ebbebb
I am working on a new C language web server library called libebb. It
will replace the internal socket connection and parsing used in Ebb
soon. This will allow Ebb to handle things like chunked requests
without a problem and open the door to further enhancements.

libebb is a complete rewrite. It does not use much from the current
code. I choose to name it the same because these were my original
intentions with src/ebb.{c,h}

Read more about it at http://tinyclouds.org/libebb/

ry

Dae San Hwang

unread,
Jul 20, 2008, 9:57:46 AM7/20/08
to ebb...@googlegroups.com
Does this mean that libebb will be a replacement for Ebb? How is http
server library different from http server?

ry

unread,
Jul 20, 2008, 10:03:11 AM7/20/08
to ebbebb
the ruby interface will be the same - and the ruby code ruby_lib/**/*
will be the same. the files src/ebb.{c,h} and src/parser.{rl,h} will
be replaced with libebb and src/ebb_ruby.c will need to be modified to
fit the new interface (i'm doing it presently).

ry

Dae San Hwang

unread,
Jul 20, 2008, 1:29:50 PM7/20/08
to ebb...@googlegroups.com
Sounds cool. Can't wait to see it.

daesan

ry

unread,
Jul 31, 2008, 6:32:39 AM7/31/08
to ebbebb
Progress update on libebb: it now supports HTTPS connections through
GnuTLS. This is basically the last step towards supporting all
possible web interactions. Perhaps writing load balancers with Ebb is
not such a distant reality. We'll see.

Hopefully I'll have the Ruby binding (Ebb) will be updated soon to
reflect the new work on libebb. This is being done at
http://github.com/ry/ebb/tree/using_libebb

ry

Dae San Hwang

unread,
Aug 3, 2008, 4:48:28 AM8/3/08
to ebb...@googlegroups.com
Does libebb depend on glibc?

I am having some difficulties compiling libebb on both Mac OS X and
OpenSolaris. I am getting the following error..

"ebb.c:17:19: error.h: No such file or directory"

daesan

ry dahl

unread,
Aug 3, 2008, 4:53:39 AM8/3/08
to ebb...@googlegroups.com
Hi Daesan,

Yes, i suppose. Does macintosh not have error.h ?
I haven't tried to compile it on mac yet - perhaps I'll do that this afternoon.

ry

Dae San Hwang

unread,
Aug 3, 2008, 7:22:26 AM8/3/08
to ebb...@googlegroups.com
Hi ry,

When I run "find / -name error.h", I get the following..

From Mac OS X 10.5:

/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/
Kernel.framework/Versions/A/Headers/mach/error.h
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/mach/error.h
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/objc/error.h
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
Kernel.framework/Versions/A/Headers/mach/error.h
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/mach/error.h
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/objc/error.h
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/
Kernel.framework/Versions/A/Headers/mach/error.h
/Developer/SDKs/MacOSX10.5.sdk/usr/include/mach/error.h
/Developer/SDKs/MacOSX10.5.sdk/usr/include/objc/error.h
/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/
error.h
/usr/include/mach/error.h
/usr/include/objc/error.h
/usr/local/include/xapian/error.h
/usr/local/src/gnutls-2.5.2/gl/error.h
/usr/local/src/xapian-core-1.0.7/include/xapian/error.h


From OpenSolaris 2008. 5:

/usr/include/ast/error.h
/usr/include/avahi-common/error.h

ry dahl

unread,
Aug 3, 2008, 2:44:29 PM8/3/08
to ebb...@googlegroups.com
I've updated the repository - no long uses error.h. Ruby-Ebb is also
updated to use libebb. Please try it if you get a chance.

ry

Dae San Hwang

unread,
Aug 3, 2008, 5:49:34 PM8/3/08
to ebb...@googlegroups.com
Awesome. Now I can compile libebb on Mac OS X without any problem.

However, when I try to install ruby-ebb gem, I get the following
error. Should "ev.c" be included in the gem file?

make
gcc -I. -I/usr/local/include/ruby-1.9.0/i686-darwin9.4.0 -I/usr/local/
include/ruby-1.9.0 -I. -DHAVE_SYS_SELECT_H -DHAVE_POLL_H -
DHAVE_SYS_EVENT_H -DHAVE_SYS_QUEUE_H -DRUBY_VERSION_CODE=190 -
D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O2 -g -Wall -Wno-
parentheses -pipe -fno-common -I/opt/local/include -I/usr/local/lib/
ruby/gems/1.9.0/gems/ebb-0.3.0/libev -DHAVE_GNUTLS -DEV_USE_SELECT -
DEV_USE_POLL -DEV_USE_KQUEUE -o ebb_ffi.o -c ebb_ffi.c
ebb_ffi.c:12:16: error: ev.c: No such file or directory
ebb_ffi.c: In function 'header_field':
ebb_ffi.c:201: warning: array subscript has type 'char'
ebb_ffi.c: In function 'headers_complete':
ebb_ffi.c:281: error: invalid lvalue in assignment
ebb_ffi.c:281: error: invalid lvalue in assignment
ebb_ffi.c: In function 'connection_write':
ebb_ffi.c:472: warning: unused variable 'buf'
make: *** [ebb_ffi.o] Error 1

daesan


On Aug 4, 2008, at 3:44 AM, ry dahl wrote:

>
> I've updated the repository - no long uses error.h. Ruby-Ebb is also
> updated to use libebb. Please try it if you get a chance.
>
> ry
>
>
> On Sun, Aug 3, 2008 at 1:22 PM, Dae San Hwang <li...@daesan.com>
> wrote:
>>
>> Hi ry,
>>
>> When I run "find / -name error.h", I get the following..
>>
>> From Mac OS X 10.5:
>>

>> /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/
>> Kernel.framework/Versions/A/Headers/mach/error.h
>> /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/mach/error.h
>> /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/objc/error.h
>> /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
>> Kernel.framework/Versions/A/Headers/mach/error.h
>> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/mach/error.h
>> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/objc/error.h
>> /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/
>> Kernel.framework/Versions/A/Headers/mach/error.h
>> /Developer/SDKs/MacOSX10.5.sdk/usr/include/mach/error.h
>> /Developer/SDKs/MacOSX10.5.sdk/usr/include/objc/error.h
>> /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/
>> error.h

ry dahl

unread,
Aug 3, 2008, 6:00:48 PM8/3/08
to ebb...@googlegroups.com
If your using the latest revision
rake libev
should download libev (if you have wget installed). when i distribute
the gem i'll include libev and libebb but i don't want to keep them in
the ebb-ruby repository. instead it is supposed to download them if
they are missing.

(that is: you don't need to install libebb separately to run ruby-ebb)

ry


On Sun, Aug 3, 2008 at 11:49 PM, Dae San Hwang <li...@daesan.com> wrote:
>
> Awesome. Now I can compile libebb on Mac OS X without any problem.
>
> However, when I try to install ruby-ebb gem, I get the following error.
> Should "ev.c" be included in the gem file?
>
> make
> gcc -I. -I/usr/local/include/ruby-1.9.0/i686-darwin9.4.0
> -I/usr/local/include/ruby-1.9.0 -I. -DHAVE_SYS_SELECT_H -DHAVE_POLL_H
> -DHAVE_SYS_EVENT_H -DHAVE_SYS_QUEUE_H -DRUBY_VERSION_CODE=190

> -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O2 -g -Wall


> -Wno-parentheses -pipe -fno-common -I/opt/local/include
> -I/usr/local/lib/ruby/gems/1.9.0/gems/ebb-0.3.0/libev -DHAVE_GNUTLS

> -DEV_USE_SELECT -DEV_USE_POLL -DEV_USE_KQUEUE -o ebb_ffi.o -c ebb_ffi.c


> ebb_ffi.c:12:16: error: ev.c: No such file or directory
> ebb_ffi.c: In function 'header_field':
> ebb_ffi.c:201: warning: array subscript has type 'char'
> ebb_ffi.c: In function 'headers_complete':
> ebb_ffi.c:281: error: invalid lvalue in assignment
> ebb_ffi.c:281: error: invalid lvalue in assignment
> ebb_ffi.c: In function 'connection_write':
> ebb_ffi.c:472: warning: unused variable 'buf'
> make: *** [ebb_ffi.o] Error 1
>
> daesan
>
>
> On Aug 4, 2008, at 3:44 AM, ry dahl wrote:
>
>>
>> I've updated the repository - no long uses error.h. Ruby-Ebb is also
>> updated to use libebb. Please try it if you get a chance.
>>
>> ry
>>
>>
>> On Sun, Aug 3, 2008 at 1:22 PM, Dae San Hwang <li...@daesan.com> wrote:
>>>
>>> Hi ry,
>>>
>>> When I run "find / -name error.h", I get the following..
>>>
>>> From Mac OS X 10.5:
>>>
>>>

>>> /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/error.h
>>> /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/mach/error.h
>>> /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/objc/error.h
>>>
>>> /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/error.h
>>> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/mach/error.h
>>> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/objc/error.h
>>>
>>> /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/error.h
>>> /Developer/SDKs/MacOSX10.5.sdk/usr/include/mach/error.h
>>> /Developer/SDKs/MacOSX10.5.sdk/usr/include/objc/error.h
>>>
>>> /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach/error.h

Dae San Hwang

unread,
Aug 3, 2008, 6:27:42 PM8/3/08
to ebb...@googlegroups.com
Okay. So rather than building the gem first and installing from it, I
ran "rake compile" and got the following error this time..

Would you shed the light once more? ;)

cd src && make


gcc -I. -I/usr/local/include/ruby-1.9.0/i686-darwin9.4.0 -I/usr/local/
include/ruby-1.9.0 -I. -DHAVE_SYS_SELECT_H -DHAVE_POLL_H -
DHAVE_SYS_EVENT_H -DHAVE_SYS_QUEUE_H -DRUBY_VERSION_CODE=190 -
D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O2 -g -Wall -Wno-

parentheses -pipe -fno-common -I/opt/local/include -I/Users/daesan/
ebb2/libev -DHAVE_GNUTLS -DEV_USE_SELECT -DEV_USE_POLL -

DEV_USE_KQUEUE -o ebb_ffi.o -c ebb_ffi.c

In file included from ebb_ffi.c:12:
/Users/daesan/ebb2/libev/ev.c:330:49: warning: "/*" within comment
In file included from ebb_ffi.c:12:
/Users/daesan/ebb2/libev/ev.c: In function 'ev_feed_event':
/Users/daesan/ebb2/libev/ev.c:645: warning: unused variable 'ocur_'
/Users/daesan/ebb2/libev/ev.c: In function 'fd_change':
/Users/daesan/ebb2/libev/ev.c:750: warning: unused variable 'ocur_'
/Users/daesan/ebb2/libev/ev.c: In function 'ev_feed_signal_event':
/Users/daesan/ebb2/libev/ev.c:1116: warning: left-hand operand of
comma expression has no effect
In file included from /Users/daesan/ebb2/libev/ev.c:1194,
from ebb_ffi.c:12:
/Users/daesan/ebb2/libev/ev_kqueue.c: In function 'kqueue_change':
/Users/daesan/ebb2/libev/ev_kqueue.c:51: warning: unused variable
'ocur_'
In file included from /Users/daesan/ebb2/libev/ev.c:1200,
from ebb_ffi.c:12:
/Users/daesan/ebb2/libev/ev_poll.c: In function 'poll_modify':
/Users/daesan/ebb2/libev/ev_poll.c:64: warning: unused variable 'ocur_'
In file included from ebb_ffi.c:12:
/Users/daesan/ebb2/libev/ev.c: In function 'verify_watcher':
/Users/daesan/ebb2/libev/ev.c:1519: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c:1522: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'verify_heap':
/Users/daesan/ebb2/libev/ev.c:1532: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c:1533: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c:1534: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'array_verify':
/Users/daesan/ebb2/libev/ev.c:1545: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'ev_loop_verify':
/Users/daesan/ebb2/libev/ev.c:1562: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c:1569: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c:1570: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'timers_reify':
/Users/daesan/ebb2/libev/ev.c:1746: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'periodics_reify':
/Users/daesan/ebb2/libev/ev.c:1776: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'ev_io_start':
/Users/daesan/ebb2/libev/ev.c:2131: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'ev_io_stop':
/Users/daesan/ebb2/libev/ev.c:2152: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'ev_timer_start':
/Users/daesan/ebb2/libev/ev.c:2172: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c:2178: warning: unused variable 'ocur_'
/Users/daesan/ebb2/libev/ev.c: In function 'ev_timer_stop':
/Users/daesan/ebb2/libev/ev.c:2200: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'ev_periodic_start':
/Users/daesan/ebb2/libev/ev.c:2254: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c:2265: warning: unused variable 'ocur_'
/Users/daesan/ebb2/libev/ev.c: In function 'ev_periodic_stop':
/Users/daesan/ebb2/libev/ev.c:2287: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'ev_signal_start':
/Users/daesan/ebb2/libev/ev.c:2320: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c:2325: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'ev_child_start':
/Users/daesan/ebb2/libev/ev.c:2386: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'ev_idle_start':
/Users/daesan/ebb2/libev/ev.c:2696: warning: unused variable 'ocur_'
/Users/daesan/ebb2/libev/ev.c: In function 'ev_prepare_start':
/Users/daesan/ebb2/libev/ev.c:2735: warning: unused variable 'ocur_'
/Users/daesan/ebb2/libev/ev.c: In function 'ev_check_start':
/Users/daesan/ebb2/libev/ev.c:2771: warning: unused variable 'ocur_'
/Users/daesan/ebb2/libev/ev.c: In function 'ev_embed_start':
/Users/daesan/ebb2/libev/ev.c:2848: warning: left-hand operand of
comma expression has no effect
/Users/daesan/ebb2/libev/ev.c: In function 'ev_fork_start':
/Users/daesan/ebb2/libev/ev.c:2896: warning: unused variable 'ocur_'
/Users/daesan/ebb2/libev/ev.c: In function 'ev_async_start':
/Users/daesan/ebb2/libev/ev.c:2936: warning: unused variable 'ocur_'


ebb_ffi.c: In function 'header_field':
ebb_ffi.c:201: warning: array subscript has type 'char'
ebb_ffi.c: In function 'headers_complete':
ebb_ffi.c:281: error: invalid lvalue in assignment
ebb_ffi.c:281: error: invalid lvalue in assignment
ebb_ffi.c: In function 'connection_write':
ebb_ffi.c:472: warning: unused variable 'buf'
make: *** [ebb_ffi.o] Error 1

rake aborted!
Command failed with status (2): [cd src && make...]
/Users/daesan/ebb2/rakefile:42:in `block in <top (required)>'
(See full trace by running task with --trace)

daesan

>>>> /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/
>>>> Kernel.framework/Versions/A/Headers/mach/error.h
>>>> /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/mach/error.h
>>>> /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/objc/error.h
>>>>
>>>> /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/
>>>> Kernel.framework/Versions/A/Headers/mach/error.h
>>>> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/mach/error.h
>>>> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/objc/error.h
>>>>
>>>> /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/
>>>> Kernel.framework/Versions/A/Headers/mach/error.h
>>>> /Developer/SDKs/MacOSX10.5.sdk/usr/include/mach/error.h
>>>> /Developer/SDKs/MacOSX10.5.sdk/usr/include/objc/error.h
>>>>
>>>> /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/
>>>> mach/error.h

ry dahl

unread,
Aug 4, 2008, 4:59:53 AM8/4/08
to ebb...@googlegroups.com
On Mon, Aug 4, 2008 at 12:27 AM, Dae San Hwang <li...@daesan.com> wrote:
>
> Okay. So rather than building the gem first and installing from it, I ran
> "rake compile" and got the following error this time..
>
> Would you shed the light once more? ;)

Of course! Thank you for trying this out - it's very helpful. There
were some small build problems with YARV, it seems to be fixed now.

ry

ry

unread,
Aug 4, 2008, 8:10:46 AM8/4/08
to ebbebb
p.s. please compare the memory usage. it should be much improved.

Dae San Hwang

unread,
Aug 5, 2008, 11:59:47 PM8/5/08
to ebb...@googlegroups.com
Great! Ebb now compiles fine on OS X and I can run my web framework on
it.

When I start ebb and access it from the web browser, it doesn't
respond though. The request goes through and my application runs the
routed action, but no response from the server.

daesan

ry dahl

unread,
Aug 6, 2008, 4:22:13 AM8/6/08
to ebb...@googlegroups.com
You must manually set the Content-Length now. I think that might be the problem.
(Maybe I should add that logic again...)

ry

Dae San Hwang

unread,
Aug 7, 2008, 12:19:19 PM8/7/08
to ebb...@googlegroups.com
I've set Content-Length now but the problem persists.. Can you suggest
some ways I can gather more clues to the problem?

ry dahl

unread,
Aug 7, 2008, 1:06:53 PM8/7/08
to ebb...@googlegroups.com
What is the application? Rails? I fixed a little problem yesterday for
Rails apps.
If you can figure out where it dies that helps :)

Dae San Hwang

unread,
Aug 7, 2008, 9:37:49 PM8/7/08
to ebb...@googlegroups.com
I'm building my own little web framework yet to be named. :)

It doesn't seem to die but just hangs. I will see what other clues I
can find.

daesan

Reply all
Reply to author
Forward
0 new messages