[Tile-serving] [openstreetmap/mod_tile] cope with recv returning fewer bytes than expected (PR #347)
Frederik Ramm
notifications at github.com
Thu Oct 19 09:08:41 UTC 2023
When the `poll` system call signals readability on a socket, there is no guarantee that more than one byte is actually readable. In 99.9% of cases you will be able whatever the OS's internal buffer size is - something like 4k - and this will be more than enough for a mod_tile message. But you cannot rely on that. Assuming that `recv` will always return at least `sizeof (struct protocol_v2)` and throwing an error otherwise is bad design.
This pull request makes mod_tile concatenate the results of several `recv` calls until the desired number of bytes has been read.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/mod_tile/pull/347
-- Commit Summary --
* cope with recv returning fewer bytes than expected
-- File Changes --
M src/mod_tile.c (55)
-- Patch Links --
https://github.com/openstreetmap/mod_tile/pull/347.patch
https://github.com/openstreetmap/mod_tile/pull/347.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/mod_tile/pull/347
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/mod_tile/pull/347 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20231019/d50cb907/attachment-0001.htm>
More information about the Tile-serving
mailing list