|
|
@ -986,6 +986,7 @@ sxlink_t *sxlink_master_accept(sxhub_t *hub, int sck, struct in_addr *addr)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bbuf = (char *)buf;
|
|
|
|
bbuf = (char *)buf;
|
|
|
|
bbuf += sizeof(sxmplv2_head_t);
|
|
|
|
bbuf += sizeof(sxmplv2_head_t);
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
|
|
|
|
|
|
|
|
while(link->flags & SXMP_BATCHMODE) {
|
|
|
|
while(link->flags & SXMP_BATCHMODE) {
|
|
|
|
rd = __conn_read(link, buf, sizeof(sxmplv2_head_t));
|
|
|
|
rd = __conn_read(link, buf, sizeof(sxmplv2_head_t));
|
|
|
@ -995,11 +996,18 @@ sxlink_t *sxlink_master_accept(sxhub_t *hub, int sck, struct in_addr *addr)
|
|
|
|
/* check for returns */
|
|
|
|
/* check for returns */
|
|
|
|
if(head->opcode != SXE_SUCCESS) { r = head->opcode; goto __fail3; }
|
|
|
|
if(head->opcode != SXE_SUCCESS) { r = head->opcode; goto __fail3; }
|
|
|
|
else { /* opcode is fine */
|
|
|
|
else { /* opcode is fine */
|
|
|
|
|
|
|
|
i++;
|
|
|
|
/* if we're ready for messaging mode, turn off batch mode */
|
|
|
|
/* if we're ready for messaging mode, turn off batch mode */
|
|
|
|
if(link->flags & SXMP_MESSAGINGMODE) {
|
|
|
|
if(link->flags & SXMP_MESSAGINGMODE) {
|
|
|
|
link->flags &= ~SXMP_BATCHMODE;
|
|
|
|
link->flags &= ~SXMP_BATCHMODE;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* if count too big - fail */
|
|
|
|
|
|
|
|
if(i > MAX_SXMP_SYNC_ITERATIONS) { /* ugly */
|
|
|
|
|
|
|
|
r = SXE_FAILED;
|
|
|
|
|
|
|
|
goto __fail3;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!head->payload_length) continue; /* pass the following check up */
|
|
|
|
if(!head->payload_length) continue; /* pass the following check up */
|
|
|
|