Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34068

chat daemon not sending response headers to browser. Breaks Firefox

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.18, 2.2, 2.2.5, 2.3.2, 2.4
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Chat
    • Labels:
    • Testing Instructions:
      Hide

      This issue must be tested with MDL-27398 integrated and with different browsers (the issue was reported with FireFox)

      1. In Admin tree -> Plugins -> Activity modules -> Chat, select "Chat server daemon" as chat method
      2. Go to a course and create a chat activity instance
      3. Go to the chat instance and follow "Click here to enter the chat now"
      4. You SHOULD be able to see a popup divided in 3 parts, you SHOULD NOT see as plain text (with HTML tags) in the upper-left side, you SHOULD see the user picture
      Show
      This issue must be tested with MDL-27398 integrated and with different browsers (the issue was reported with FireFox) In Admin tree -> Plugins -> Activity modules -> Chat, select "Chat server daemon" as chat method Go to a course and create a chat activity instance Go to the chat instance and follow "Click here to enter the chat now" You SHOULD be able to see a popup divided in 3 parts, you SHOULD NOT see as plain text (with HTML tags) in the upper-left side, you SHOULD see the user picture
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-34068_master

      Description

      When you run the chat daemon, which uses a frameset, the main chat area, (where messages appear, i.e., win=chat) does not send out a response header. Proper response headers are sent for the sidekick frames (message, beep, and user). The user sees the underlying html exposed in Firefox. Firefox treats the output in quirks mode and as text/plain not text/html. IE Chrome appear to be more forgiving.

      I tracked this down using Fiddler, Firefox' Live Headers add-on and by looking at the Firefox cache (about:cache).

      As a partial fix, I added an HTTP response block beginning on line 532 of chatd.php. However, this may cause some of the sidebars to send the header response twice.

      chatd.php

      $this->dismiss_half($sessionid, false);
       
              // new block begins here
       
              $header  = "HTTP/1.1 200 OK\n";
              $header .= "Date: ".date('r')."\n";
              $header .= "Server: Moodle\n";
              $header .= "Content-Type: text/html; charset=utf-8\n";
              $header .= "Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT\n";
              $header .= "Cache-Control: no-cache, must-revalidate\n";
              $header .= "Expires: Wed, 4 Oct 1978 09:32:45 GMT\n";
              $header .= "\n";
              $this->write_data($this->conn_sets[$sessionid][CHAT_CONNECTION_CHANNEL], $header);
       
              // new block ends here
       
              $this->write_data($this->conn_sets[$sessionid][CHAT_CONNECTION_CHANNEL], $CHAT_HTMLHEAD_JS);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dmonllao David Monllaó
              Reporter:
              pkissman Paul Kissman
              Peer reviewer:
              Rossiani Wijaya
              Integrator:
              Aparup Banerjee
              Tester:
              Ankit Agarwal
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Nov/12