libcutils/mq.c
static void peerProxyEnqueueOutgoingPacket(PeerProxy* peerProxy,
        OutgoingPacket* newPacket) {
    newPacket->nextPacket = NULL; // Just in case.
    if (peerProxy->currentPacket == NULL) {
        // The queue is empty.
        peerProxy->currentPacket = newPacket;
        peerProxy->lastPacket = newPacket;
        
        peerProxyPrepareOutgoingHeader(peerProxy); 
    } else {
        peerProxy->lastPacket->nextPacket = newPacket;
    }
}
/** Adds a packet to the end of the queue. Callers must have the mutex. */
Adds a packet to the end of the queue. Callers must have the mutex.
Adds a packet to the end of the queue . Callers must have the mutex .
static void peerProxyEnqueueOutgoingPacket(PeerProxy* peerProxy,
        OutgoingPacket* newPacket) {
    newPacket->nextPacket = NULL; 
    if (peerProxy->currentPacket == NULL) {
        peerProxy->currentPacket = newPacket;
        peerProxy->lastPacket = newPacket;
        peerProxyPrepareOutgoingHeader(peerProxy); 
    } else {
        peerProxy->lastPacket->nextPacket = newPacket;
    }
}
static void peerProxyEnqueueOutgoingPacket ( PeerProxy * peerProxy , OutgoingPacket * newPacket ) { newPacket -> nextPacket = NULL ; if ( peerProxy -> currentPacket == NULL ) { peerProxy -> currentPacket = newPacket ; peerProxy -> lastPacket = newPacket ; peerProxyPrepareOutgoingHeader ( peerProxy ) ; } else { peerProxy -> lastPacket -> nextPacket = newPacket ; } }
Adds a packet to the end of the queue.
Adds a packet to the end of the queue .
// Just in case. // The queue is empty.