add check for old page_id on new transport socket (server-side)
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 19 Apr 2020 09:32:27 +0000 (11:32 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 19 Apr 2020 09:32:27 +0000 (11:32 +0200)
TODO.txt
web/Obj/brisk.phh

index a7aa3be..dd55942 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -4,7 +4,8 @@
 page_id =>
   - add page_id to both index.php pages (WIP)
   DONE - add page_id to user class
-  - pass page_id to transport (WIP)
+  DONE - pass page_id to transport (WIP)
+  - manage server-side page_id in transport channel
   - manage index_rd
   - manage page to stop transport retry
 
index 5238b13..0914818 100644 (file)
@@ -2786,15 +2786,21 @@ class Brisk
 
           do {
               if (!isset($cookie['sess'])
-                  || (($user = $this->get_user($cookie['sess'], $idx)) == FALSE)) {
+                  || (($user = $this->get_user($cookie['sess'], $idx)) == FALSE)
+                  || $user->page_id != $get['page_id']) {
 
-                  $content = User::stream_fini($transp, $s_a_p->rndstr, TRUE);
+                  $content = "";
+                  if ($user->page_id != $get['page_id']) {
+                      $content += "OLD_PAGE";
+                  }
+                  $content += User::stream_fini($transp, $s_a_p->rndstr, TRUE);
 
                   $s_a_p->pendpage_try_addflush($new_socket, 20, $enc, $header_out, $content);
                   return TRUE;
 
                   break;
               }
+
               $this->sess_cur_set($user->sess);
               // close a previous opened index_read_ifra socket, if exists
               if (($prev = $user->rd_socket_get()) != NULL) {