And the corresponding error in the other function as well.
mixed do_command( ... ) { fd->write( encode_command( command ) ); while( 1 ) { data = fd->read( 2048, 1 ); while( mixed msg = protocol_parser->feed( data ) ) { if( msg->type == REPLY ) return msg->payload; else process_async_msg( msg ); data=""; } } }