X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2FObj%2Fsac-a-push.phh;h=77c3496779b00047a3d8586e1bf933d5bc452900;hb=3a37e89b6c987fe6d85561e3b8ee72cfa6ad78cc;hp=10f4f70a57a48278ab3fdaeb060ff1e1c4df9def;hpb=8b0992347fdfdb40715268bb07481d35fc5191fb;p=brisk.git diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index 10f4f70..77c3496 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -896,6 +896,12 @@ class Sac_a_push { // fprintf(STDERR, "Arrivati %d bytes dalla socket n. %d\n", mb_strlen($buf, "ASCII"), $key); if (isset($this->s2u[$id])) { + // + // TODO: + // fix $addr + // fix $this->pendpage_try_addflush below (probably not required) + // + $addr = "127.0.0.1"; $user = $this->s2u[$id]; // fprintf(STDERR, 'POST USER'); @@ -904,33 +910,50 @@ class Sac_a_push { $clie_cmd = json_decode($clie_cmd, TRUE); // fprintf(STDERR, "HERE WE ARE INCOMING DATA [%s]\n", print_r($clie_cmd, TRUE)); - ob_start(); - // complete: index_wr_main($this->app, $addr, $get, $post, $cookie); - index_wr_main($this->app, $addr, $clie_cmd, NULL, NULL); - $content = ob_get_contents(); - ob_end_clean(); - - // $this->pendpage_try_addflush($new_socket, 20, $enc, $header_out, $content); - // FIXME ^ - // fprintf(STDERR, "RETURNED CONTENT [%s]\n", $content); + $wr_addr = substr(parse_url($clie_cmd["target"])["path"], strlen(SITE_PREFIX)); + if ($wr_addr == "index_wr.php") { + ob_start(); + // complete: index_wr_main($this->app, $addr, $get, $post, $cookie); + index_wr_main($this->app, $addr, $clie_cmd, NULL, NULL); + $content = ob_get_contents(); + ob_end_clean(); + } + else if ($wr_addr == "briskin5/index_wr.php") { + $table_idx = $clie_cmd['table_idx']; + $table_token = $clie_cmd['table_token']; + + if (($bri = $this->app->match_get($table_idx, $table_token)) != FALSE) { + ob_start(); + bin5_index_wr_main($bri, $addr, $clie_cmd, NULL, NULL); + $content = ob_get_contents(); + ob_end_clean(); + } + } + /* + briskin5/index_wr.php + + if (isset($table_idx) && isset($table_token)) { + if (($bri = $s_a_p->app->match_get($table_idx, $table_token)) != FALSE) { + ob_start(); + bin5_index_wr_main($bri, $addr, $get, $post, $cookie); + $content = ob_get_contents(); + ob_end_clean(); + } + else { + $content = "Bin5 Load data error"; + } + } + else { + $content = "Bin5 Load data error"; + } + $s_a_p->pendpage_try_addflush($new_socket, 20, $enc, $header_out, $content); + */ } } else { fprintf(STDERR, "User associated with ID: %s not found\n", $id); } - if (isset($this->s2u[$id])) { - $user = $this->s2u[$id]; - - fprintf(STDERR, 'POST USER'); - if ($user && $user->rd_transp && strpos($user->rd_transp->type, "websocket") !== FALSE) { - fprintf(STDERR, "HERE WE ARE INCOMING DATA [%s]\n", $user->rd_transp->deframe($buf)); - - } - } - else { - fprintf(STDERR, "REC ID: %s\n", $id); - } if (isset($this->s2p[$id])) { $this->s2p[$id]->rest -= mb_strlen($buf, "ASCII"); $this->s2p[$id]->cont .= $buf;