File scripts/builder.php changed (mode: 100644) (index 2623a7a..30dc40b) |
... |
... |
do { |
994 |
994 |
} |
} |
995 |
995 |
|
|
996 |
996 |
if ($_i['last_pong'] + 30 < $now) { |
if ($_i['last_pong'] + 30 < $now) { |
997 |
|
rg_log($_k . ': Worker did not answer to ping! Close it!'); |
|
|
997 |
|
rg_log($_k . ': Worker did not answer to ping' |
|
998 |
|
. ' (last_pong=' . $_i['last_pong'] . ')!' |
|
999 |
|
. ' Shutdown conn!'); |
998 |
1000 |
rg_conn_shutdown($_k, 2); |
rg_conn_shutdown($_k, 2); |
999 |
1001 |
} |
} |
1000 |
1002 |
} |
} |
File scripts/worker.php changed (mode: 100644) (index b972dee..c4d1c06) |
... |
... |
function xhandle_one($key, $data) |
2134 |
2134 |
|
|
2135 |
2135 |
if (strcmp($op, 'DRE') == 0) { // DRE = done received |
if (strcmp($op, 'DRE') == 0) { // DRE = done received |
2136 |
2136 |
if (!isset($jobs[$jid])) { |
if (!isset($jobs[$jid])) { |
|
2137 |
|
$k = array_keys($jobs); |
|
2138 |
|
rg_log($key . ': ' . $jid . ': DEBUG:' |
|
2139 |
|
. ' DRE for a non existing job! Ignore cmd.'); |
|
2140 |
|
rg_log($key . ': ' . $jid . ': DEBUG:' |
|
2141 |
|
. ' existing jobs: ' . implode(',', $k) . '.'); |
2137 |
2142 |
// We already received a DRE message |
// We already received a DRE message |
2138 |
2143 |
return; |
return; |
2139 |
2144 |
} |
} |
|
... |
... |
$stats = array('jobs' => 0); |
3091 |
3096 |
|
|
3092 |
3097 |
rg_log('Loading job-*.ser files...'); |
rg_log('Loading job-*.ser files...'); |
3093 |
3098 |
$jobs = rg_load_files($conf['state'], 'job-[0-9]*.ser', 'id'); |
$jobs = rg_load_files($conf['state'], 'job-[0-9]*.ser', 'id'); |
3094 |
|
// this crashes badly! |
|
3095 |
|
//if (!empty($jobs)) |
|
3096 |
|
// rg_log_debug('Jobs loaded from dir: ' . rg_array2string_short($jobs)); |
|
|
3099 |
|
if (!empty($jobs)) { |
|
3100 |
|
$k = array_keys($jobs); |
|
3101 |
|
rg_log_debug('Jobs loaded from dir: ' . impode(',', $k) . '.'); |
|
3102 |
|
} |
3097 |
3103 |
rg_log(' done.'); |
rg_log(' done.'); |
3098 |
3104 |
|
|
3099 |
3105 |
rg_worker_connect(); |
rg_worker_connect(); |
File tests/http.inc.php changed (mode: 100644) (index 8e8d9eb..a8f5da2) |
... |
... |
function do_req($info, $url, &$data, &$headers) |
183 |
183 |
exit(1); |
exit(1); |
184 |
184 |
} |
} |
185 |
185 |
|
|
186 |
|
// Check with tidy |
|
|
186 |
|
// Check with tidy & other stuff |
|
187 |
|
$check_uvars = TRUE; |
187 |
188 |
if (!stristr($ret['header'], 'Content-Type: ')) { |
if (!stristr($ret['header'], 'Content-Type: ')) { |
188 |
189 |
rg_log('Content-Type header missing!'); |
rg_log('Content-Type header missing!'); |
189 |
190 |
exit(1); |
exit(1); |
190 |
191 |
} else if (stristr($ret['header'], 'Content-Type: application/octet-stream')) { |
} else if (stristr($ret['header'], 'Content-Type: application/octet-stream')) { |
191 |
192 |
// do nothing |
// do nothing |
|
193 |
|
$check_uvars = FALSE; |
192 |
194 |
} else if (stristr($ret['header'], 'Content-Type: application/x-rpm')) { |
} else if (stristr($ret['header'], 'Content-Type: application/x-rpm')) { |
193 |
195 |
// do nothing |
// do nothing |
|
196 |
|
$check_uvars = FALSE; |
194 |
197 |
} else if (stristr($ret['header'], 'Content-Type: text/plain')) { |
} else if (stristr($ret['header'], 'Content-Type: text/plain')) { |
195 |
198 |
// do nothing |
// do nothing |
196 |
199 |
} else if (stristr($ret['header'], 'Content-Type: text/xml')) { |
} else if (stristr($ret['header'], 'Content-Type: text/xml')) { |
|
... |
... |
function do_req($info, $url, &$data, &$headers) |
227 |
230 |
} |
} |
228 |
231 |
|
|
229 |
232 |
// Check if a '@@' is present |
// Check if a '@@' is present |
230 |
|
if (strstr($ret['body'], '@@')) { |
|
|
233 |
|
if ($check_uvars && strstr($ret['body'], '@@')) { |
231 |
234 |
$t = explode('@@', $ret['body']); |
$t = explode('@@', $ret['body']); |
232 |
235 |
$t = explode('@@', $t[1]); |
$t = explode('@@', $t[1]); |
233 |
236 |
if (!strstr($t[0], ' ')) { |
if (!strstr($t[0], ' ')) { |