sd-rtnl: socket_read - use a read buffer
authorTom Gundersen <teg@jklm.no>
Mon, 14 Apr 2014 15:20:51 +0000 (17:20 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 14 Apr 2014 15:53:21 +0000 (17:53 +0200)
commita88f77c406ea56160c1e5a4b39eab1de134abe40
treed1da4d5a0fae4a11dfa5429e65c03b09109a55a6
parent1403f45ab61d6f2026a3a7a06b52a536c1b7a3b3
sd-rtnl: socket_read - use a read buffer

Rather than allocating/freeing memory for each message read, keep a global read buffer
in the rtnl object. Also, rather than using a fixed size, peek at the pending message
header to get the message size and reallocate as necessary.
src/libsystemd/sd-rtnl/rtnl-internal.h
src/libsystemd/sd-rtnl/rtnl-message.c
src/libsystemd/sd-rtnl/sd-rtnl.c