Browse Source

Merge commit 'cffd5ae' into bfgminer

Luke Dashjr 13 years ago
parent
commit
ecd0dd9599
2 changed files with 41 additions and 43 deletions
  1. 23 32
      miner.c
  2. 18 11
      miner.php

+ 23 - 32
miner.c

@@ -3586,7 +3586,7 @@ static bool queue_request(struct thr_info *thr, bool needed)
 	struct workio_cmd *wc;
 	struct timeval now;
 	time_t scan_post;
-	int toq, rq, rs;
+	int rq, rs;
 	bool ret = true;
 
 	/* Prevent multiple requests being executed at once */
@@ -3613,42 +3613,33 @@ static bool queue_request(struct thr_info *thr, bool needed)
 
 	requested_tv_sec = now.tv_sec;
 
-	if (rq > rs)
-		toq = rq - mining_threads;
-	else
-		toq = rs - mining_threads;
+	inc_queued();
 
-	do {
-		inc_queued();
-
-		/* fill out work request message */
-		wc = calloc(1, sizeof(*wc));
-		if (unlikely(!wc)) {
-			applog(LOG_ERR, "Failed to calloc wc in queue_request");
-			ret = false;
-			break;
-		}
-
-		wc->cmd = WC_GET_WORK;
-		wc->thr = thr;
+	/* fill out work request message */
+	wc = calloc(1, sizeof(*wc));
+	if (unlikely(!wc)) {
+		applog(LOG_ERR, "Failed to calloc wc in queue_request");
+		ret = false;
+		goto out;
+	}
 
-		/* If we're queueing work faster than we can stage it, consider the
-		 * system lagging and allow work to be gathered from another pool if
-		 * possible */
-		if (rq && needed && !rs && !opt_fail_only)
-			wc->lagging = true;
+	wc->cmd = WC_GET_WORK;
+	wc->thr = thr;
 
-		applog(LOG_DEBUG, "Queueing getwork request to work thread");
+	/* If we're queueing work faster than we can stage it, consider the
+	 * system lagging and allow work to be gathered from another pool if
+	 * possible */
+	if (rq && needed && !rs && !opt_fail_only)
+		wc->lagging = true;
 
-		/* send work request to workio thread */
-		if (unlikely(!tq_push(thr_info[work_thr_id].q, wc))) {
-			applog(LOG_ERR, "Failed to tq_push in queue_request");
-			workio_cmd_free(wc);
-			ret = false;
-			break;
-		}
+	applog(LOG_DEBUG, "Queueing getwork request to work thread");
 
-	} while (--toq > 0);
+	/* send work request to workio thread */
+	if (unlikely(!tq_push(thr_info[work_thr_id].q, wc))) {
+		applog(LOG_ERR, "Failed to tq_push in queue_request");
+		workio_cmd_free(wc);
+		ret = false;
+	}
 
 out:
 	control_tclear(&queueing);

+ 18 - 11
miner.php

@@ -60,6 +60,11 @@ $warnfont = '<font color=red><b>';
 $warnoff = '</b></font>';
 $dfmt = 'H:i:s j-M-Y \U\T\CP';
 #
+global $miner_font_family, $miner_font_size;
+#
+$miner_font_family = 'verdana,arial,sans';
+$miner_font_size = '13pt';
+#
 # This below allows you to put your own settings into a seperate file
 # so you don't need to update miner.php with your preferred settings
 # every time a new version is released
@@ -78,6 +83,7 @@ $rigerror = array();
 #
 function htmlhead($checkapi)
 {
+ global $miner_font_family, $miner_font_size;
  global $error, $readonly, $here;
  if ($readonly === false && $checkapi === true)
  {
@@ -87,21 +93,22 @@ function htmlhead($checkapi)
 	||  $access['STATUS']['STATUS'] != 'S')
 		$readonly = true;
  }
-?>
-<html><head><title>Mine</title>
+ $miner_font = "font-family:$miner_font_family; font-size:$miner_font_size;";
+
+ echo "<html><head><title>Mine</title>
 <style type='text/css'>
-td { color:blue; font-family:verdana,arial,sans; font-size:13pt; }
-td.h { color:blue; font-family:verdana,arial,sans; font-size:13pt; background:#d0ffff }
-td.err { color:black; font-family:verdana,arial,sans; font-size:13pt; background:#ff3050 }
-td.warn { color:black; font-family:verdana,arial,sans; font-size:13pt; background:#ffb050 }
-td.sta { color:green; font-family:verdana,arial,sans; font-size:13pt; }
-td.tot { color:blue; font-family:verdana,arial,sans; font-size:13pt; background:#fff8f2 }
-td.lst { color:blue; font-family:verdana,arial,sans; font-size:13pt; background:#ffffdd }
+td { color:blue; $miner_font }
+td.h { color:blue; $miner_font background:#d0ffff }
+td.err { color:black; $miner_font background:#ff3050 }
+td.warn { color:black; $miner_font background:#ffb050 }
+td.sta { color:green; $miner_font }
+td.tot { color:blue; $miner_font background:#fff8f2 }
+td.lst { color:blue; $miner_font background:#ffffdd }
 </style>
 </head><body bgcolor=#ecffff>
 <script type='text/javascript'>
-function pr(a,m){if(m!=null){if(!confirm(m+'?'))return}window.location="<?php echo $here ?>"+a}
-<?php
+function pr(a,m){if(m!=null){if(!confirm(m+'?'))return}window.location=\"$here\"+a}\n";
+
  if ($readonly === false && $checkapi === true)
  {
 ?>