Browse code

-DDBG_MSG_QA introduced

Jiri Kuthan authored on 26/08/2002 19:41:42
Showing 1 changed files
... ...
@@ -235,6 +235,30 @@ int udp_send(struct socket_info *source, char *buf, unsigned len,
235 235
 
236 236
 	int n;
237 237
 
238
+#ifdef DBG_MSG_QA
239
+	char *space;
240
+	int my_len;
241
+
242
+	if (memchr(buf, 0, len)) {
243
+		LOG(L_CRIT, "BUG: message being sent with 0 in it\n");
244
+		abort();
245
+	}
246
+	my_len=len;
247
+	space=buf;
248
+	while((space=memchr(space, ' ', my_len ))) {
249
+		/* how much we have after the space */
250
+		my_len=len-(space-buf)+1;
251
+		/* EoM -- stop checks */
252
+		if (my_len<3) break;
253
+		if (memcmp(space+1, "   ", 3)==0) {
254
+			LOG(L_CRIT, "BUG(probably): "
255
+				"message with four spaces in it\n");
256
+			abort();
257
+		}
258
+		space+=3;my_len-=3;
259
+	}
260
+#endif
261
+
238 262
 again:
239 263
 	n=sendto(source->socket, buf, len, 0, &to->s, tolen);
240 264
 	if (n==-1){