ebb_request callback pointer lifetime

3 views
Skip to first unread message

Naitik Shah

unread,
Mar 29, 2009, 2:10:29 PM3/29/09
to ebbebb
Hey ry,

I am implementing callbacks for ebb_request which store the various
marks and their lengths, and process them when the on_complete
callback is invoked. It seems to be working, but I wasn't sure about
how long the internal buffer the marks are pointing to is valid for.
Is this a valid approach?


Thanks!

-Naitik

Ryan Dahl

unread,
Mar 30, 2009, 5:54:52 AM3/30/09
to ebb...@googlegroups.com
Hi Naitik,

The buffers are only valid during the callback. One your implemented
callback ends the buffer is gone. Memcpy data if you need it later.
Better is to do request processing as the data comes in. For example,
if there is no handler for a given URI, you can start sending a 404
before you even receive any request headers.

ry

Reply all
Reply to author
Forward
0 new messages