Loading ...
Sorry, an error occurred while loading the content.

Is only my $Response->Flush() broken ?

Expand Messages
  • Szymon Juraszczyk
    Hi, I ve got serious problems with $Response- Flush() function. I searched discussion forums and found quite lots of references regarding this issue. However,
    Message 1 of 7 , Dec 23, 2001
    • 0 Attachment
      Hi,

      I've got serious problems with $Response->Flush() function. I searched
      discussion forums and found quite lots of references regarding this issue.
      However, using brand new Apache::ASP 2.29 and struggling all day long I
      still can't make this bloody function work.

      Any suggestions?

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Joshua Chamas
      ... How does the http://www.apache-asp.org/eg/register_cleanup.asp script work for you? Under IE & Netscape, I see the ... render one line at a time. This is
      Message 2 of 7 , Dec 23, 2001
      • 0 Attachment
        Szymon Juraszczyk wrote:
        >
        > Hi,
        >
        > I've got serious problems with $Response->Flush() function. I searched
        > discussion forums and found quite lots of references regarding this issue.
        > However, using brand new Apache::ASP 2.29 and struggling all day long I
        > still can't make this bloody function work.
        >

        How does the http://www.apache-asp.org/eg/register_cleanup.asp
        script work for you? Under IE & Netscape, I see the ... render
        one line at a time. This is as a result of $Response->Flush().
        This script is the same as ./site/eg/register_cleanup.asp in
        the distribution.

        $Response->Flush is explicitly disabled in XMLSubs, since the
        content must be passed into the XMLSubs for processing, but
        otherwise it should work fine.

        If you really get stuck, send a bit of script where you can't
        get $Response->Flush to work & I'll check it out.

        --Josh
        _________________________________________________________________
        Joshua Chamas Chamas Enterprises Inc.
        NodeWorks Founder Huntington Beach, CA USA
        http://www.nodeworks.com 1-714-625-4051

        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • Szymon Juraszczyk
        ... It works fine for me too. ... I don t use XMLSubs. ... It s very simple: Write( Test
        Message 3 of 7 , Dec 23, 2001
        • 0 Attachment
          On Sun, 2001-12-23 at 20:01:04, Joshua Chamas wrote:

          > Szymon Juraszczyk wrote:
          > >
          > > Hi,
          > >
          > > I've got serious problems with $Response->Flush() function. I searched
          > > discussion forums and found quite lots of references regarding this issue.
          > > However, using brand new Apache::ASP 2.29 and struggling all day long I
          > > still can't make this bloody function work.
          > >
          >
          > How does the http://www.apache-asp.org/eg/register_cleanup.asp
          > script work for you? Under IE & Netscape, I see the ... render
          > one line at a time. This is as a result of $Response->Flush().
          > This script is the same as ./site/eg/register_cleanup.asp in
          > the distribution.

          It works fine for me too.

          > $Response->Flush is explicitly disabled in XMLSubs, since the
          > content must be passed into the XMLSubs for processing, but
          > otherwise it should work fine.

          I don't use XMLSubs.

          > If you really get stuck, send a bit of script where you can't
          > get $Response->Flush to work & I'll check it out.

          It's very simple:

          <html>
          <body>


          <%
          for (my $i = 1; $i <= 10; $i++) {
          $Response->Write("Test $i<br>\n");
          }

          $Response->Flush();

          sleep(10);

          $Response->Write("End<br>");
          %>

          </body>
          </html>

          I suspect that mod-perl is buffering something. Your code does
          $Response->{'r'}->print() in Flush() - I checked that. Maybe my
          modperl-enabled Apache is kind of lame? I use apache-perl-1.3.22-2-1.26-3
          Debian package.

          Regards,
          --
          Szymon Juraszczyk, szymon@...
          Surfland Computer Systems S.A.
          tel. +48 71 78-02-952, http://www.ssk.com.pl/

          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        • Joshua Chamas
          ... This should work. What if you put the Flush() in the for loop. I wonder whether your browser needs to see more than one flush to start rendering. My
          Message 4 of 7 , Dec 23, 2001
          • 0 Attachment
            Szymon Juraszczyk wrote:
            >
            > <html>
            > <body>
            >
            > <%
            > for (my $i = 1; $i <= 10; $i++) {
            > $Response->Write("Test $i<br>\n");
            > }
            >
            > $Response->Flush();
            >
            > sleep(10);
            >
            > $Response->Write("End<br>");
            > %>
            >
            > </body>
            > </html>
            >
            > I suspect that mod-perl is buffering something. Your code does
            > $Response->{'r'}->print() in Flush() - I checked that. Maybe my
            > modperl-enabled Apache is kind of lame? I use apache-perl-1.3.22-2-1.26-3
            > Debian package.
            >

            This should work. What if you put the Flush() in the for loop.
            I wonder whether your browser needs to see more than one flush
            to start rendering.

            My latest apache's that I have used for my own servers are 1.3.14 & 1.3.20,
            & mod_perl 1.25 on the 1.3.20 server, I don't know for the other.
            I have heard users complaining with 1.26 before, so might try downgrading
            my mod_perl & recompiling. You can also try this:

            # global.asa
            sub Script_OnFlush { Apache->request->rflush() }

            The routine might be Apache->request->flush(), I can't remember,
            and it doesn't seem to be documented. Apache::ASP when flushing
            uses $| = 1, combined with Apache->request->print to do its flushing
            which might be broken on your version (?).

            Whatever ends up being your fix for this, please post your solution
            to the list.

            Thanks,

            Josh

            _________________________________________________________________
            Joshua Chamas Chamas Enterprises Inc.
            NodeWorks Founder Huntington Beach, CA USA
            http://www.nodeworks.com 1-714-625-4051

            ---------------------------------------------------------------------
            To unsubscribe, e-mail: asp-unsubscribe@...
            For additional commands, e-mail: asp-help@...
          • Szymon Juraszczyk
            On Sun, 2001-12-23 at 20:36:20, Joshua Chamas wrote: [ ... ] ... It doesn t help. ... +++
            Message 5 of 7 , Dec 26, 2001
            • 0 Attachment
              On Sun, 2001-12-23 at 20:36:20, Joshua Chamas wrote:

              [ ... ]
              > > I suspect that mod-perl is buffering something. Your code does
              > > $Response->{'r'}->print() in Flush() - I checked that. Maybe my
              > > modperl-enabled Apache is kind of lame? I use apache-perl-1.3.22-2-1.26-3
              > > Debian package.
              > >
              >
              > This should work. What if you put the Flush() in the for loop.
              > I wonder whether your browser needs to see more than one flush
              > to start rendering.
              >
              > My latest apache's that I have used for my own servers are 1.3.14 & 1.3.20,
              > & mod_perl 1.25 on the 1.3.20 server, I don't know for the other.
              > I have heard users complaining with 1.26 before, so might try downgrading
              > my mod_perl & recompiling. You can also try this:
              >
              > # global.asa
              > sub Script_OnFlush { Apache->request->rflush() }

              It doesn't help.

              > The routine might be Apache->request->flush(), I can't remember,
              > and it doesn't seem to be documented. Apache::ASP when flushing
              > uses $| = 1, combined with Apache->request->print to do its flushing
              > which might be broken on your version (?).
              >
              > Whatever ends up being your fix for this, please post your solution
              > to the list.

              I even tried to patch mod-perl with following patch:

              --- apache-perl-1.3.22-2-1.26/libapache-mod-perl-1.26/src/modules/perl/Apache.xs
              +++ apache-perl-1.3.22-2-1.26/libapache-mod-perl-1.26/src/modules/perl/Apache.xs Wed Dec 26 17:17:10 2001
              @@ -1139,12 +1139,10 @@
              #else
              (void)(*CvXSUB(cv))(aTHXo_ cv); /* &Apache::write_client; */
              #endif
              -
              - if(IoFLAGS(GvIOp(defoutgv)) & IOf_FLUSH) /* if $| != 0; */
              #if MODULE_MAGIC_NUMBER >= 19970103
              - rflush(r);
              + rflush(r);
              #else
              - bflush(r->connection->client);
              + bflush(r->connection->client);
              #endif
              kill_timeout(r);
              }


              but it did not help, either. Unfortunately package dependencies in my
              Debian box do not allow me to downgrade to historic Apache's versions. I
              hope there'll be a way to make this work in 1.3.22/1.26...

              Regards,
              --
              Szymon Juraszczyk, szymon@...
              Surfland Computer Systems S.A.
              tel. +48 71 78-02-952, http://www.ssk.com.pl/

              ---------------------------------------------------------------------
              To unsubscribe, e-mail: asp-unsubscribe@...
              For additional commands, e-mail: asp-help@...
            • Joshua Chamas
              ... Did you ever try the example ./site/eg/register_cleanup.asp from the Apache::ASP distribution on your system? If it works, then flushing might not be
              Message 6 of 7 , Dec 26, 2001
              • 0 Attachment
                Szymon Juraszczyk wrote:
                >
                > On Sun, 2001-12-23 at 20:36:20, Joshua Chamas wrote:
                >
                > [ ... ]
                > > > I suspect that mod-perl is buffering something. Your code does
                > > > $Response->{'r'}->print() in Flush() - I checked that. Maybe my
                > > > modperl-enabled Apache is kind of lame? I use apache-perl-1.3.22-2-1.26-3
                > > > Debian package.
                > > >
                > >
                > > This should work. What if you put the Flush() in the for loop.
                > > I wonder whether your browser needs to see more than one flush
                > > to start rendering.
                > >

                Did you ever try the example ./site/eg/register_cleanup.asp from
                the Apache::ASP distribution on your system? If it works, then flushing
                might not be working because of your other script in particular, and this
                might help isolate the problem.

                Also, if you are using a web proxy front end to a mod_perl server
                which buffers output like mod_proxy in reverse proxy mode, then
                flushing will likely not work because your output gets buffered
                by the proxy server. If your mod_perl server is running on a high
                port like 8080, but you make requests to port 80, then you likely
                have this kind of configuration.

                There was recent talk on the mod_perl list of a module like mod_proxy
                called mod_accel which may pass output to the client as it gets
                flushed from the mod_perl server, so you might try this if you
                need Flush() to work, and you need the dual httpd config.

                --Josh
                _________________________________________________________________
                Joshua Chamas Chamas Enterprises Inc.
                NodeWorks Founder Huntington Beach, CA USA
                http://www.nodeworks.com 1-714-625-4051

                ---------------------------------------------------------------------
                To unsubscribe, e-mail: asp-unsubscribe@...
                For additional commands, e-mail: asp-help@...
              • Szymon Juraszczyk
                ... You can imagine how I was supprised when I tried and found out that your example worked indeed!? Probably upgrading to the newest version of Apache::ASP
                Message 7 of 7 , Dec 26, 2001
                • 0 Attachment
                  On Wed, 2001-12-26 at 12:11:46, Joshua Chamas wrote:

                  > Szymon Juraszczyk wrote:
                  > >
                  > > On Sun, 2001-12-23 at 20:36:20, Joshua Chamas wrote:
                  > >
                  > > [ ... ]
                  > > > > I suspect that mod-perl is buffering something. Your code does
                  > > > > $Response->{'r'}->print() in Flush() - I checked that. Maybe my
                  > > > > modperl-enabled Apache is kind of lame? I use apache-perl-1.3.22-2-1.26-3
                  > > > > Debian package.
                  > > > >
                  > > >
                  > > > This should work. What if you put the Flush() in the for loop.
                  > > > I wonder whether your browser needs to see more than one flush
                  > > > to start rendering.
                  > > >
                  >
                  > Did you ever try the example ./site/eg/register_cleanup.asp from
                  > the Apache::ASP distribution on your system? If it works, then flushing
                  > might not be working because of your other script in particular, and this
                  > might help isolate the problem.

                  You can imagine how I was supprised when I tried and found out that your
                  example worked indeed!? Probably upgrading to the newest version of
                  Apache::ASP helped. I did not notice it started working, because depending
                  on the page contents, MSIE displays partial data or not. Links (a UNIS
                  text browser) works fine with my test now, too :-)

                  Thanks a lot for your help.

                  Regards,
                  --
                  Szymon Juraszczyk, szymon@...

                  ---------------------------------------------------------------------
                  To unsubscribe, e-mail: asp-unsubscribe@...
                  For additional commands, e-mail: asp-help@...
                Your message has been successfully submitted and would be delivered to recipients shortly.