| | 1079 | /* A lot of checks are performed before the while loop is executed. |
|---|
| | 1080 | * This is necessary because this while loop is only present for one |
|---|
| | 1081 | * reason, a NEXT MESSAGE request from the remote peer if the original |
|---|
| | 1082 | * message data does not fit into one message (MaxMsgSize to small). |
|---|
| | 1083 | * The following stuff is checked: |
|---|
| | 1084 | * |
|---|
| | 1085 | * - the session must be in normal mode |
|---|
| | 1086 | * - not sending or waiting |
|---|
| | 1087 | * - no changed message counters |
|---|
| | 1088 | * - there must be a waiting command (not a waiting status!) |
|---|
| | 1089 | * |
|---|
| | 1090 | * Usually this happens if an image is too large and must be splitted |
|---|
| | 1091 | * (MaxMsgSize < MaxObjSize). Do not touch this stuff except that you |
|---|
| | 1092 | * really test it with an image which must be send and it is correctly |
|---|
| | 1093 | * splitted. |
|---|
| | 1094 | */ |
|---|
| | 1095 | unsigned int receivedMsg = session->lastReceivedMessageID; |
|---|
| | 1096 | unsigned int lastMsg = session->lastMessageID; |
|---|
| | 1097 | while (!session->waiting && !session->sending && |
|---|
| | 1098 | smlQueueCheck(session->command_queue) && |
|---|
| | 1099 | smlQueueLength(session->command_queue) != smlQueueLengthPrio(session->command_queue) && |
|---|
| | 1100 | receivedMsg == session->lastReceivedMessageID && |
|---|
| | 1101 | lastMsg == session->lastMessageID) |
|---|
| | 1102 | { |
|---|
| | 1103 | /* If the session does not wait for the remote peer (session->waiting) |
|---|
| | 1104 | * and there is a command in the queue |
|---|
| | 1105 | * then the command is dispatched. |
|---|
| | 1106 | * If the command is too large then the session is automatically |
|---|
| | 1107 | * flushed. If all commands were dispatched then the queue check |
|---|
| | 1108 | * fails and the normal mechanism for sending messages flushes |
|---|
| | 1109 | * the session or do some other actions. |
|---|
| | 1110 | */ |
|---|
| | 1111 | smlQueueDispatch(session->command_queue); |
|---|
| | 1112 | } |
|---|
| | 1113 | |
|---|