9c86125a0e
Use traditional recv loop over a stream socket rather than depending on MSG_WAITALL to be available. (Interix doesn't have MSG_WAITALL.)
28 lines
714 B
Text
28 lines
714 B
Text
$NetBSD: patch-aa,v 1.3 2005/11/03 16:45:13 tv Exp $
|
|
|
|
--- osfinger.c.orig 2002-07-21 02:49:32.000000000 -0400
|
|
+++ osfinger.c
|
|
@@ -33,6 +33,7 @@
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
#include <netdb.h>
|
|
+#include <arpa/inet.h>
|
|
#include <signal.h>
|
|
|
|
#include "arirang.h"
|
|
@@ -71,7 +72,14 @@ osdetect(char *scanhost)
|
|
}
|
|
snprintf(osfinger, sizeof(osfinger), "GET %s%s HTTP/1.0\n\n", NETCRAFT_FINGER, scanhost);
|
|
send(sock, osfinger, strlen(osfinger), 0);
|
|
- recv(sock, headBuff, sizeof(headBuff), MSG_WAITALL);
|
|
+
|
|
+ {
|
|
+ int toRead = sizeof(headBuff);
|
|
+ int wasRead;
|
|
+
|
|
+ while ((wasRead = recv(sock, headBuff, toRead, 0)) > 0)
|
|
+ toRead -= wasRead;
|
|
+ }
|
|
|
|
ptr = strstr(headBuff, "running <b>");
|
|
|