+
+ 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;
+
+ if (validate_sess($this->sess)) {
+ $fp = fopen(PROXY_PATH."/".$this->sess.".step", 'w');
+ fwrite($fp, pack("l",$this->step), 4);
+ fclose($fp);
+ }
+ }
+
+ 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);
+ }
+ }
+}
+
+function step_get($sess) {
+ $fp = fopen(PROXY_PATH."/".$sess.".step", 'r');
+ $arr = unpack('l', fread($fp, 4));
+ fclose($fp);
+
+ // log_rd2($sess, "A0: ".$arr[0]." A1: ".$arr[1]);
+ return ($arr[1]);
+}
+
+function step_unproxy($sess) {
+ log_rd2($sess, "UNPROXY: ".PROXY_PATH."/".$sess.".step");
+ unlink(PROXY_PATH."/".$sess.".step");