Skip to content

Commit 55bacef

Browse files
committed
Update README.md
1 parent 3220a9f commit 55bacef

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
WebSocket frame parser
22
======================
33

4-
54
### Features
65
* No dependencies
76
* No internal buffering
87
* No need to buffer the whole frame — works with chunks of a data
8+
* No syscalls
9+
* No allocations
10+
* It can be interrupted at anytime
911

10-
This is a parser for WebSocket frame-messages written in C (by [RFC6455](https://tools.ietf.org/html/rfc6455)).
11-
It does not make any syscalls nor allocations, it does not
12-
buffer data, it can be interrupted at anytime.
12+
This is a parser for WebSocket frame-messages written in C (see [RFC6455](https://tools.ietf.org/html/rfc6455)).
1313

1414
Tested as part of [PHP-ION](https://github.com/php-ion/php-ion) extension.
1515

@@ -81,11 +81,13 @@ When data is received execute the parser and check for errors.
8181
8282
```c
8383
size_t nread;
84+
// .. init settitngs and parser ...
8485
8586
nread = websocket_parser_execute(parser, &settings, data, data_len);
86-
if(parser->error || nread != data_len) {
87-
// e.g. log error
87+
if(nread != data_len) {
88+
// some callback return a value other than 0
8889
}
90+
8991
// ...
9092
free(parser);
9193
```

0 commit comments

Comments
 (0)