Network protocol - how to detect message termination

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Network protocol - how to detect message termination

Samba - rsync mailing list

Currently I'm developing an rsync packet sniffer and I'm trying to understand the basics of the network protocol.
I had a hard time analyzing the source code and couldn't find the answers to the 2 main issues I have:

1. How do I detect the end of the file list message(s) sent by the sender?
2. How do I detect the end of the checksums message(s) sent by the receiver?

According to the "when the sender is sending the file list it simply
sends each file list entry and terminates the list with a null byte. Within the file list entries, a bitfield
indicates which fields of the structure to expect and those that are variable length strings are simply null terminated.
The generator sending file numbers and block checksum sets works the same way", but I don't find this statement to be true.

For the sake of simplicity please consider daemon-mode connection with no additional options.

Kind regards,

Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options:
Before posting, read: