소스 검색

[#1276] remove debug method

tim 10 달 전
부모
커밋
644d3cdeaa
1개의 변경된 파일0개의 추가작업 그리고 73개의 파일을 삭제
  1. 0 73
      unittest/public_server.c

+ 0 - 73
unittest/public_server.c

@@ -57,79 +57,6 @@
 #define SLEEP_AFTER_MG_STOP (5)
 
 
-#ifdef HEXDUMP
-#else
-void
-hexDumpth(const char *desc, const void *addr, const int len, int perLine)
-{
-	// Silently ignore silly per-line values.
-
-	if (perLine < 4 || perLine > 64)
-		perLine = 16;
-
-	int i;
-	unsigned char buff[perLine + 1];
-	const unsigned char *pc = (const unsigned char *)addr;
-
-	// Output description if given.
-
-	if (desc != NULL)
-		fprintf(stderr, "%s:\n", desc);
-
-	// Length checks.
-
-	if (len == 0) {
-		fprintf(stderr, "  ZERO LENGTH\n");
-		return;
-	}
-	if (len < 0) {
-		fprintf(stderr, "  NEGATIVE LENGTH: %d\n", len);
-		return;
-	}
-
-	// Process every byte in the data.
-
-	for (i = 0; i < len; i++) {
-		// Multiple of perLine means new or first line (with line offset).
-
-		if ((i % perLine) == 0) {
-			// Only print previous-line ASCII buffer for lines beyond first.
-
-			if (i != 0)
-				fprintf(stderr, "  %s\n", buff);
-
-			// Output the offset of current line.
-
-			fprintf(stderr, "  %04x ", i);
-		}
-
-		// Now the hex code for the specific character.
-
-		fprintf(stderr, " %02x", pc[i]);
-
-		// And buffer a printable ASCII character for later.
-
-		if ((pc[i] < 0x20) || (pc[i] > 0x7e)) // isprint() may be better.
-			buff[i % perLine] = '.';
-		else
-			buff[i % perLine] = pc[i];
-		buff[(i % perLine) + 1] = '\0';
-	}
-
-	// Pad out last line if not exactly perLine characters.
-
-	while ((i % perLine) != 0) {
-		fprintf(stderr, "   ");
-		i++;
-	}
-
-	// And print the final ASCII buffer.
-
-	fprintf(stderr, "  %s\n", buff);
-}
-#define HEXDUMP
-#endif
-
 /* Try to communicate with an external http server. */
 static const char *
 get_external_server_ip(void)