Thinko in processing of SHM message size info?
От | Antonin Houska |
---|---|
Тема | Thinko in processing of SHM message size info? |
Дата | |
Msg-id | 14359.1438866268@localhost обсуждение исходный текст |
Ответы |
Re: Thinko in processing of SHM message size info?
|
Список | pgsql-hackers |
Can anyone please explain why the following patch shouldn't be applied? diff --git a/src/backend/storage/ipc/shm_mq.c b/src/backend/storage/ipc/shm_mq.c index 126cb07..4cd52ac 100644 --- a/src/backend/storage/ipc/shm_mq.c +++ b/src/backend/storage/ipc/shm_mq.c @@ -584,7 +584,7 @@ shm_mq_receive(shm_mq_handle *mqh, Size *nbytesp, void **datap, bool nowait) if (mqh->mqh_partial_bytes+ rb > sizeof(Size)) lengthbytes = sizeof(Size) - mqh->mqh_partial_bytes; else - lengthbytes = rb - mqh->mqh_partial_bytes; + lengthbytes = rb; memcpy(&mqh->mqh_buffer[mqh->mqh_partial_bytes], rawdata, lengthbytes); mqh->mqh_partial_bytes += lengthbytes; I'm failing to understand why anything should be subtracted. Note that the previous iteration must have called shm_mq_inc_bytes_read(), so "rb" should not include anything of mqh->mqh_partial_bytes. Thanks. -- Antonin Houska Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt Web: http://www.postgresql-support.de, http://www.cybertec.at
В списке pgsql-hackers по дате отправления: