intirain преди 4 години
родител
ревизия
d2879bde50
променени са 3 файла, в които са добавени 11 реда и са изтрити 3 реда
  1. 1 1
      Makefile
  2. 1 1
      include/vcc/version.h
  3. 9 1
      vcc.c

+ 1 - 1
Makefile

@@ -1,6 +1,6 @@
 VCCD_MAJOR 		= 1
 VCCD_MINOR 		= 15
-VCCD_PATCH 		= 0
+VCCD_PATCH 		= 1
 VCCD_STR 		= -rc 
 
 VCCD_COMPILE_TIME 	= $(shell date)

+ 1 - 1
include/vcc/version.h

@@ -1,2 +1,2 @@
-#define VCCD_VERSION "vccd 1.15.0 Sun Jun 12 09:10:35 PM CST 2022 root"
+#define VCCD_VERSION "vccd 1.15.0 Fri Jun 17 10:13:09 PM CST 2022 root"
 #define VCCD_SEMVER "vccd 1.15.0-rc "

+ 9 - 1
vcc.c

@@ -265,7 +265,7 @@ int send_users(int fd) {
 int vcc_new_msg(int fd, struct vcc_request *req) {
 	struct klist_node 	*n = find_connection(fd);
 	char 			*msg;
-	int 			sid;
+	int 			sid, magic;
 
 	if (unlikely(!n)) 
 		return 1;
@@ -278,6 +278,14 @@ int vcc_new_msg(int fd, struct vcc_request *req) {
 	 * f**k. 
 	 * */
 
+	magic = ntohl(req->magic);
+
+	if (magic != VCC_MAGIC || magic != VCC_MAGIC_RL) {
+		vcc_log("--- bad magic from %d. \n", fd);
+
+		return 1;
+	}
+
 	switch (htonl(req->reqtype)) {
 	case REQ_MSG_NEW:
 		/* POLLOUT will be set, just because they sent us a message */