incorrect handling of long (multi-packet) field?

Bug #1160058 reported by Wim Lewis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle Client & Protocol Library
Fix Released
Medium
Andrew Hutchings

Bug Description

I'm not sure if this code is actually incorrect, or if it just looks wrong, but in field.cc near line 287 there's this code:

    {
      con->pop_state();
      con->push_state(drizzle_state_packet_read);
      con->push_state(drizzle_state_field_read);
    }

The intent, I think, is to cause libdrizzle to read the next packet header and then return to reading the current field, but the two 'push' operations are in the wrong order for that.

(Since the current state is presumably drizzle_state_field_read anyway, I think both the pop_state() and the push_state(drizzle_state_field_read) could be removed, leaving just the push_state(drizzle_state_packet_read) --- after which libdrizzle would return to what it's doing now, i.e., continuing to read the multi-packet field.)

Related branches

Changed in libdrizzle:
importance: Undecided → Medium
assignee: nobody → Andrew Hutchings (linuxjedi)
status: New → Triaged
milestone: none → 5.1.4
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

you are totally right, I think that is really old code. Good spot. Removing those worked perfectly and I believe gave us a nice small optimization too :)

Changed in libdrizzle:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.