Explorar el Código

SER-324 fix: dont throw away terminating zero from payload

Jiri Kuthan hace 17 años
padre
commit
35ab13d8b1
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      udp_server.c

+ 6 - 1
udp_server.c

@@ -477,7 +477,12 @@ int udp_rcv_loop()
 #ifdef USE_STUN
 		}
 #endif
-#ifndef USE_STUN
+/* historically, zero-terminated packets indicated a bug in clients
+ * that calculated wrongly packet length and included string-terminating
+ * zero; today clients exist with legitimate binary payloads and we
+ * shall not check for zero-terminated payloads
+ */
+#ifdef TRASH_ZEROTERMINATED_PACKETS
 		if (buf[len-1]==0) {
 			tmp=ip_addr2a(&ri.src_ip);
 			LOG(L_WARN, "WARNING: udp_rcv_loop: "