Rework buffer API a little

Use BufferIter and BufferBuilder instead of Packet*
Make separate method to set the header so you can set it later and not
only at builder init time.
Add method to clear the builder if you want to abort.
Add method to add fd to builder instead of in _add_fd_payload. This
would make it easier to add multiple fd-payloads using data from the
same fd.
Pass PinosPacketFDPayload to add_fd_payload to make it symetric with the
parsing code. We should be able to get the size from the VERSION passed
when the builder was made.
Add ideas about releasing the fds back to the server.
This commit is contained in:
Wim Taymans 2015-08-26 12:46:28 +02:00
parent 4e92d32540
commit 0e03080002
8 changed files with 211 additions and 100 deletions

View file

@ -71,17 +71,26 @@ Types:
0: fd-payload section
Used to send a buffer between client and server.
<id> : 4 bytes : id of the fd-payload
<offset> : 8 bytes : offset
<size> : 8 bytes : size
<fd-index> : 4 bytes : index of fd
1: format change
1: release fd-payload
Release a fd-payload with <id>
<id> : 4 bytes : the id number of the released fd-payload
2: format change
<format-id> : 1 byte : format id
<format> : 0-terminated : contains serialized format
2: property changes
3: property changes
<key> : 0-terminated : key
<value> : 0-terminated : value