From: Matteo Nastasi (mop) Date: Wed, 8 Oct 2014 17:05:36 +0000 (+0200) Subject: Merge branch 'curls' into curl-out-reason X-Git-Tag: v4.15.0~4 X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=aa1fa37d0bd35d6f8d7b55ec1a6a92140f4ce9e0;hp=ac58e12ad31f22ad17c964ad3a36d10390c3dbe3;p=brisk.git Merge branch 'curls' into curl-out-reason --- diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index ef65115..e4e020d 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -874,6 +874,13 @@ class Sac_a_push { $id = intval($sock); if (isset($this->s2u[$id])) { $user = $this->s2u[$id]; + + if ($user->rd_toflush) { + if (fflush($sock) == FALSE) + continue; + else + $user->rd_toflush = FALSE; + } $response = $user->rd_cache_get(); $do_ping = FALSE; if (($this->curtime - $user->lacc) > (EXPIRE_TIME_RD / 3)) { @@ -911,7 +918,10 @@ class Sac_a_push { else { $user->rd_cache_set(""); } - fflush($sock); + if (fflush($sock) == FALSE) { + $user->rd_toflush = TRUE; + continue; + } $user->rd_kalive_reset($this->curtime); } diff --git a/web/Obj/user.phh b/web/Obj/user.phh index b3cbf51..6cdb1fe 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -129,6 +129,7 @@ class User { var $rd_scristp; // current script step (for each session) var $rd_kalive; // if no message are sent after RD_KEEPALIVE_TOUT secs we send a keepalive from server var $rd_cache; // place where store failed fwrite data + var $rd_toflush; // bool to inform about unfflushed socket var $rd_zls; // zlibstream object handle if compressed stream, else FALSE var $rd_transp; // class that define stream encapsulation type (iframe, xhr, ...) var $rd_is_chunked; // is the transport chunked or not ? @@ -190,6 +191,7 @@ class User { $thiz->rd_scristp = -1; $thiz->rd_kalive = -1; $thiz->rd_cache = ""; + $thiz->td_toflush = FALSE; $thiz->rd_zls = FALSE; $thiz->rd_transp = NULL; $thiz->rd_is_chunked = FALSE;