libcutils/mq.c
static void masterHandleConnectionRequest(PeerProxy* peerProxy, 
        Header* header) {
    Peer* master = peerProxy->peer;
    pid_t targetPid = header->credentials.pid;
    if (!hashmapContainsKey(peerProxy->connections, &targetPid)) {
        // We haven't connected these peers yet.
        PeerProxy* targetPeer 
            = (PeerProxy*) hashmapGet(master->peerProxies, &targetPid);
        if (targetPeer == NULL) {
            // Unknown process.
            masterReportConnectionError(peerProxy, header->credentials);
        } else {
            masterConnectPeers(peerProxy, targetPeer);
        }
    }
    
    // This packet is complete. Get ready for the next one.
    peerProxyExpectHeader(peerProxy);
}
/**
 * Handles a request to be connected to another peer.
 */
Handles a request to be connected to another peer.
Handles a request to be connected to another peer .
static void masterHandleConnectionRequest(PeerProxy* peerProxy, 
        Header* header) {
    Peer* master = peerProxy->peer;
    pid_t targetPid = header->credentials.pid;
    if (!hashmapContainsKey(peerProxy->connections, &targetPid)) {
        PeerProxy* targetPeer 
            = (PeerProxy*) hashmapGet(master->peerProxies, &targetPid);
        if (targetPeer == NULL) {
            masterReportConnectionError(peerProxy, header->credentials);
        } else {
            masterConnectPeers(peerProxy, targetPeer);
        }
    }
    peerProxyExpectHeader(peerProxy);
}
static void masterHandleConnectionRequest ( PeerProxy * peerProxy , Header * header ) { Peer * master = peerProxy -> peer ; pid_t targetPid = header -> credentials . pid ; if ( ! hashmapContainsKey ( peerProxy -> connections , & targetPid ) ) { PeerProxy * targetPeer = ( PeerProxy * ) hashmapGet ( master -> peerProxies , & targetPid ) ; if ( targetPeer == NULL ) { masterReportConnectionError ( peerProxy , header -> credentials ) ; } else { masterConnectPeers ( peerProxy , targetPeer ) ; } } peerProxyExpectHeader ( peerProxy ) ; }
Handles a request to be connected to another peer.
Handles a request to be connected to another peer .
// We haven't connected these peers yet. // Unknown process. // This packet is complete. Get ready for the next one.