Removed explicit m_buf[0] from Msg39Request/Msg39Reply

This also fixes the sizeof/(...) versus &m_buf-this confusion which is currently
harmless but a bug in the upcoming encoding changes.

Origin: e57fb2f72c
This commit is contained in:
Ivan Skytte Jørgensen 2016-04-04 12:36:32 +02:00 committed by Dmitry Smirnov
parent 1a2693dc12
commit 8eba33f359
3 changed files with 4 additions and 7 deletions

View File

@ -167,7 +167,7 @@ void Msg39::getDocIds ( UdpSlot *slot ) {
&m_r->size_readSizes ,
&m_r->size_whiteList,//coll ,
&m_r->ptr_readSizes,
m_r->m_buf );
((char*)m_r) + sizeof(*m_r) );
// sanity check
if ( finalSize != requestSize ) {

View File

@ -162,7 +162,7 @@ class Msg39Request {
int32_t size_whiteList;
//int32_t size_coll;
char m_buf[0];
// variable data comes here
};
@ -204,10 +204,7 @@ public:
int32_t size_facetHashList;
int32_t size_clusterRecs;
// . this is the "string buffer" and it is a variable size
// . this whole class is cast to a udp reply, so the size of "buf"
// depends on the size of that udp reply
char m_buf[0];
// variable data comes here
};

View File

@ -774,7 +774,7 @@ bool Msg3a::gotAllShardReplies ( ) {
&mr->size_docIds,
&mr->size_clusterRecs,
&mr->ptr_docIds,
mr->m_buf ) ) {
((char*)mr) + sizeof(*mr) ) ) {
g_errno = ECORRUPTDATA;
m_errno = ECORRUPTDATA;
log("query: msg3a: Shard had error: %s",