@@ -90,20 +90,23 @@ class AppleMIDIParser
90
90
while (i < buffer.size ())
91
91
i++;
92
92
#endif
93
- parserReturn parserReturn = parserReturn::Processed;
93
+ auto retVal = parserReturn::Processed;
94
94
95
+ // when given a Session Name and the buffer has been fully processed and the
96
+ // last character is not 'endl', then we got a very long sessionName. It will
97
+ // continue in the next memory chunk of the packet. We don't care, so indicated
98
+ // flush the remainder of the packet.
99
+ // First part if the session name is kept, processing continues
95
100
if (i > minimumLen)
96
101
if (i == buffer.size () && buffer[i] != 0x00 )
97
- parserReturn = parserReturn::SessionNameVeryLong;
102
+ retVal = parserReturn::SessionNameVeryLong;
98
103
99
104
while (i--)
100
105
buffer.pop_front (); // consume all the bytes that made up this message
101
106
102
107
session->ReceivedInvitation (invitation, portType);
103
108
104
- int yy = buffer.size ();
105
-
106
- return parserReturn;
109
+ return retVal;
107
110
}
108
111
else if (0 == memcmp (command, amEndSession, sizeof (amEndSession)))
109
112
{
@@ -283,20 +286,23 @@ class AppleMIDIParser
283
286
i++;
284
287
#endif
285
288
286
- parserReturn parserReturn = parserReturn::Processed;
289
+ auto retVal = parserReturn::Processed;
287
290
291
+ // when given a Session Name and the buffer has been fully processed and the
292
+ // last character is not 'endl', then we got a very long sessionName. It will
293
+ // continue in the next memory chunk of the packet. We don't care, so indicated
294
+ // flush the remainder of the packet.
295
+ // First part if the session name is kept, processing continues
288
296
if (i > minimumLen)
289
297
if (i == buffer.size () && buffer[i] != 0x00 )
290
- parserReturn = parserReturn::SessionNameVeryLong;
298
+ retVal = parserReturn::SessionNameVeryLong;
291
299
292
300
while (i--)
293
301
buffer.pop_front (); // consume all the bytes that made up this message
294
302
295
- int yy = buffer.size ();
296
-
297
303
session->ReceivedInvitationAccepted (invitationAccepted, portType);
298
304
299
- return parserReturn ;
305
+ return retVal ;
300
306
}
301
307
else if (0 == memcmp (command, amInvitationRejected, sizeof (amInvitationRejected)))
302
308
{
0 commit comments