+
+ function stat_set($stat) {
+ $this->stat = "$stat";
+
+ /*
+ if (validate_sess($this->sess)) {
+ $fp = fopen(PROXY_PATH."/".$this->sess.".stat", 'w');
+ fwrite($fp, sprintf("%s\n",$this->stat));
+ fclose($fp);
+ }
+ */
+ }
+
+ function step_set($step) {
+ $this->step = $step;
+
+ do {
+ if (validate_sess($this->sess) == FALSE)
+ break;
+ if (($fp = @fopen(PROXY_PATH."/".$this->sess.".step", 'w')) == FALSE)
+ break;
+ fwrite($fp, pack("l",$this->step), 4);
+ fclose($fp);
+
+ return (TRUE);
+ } while (0);
+
+ return (FALSE);
+ }
+
+ function step_inc() {
+ $this->step++;
+
+ if (validate_sess($this->sess)) {
+ $fp = fopen(PROXY_PATH."/".$this->sess.".step", 'w');
+ fwrite($fp, pack("l",$this->step), 4);
+ fclose($fp);
+
+ return (TRUE);
+ }
+
+ return (FALSE);
+ }
+}
+
+function step_get($sess) {
+ $fp = FALSE;
+ $ct = 0;
+ do {
+ if (validate_sess($sess) == FALSE)
+ break;
+ $ct = 1;
+ if (($fp = @fopen(PROXY_PATH."/".$sess.".step", 'rb')) == FALSE)
+ break;
+ $ct = 2;
+ if (($s = fread($fp, 4)) == FALSE)
+ break;
+ $ct = 3;
+ if (strlen($s) != 4)
+ break;
+ $ct = 4;
+ $arr = unpack('l', $s);
+ fclose($fp);
+
+ // log_rd2($sess, "A0: ".$arr[0]." A1: ".$arr[1]);
+ return ($arr[1]);
+ } while (0);
+
+ if ($fp != FALSE)
+ fclose($fp);
+
+ log_rd2($sess, "STEP_GET: return false ".$ct);
+ return (FALSE);