Browse Source

Merge branch 'httpsrv' into bfgminer

Conflicts:
	make-release
Luke Dashjr 12 years ago
parent
commit
96cc2497d9
5 changed files with 44 additions and 14 deletions
  1. 6 0
      configure.ac
  2. 10 3
      driver-getwork.c
  3. 8 0
      httpsrv.c
  4. 1 1
      libblkmaker
  5. 19 10
      make-release

+ 6 - 0
configure.ac

@@ -1058,6 +1058,12 @@ else
 	echo "  ZTEX.FPGAs...........: Disabled"
 fi
 
+if test "x$httpsrv" = "xyes"; then
+	echo "  getwork.proxy.server.: Enabled"
+else
+	echo "  getwork.proxy.server.: Disabled"
+fi
+
 if test "x$bitforce$modminer" != xnono; then
 	echo "  libudev.detection....: $libudev"
 fi

+ 10 - 3
driver-getwork.c

@@ -9,10 +9,17 @@
 
 #include "config.h"
 
+#ifdef WIN32
+#include <winsock2.h>
+#endif
+
 #include <stdint.h>
+
+#ifndef WIN32
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/socket.h>
+#endif
 
 #include <jansson.h>
 #include <microhttpd.h>
@@ -87,9 +94,9 @@ void getwork_init()
 }
 
 static
-void getwork_first_client()
+void getwork_first_client(struct cgpu_info *cgpu)
 {
-	pthread_create(&prune_worklog_pth, NULL, prune_worklog_thread, getwork_clients);
+	pthread_create(&prune_worklog_pth, NULL, prune_worklog_thread, cgpu);
 }
 
 static
@@ -204,7 +211,7 @@ int handle_getwork(struct MHD_Connection *conn, bytes_t *upbuf)
 		mutex_unlock(&getwork_clients_mutex);
 		
 		if (!b)
-			getwork_first_client();
+			getwork_first_client(cgpu);
 	}
 	else
 	{

+ 8 - 0
httpsrv.c

@@ -9,10 +9,18 @@
 
 #include "config.h"
 
+#ifdef WIN32
+#include <winsock2.h>
+#endif
+
 #include <stdint.h>
+
+#ifndef WIN32
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/socket.h>
+#endif
+
 #include <microhttpd.h>
 
 #include "logging.h"

+ 1 - 1
libblkmaker

@@ -1 +1 @@
-Subproject commit bca8f6f5e56c547e9bbc808fb644152e44f3344d
+Subproject commit 8f4bb3ee9f43405203fef6f64ca938dc7933a060

+ 19 - 10
make-release

@@ -57,10 +57,13 @@ dlls='
 	libcurl-4.dll
 	pthreadGC2.dll
 	libjansson-4.dll
-	libmicrohttpd-10.dll
 	libusb-1.0.dll
 	zlib1.dll
 '
+libmicrohttpd_dlls='
+	libmicrohttpd-10.dll
+	libplibc-1.dll
+'
 docs='
 	AUTHORS
 	COPYING
@@ -82,15 +85,6 @@ for build in "${builds[@]}"; do
 	if test "x$DEBUG_RELEASE" = "x1"; then
 		CFLAGS="${CFLAGS} -g"
 	fi
-	for dll in $dlls; do
-		libdir="/usr/$machine/usr/lib"
-		[ -e "$libdir/$dll" ] ||
-			libdir="/usr/$machine/usr/bin"
-		[ -e "$libdir/$dll" ] ||
-			continue
-		cp -v -L "$libdir/$dll" "$PKGDIR"
-		"$machine"-strip "$PKGDIR/$dll"
-	done
 	for doc in $docs; do
 		sed 's/$/\r/' <"$doc" >"$PKGDIR/${doc}.txt"
 	done
@@ -124,6 +118,21 @@ for build in "${builds[@]}"; do
 		miner.php \
 		"$PKGDIR/"
 	mkdir "$PKGDIR/bitstreams"
+	
+	mydlls="$dlls"
+	if "${machine}-objdump" -p bfgminer.exe | grep -q "DLL Name: libmicrohttpd"; then
+		mydlls="$mydlls $libmicrohttpd_dlls"
+	fi
+	for dll in $mydlls; do
+		libdir="/usr/$machine/usr/lib"
+		[ -e "$libdir/$dll" ] ||
+			libdir="/usr/$machine/usr/bin"
+		[ -e "$libdir/$dll" ] ||
+			continue
+		cp -v -L "$libdir/$dll" "$PKGDIR"
+		"$machine"-strip "$PKGDIR/$dll"
+	done
+	
 	make clean
 	cd "$PKGDIR/.."
 	zip -r "$OUTDIR/$PKGNAME.zip" "$PKGNAME"