Skip to content

Commit 67f1023

Browse files
committed
POSIX + typo
1 parent fb3f34c commit 67f1023

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Minecraft Honeypot
22

3-
A simple Minecraft honeypot (IP logger) written in C.
3+
A simple **POSIX-compliant** Minecraft honeypot (IP logger) written in C.
44

55
# How to Build & Run
66

@@ -48,6 +48,12 @@ Written for: [https://blog.urpagin.net/coding-a-minecraft-honeypot/](https://blo
4848

4949
I wrote this blog post because experimenting with sockets and Minecraft is genuinely enjoyable!
5050

51+
52+
# Known Bugs
53+
54+
* When the Minecraft client spams the 'Refresh button', the entry corresponding to the honeypot shows as pending.
55+
56+
5157
# Releases Build Command
5258

5359
Here is the command I use to build the releases (>=1.12):

main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <bits/types/struct_timeval.h>
1+
#include <sys/time.h>
22
#include <stdbool.h>
33
#include <stdio.h>
44
#include <string.h>
@@ -23,7 +23,7 @@ static char json_response_buffer[JSON_BUFFER_SIZE];
2323
static unsigned long connection_count = 0;
2424

2525
// The time waiting for a new packet from the client before timing out.
26-
static const unsigned long RECV_TIMOUT_MS = 200;
26+
static const unsigned long RECV_TIMEOUT_MS = 200;
2727

2828
// Since we are handling ONE connection at a time, this is valid
2929
// The state switches from Handshake status to Status.
@@ -132,7 +132,7 @@ int get_client_socket(int sockfd) {
132132
// Set a timeout for recv on the client socket
133133
struct timeval timeout;
134134
timeout.tv_sec = 0; // Seconds
135-
timeout.tv_usec = RECV_TIMOUT_MS * 1000; // RECV_TIMEOUT in microseconds
135+
timeout.tv_usec = RECV_TIMEOUT_MS * 1000; // RECV_TIMEOUT in microseconds
136136

137137
if (setsockopt(client_sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)) < 0) {
138138
perror("[get_client_socket] Error setting timeout");

0 commit comments

Comments
 (0)