|
@ -92,6 +92,8 @@ int32_t LP_Qenqueued,LP_Qdequeued; |
|
|
void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) |
|
|
void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,int32_t peerind) |
|
|
{ |
|
|
{ |
|
|
struct LP_queue *ptr; |
|
|
struct LP_queue *ptr; |
|
|
|
|
|
if ( LP_Qenqueued == 0 ) |
|
|
|
|
|
{ |
|
|
ptr = calloc(1,sizeof(*ptr) + msglen); |
|
|
ptr = calloc(1,sizeof(*ptr) + msglen); |
|
|
ptr->crc32 = crc32; |
|
|
ptr->crc32 = crc32; |
|
|
ptr->sock = sock; |
|
|
ptr->sock = sock; |
|
@ -100,7 +102,8 @@ void _LP_sendqueueadd(uint32_t crc32,int32_t sock,uint8_t *msg,int32_t msglen,in |
|
|
memcpy(ptr->msg,msg,msglen); |
|
|
memcpy(ptr->msg,msg,msglen); |
|
|
DL_APPEND(LP_Q,ptr); |
|
|
DL_APPEND(LP_Q,ptr); |
|
|
LP_Qenqueued++; |
|
|
LP_Qenqueued++; |
|
|
printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen); |
|
|
//printf("Q.%p: peerind.%d msglen.%d\n",ptr,peerind,msglen);
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void queue_loop(void *ignore) |
|
|
void queue_loop(void *ignore) |
|
|