Thanks for the update,
a minor improvement required:
+ if (sr->uri_processed.len == strlen(subprotocol_list[i].name) &&
+ strncmp(sr->uri_processed.data, subprotocol_list[i].name,
+ strlen(subprotocol_list[i].name)) == 0) {
if you have a fixed length string do not perform strlen() every time,
that is expensive. Once you fix that i will publish your patch.
regards,
On Wed, Apr 4, 2012 at 10:05 AM, Kay <[email protected]> wrote:
> Sorry about that, the new attached patch can work now.
>
> Regards,
> Kay
>
>
>
> On Wed, Apr 4, 2012 at 7:44 AM, Eduardo Silva <[email protected]> wrote:
>>
>> Hi,
>>
>> you forget to include the header:
>>
>> gcc -g -Wall -DDEBUG -DSAFE_FREE -I../../src/include -fPIC -c ws.c
>> ws.c:46:18: fatal error: echo.h: No such file or directory
>>
>> please also make sure to do not include trailing whitespaces:
>>
>> /home/edsiper/Downloads/websocket_echo_subprotocol_enabled.patch:183:
>> trailing whitespace.
>> unsigned char *frame_payload;
>> /home/edsiper/Downloads/websocket_echo_subprotocol_enabled.patch:207:
>> trailing whitespace.
>> else if (payload_length == 127) {
>> /home/edsiper/Downloads/websocket_echo_subprotocol_enabled.patch:259:
>> trailing whitespace.
>>
>> regards,
>>
>> On Mon, Apr 2, 2012 at 8:54 AM, Kay <[email protected]> wrote:
>> > This patch implements the function of sending frame and sample
>> > subprotocol:
>> > echo, it simply send back the payload it received. Now it can work with
>> > the
>> > echo test in websocket.org. This can also be regarded as framework for
>> > further development, it must have drawbacks can be improved, so any
>> > suggestions are appreciated.
>> >
>> > This patch is based on the one applied to master, but not my previous
>> > one(Includes it). If the previous one has not be applied, then forget
>> > it.
>> >
>> > This is the first time I use epoll, and I want to ask a question about
>> > it. I
>> > think the socket should be set to edge triggered, or the write event
>> > will be
>> > kept invoking. Right? But why I didn't see any code in monkey change the
>> > mode to MK_EPOLL_EDGE_TRIGGERED. Thanks for your explanation.
>> >
>> > --Kay
>> >
>> >
>> >
>> > _______________________________________________
>> > Monkey mailing list
>> > [email protected]
>> > http://lists.monkey-project.com/listinfo/monkey
>> >
>>
>>
>>
>> --
>> Eduardo Silva
>> http://edsiper.linuxchile.cl
>> http://www.monkey-project.com
>
>
--
Eduardo Silva
http://edsiper.linuxchile.cl
http://www.monkey-project.com
_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey