• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

IE problems with handleRequest

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
29 posts • Page 1 of 2 • 1, 2

Postby bcc » Fri Oct 06, 2006 7:05 pm

Sometimes, IE6 does not send the parameters when POSTing the chat page. It does not send any parameters (or values), such as handleRequest. As a result, the xml response contains the whole html of the chat page, as if it were a regular request.

I don't know how to reproduce the problem, but if I leave IE running for a while, it happens quite often.


Can anyone else confirm it?
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby bcc » Sat Oct 14, 2006 3:20 pm

I had it confirmed by several people. At some point, IE doesn't make a proper request and everything gets screwed up.
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Sat Oct 14, 2006 9:40 pm

It's a bad news for IE6 users ... if it's not reproducable I don't know how to handle this problem.
Moreover, did you encounter the problem on the official demo page ? Maybe it's related to the server configuration ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bcc » Sat Oct 14, 2006 10:21 pm

Hmm, good idea. I'll let it run for a while on the demo page.
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby bcc » Sat Oct 14, 2006 11:28 pm

I'm running a test now, and not seeing any problems.
Could it be due to slow connections?
For example, if the previous ajax request haven't been completed yet, and it's already time to make the next call. Is there a mechanism to synchronize them?
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Sun Oct 15, 2006 7:29 pm

bcc wrote:For example, if the previous ajax request haven't been completed yet, and it's already time to make the next call. Is there a mechanism to synchronize them?

Yes, maybe it should be possible to block next http requests since the last one is not finished.
I will look at this and try to implement something.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bcc » Sun Oct 15, 2006 8:50 pm

I could not reproduce the problem with the demo on this site.
But now, I changed register_globals to off, and I'm no longer having problems with IE.

Could that have any effect or am I just imagining things?
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby bcc » Wed Oct 18, 2006 9:02 pm

Also, IE doesn't handle caching properly. So that all images that are loaded in style background or by dynamically adding elements to the dom get fetched multiple times.

As a result, user.gif and newmsg.gif are reqeusted from the server many times on the first page load.
It's not the PFC's problem, but I just thought I would mention it.

It's especially bad when you have 150 messages displayed in a buffer when the new visitor logs in.
Last edited by bcc on Wed Oct 18, 2006 9:02 pm, edited 1 time in total.
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby bcc » Wed Oct 18, 2006 9:22 pm

In pfcclient.js, on line 731
// adjust the refresh_delay if the connection was lost
if (res == false) { this.refresh_delay = this.refresh_delay * 2; }

Does that keep increasing the interval every time a request is not returned?

Wouldn't that eventually make refresh rate something huge if there are some intermittent connection problems?

If that the case, is it possible to add a max_refresh_delay parameter to limit it?
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Wed Oct 18, 2006 9:24 pm

Humm maybe this could be fixed with a better scr/client/proxy.php.tpl implementation... I have a very little knowledge in HTTP headers but it should possible to indicate that the file should not be downloaded again as long as a date is not expired.
I think, an optimisation is possible in this proxy.php file.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bcc » Wed Oct 18, 2006 9:44 pm

Would something like this work for synchronization?

Code: Select all
Index: src/client/pfcclient.js
===================================================================
--- src/client/pfcclient.js     (revision 2049)
+++ src/client/pfcclient.js     (working copy)
@@ -1,6 +1,7 @@
 var is_ie = navigator.appName.match("Explorer");
 var is_khtml = navigator.appName.match("Konqueror") || navigator.appVersion.match("KHTML");
 var is_ff = navigator.appName.match("Netscape");
+var is_update_request_pending=false;

 /**
  * This class is the client part of phpFreeChat
@@ -716,7 +717,19 @@
     var req = cmd+" "+this.clientid+" "+(recipientid==''?'0':recipientid)+(param?" "+param : "");
     if (pfc_debug)
       if (cmd != "/update") alert(req);
-    return eval('pfc_handleRequest(req);');
+       var retVal=null;
+       if (cmd == "/update"){
+               if(is_update_request_pending){
+                       retVal = true;
+               } else {
+                       is_update_request_pending = true;
+                       retVal = eval('pfc_handleRequest(req);');
+                       is_update_request_pending = false;
+               }
+       } else {
+       retVal = eval('pfc_handleRequest(req);');
+       }
+    return retVal;
   },

   /**

Is "/update" only called in one place?

It doesn't help when the client tries to send some other command at the same time as update is happening, but I guess it's better than nothing.

Also, with many channels, that might create some problems.

But I do think that IE problems I'm noticing are due to multiple requests being sent at the same time and IE not handling them properly (especially over the same TCP connection).

I increased the refresh rate to 7 seconds and my server's keep-alive is 5 seconds. And that alone made a lot of users stop complaining. And a few actually e-mailed me to tell me that things are much better.
Last edited by bcc on Wed Oct 18, 2006 9:50 pm, edited 1 time in total.
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Wed Oct 18, 2006 9:54 pm

I've allready done some work on the /update synchronization, it's commited in the subversion.

However I think your code is useless because this line :
retVal = eval('pfc_handleRequest(req);');
will return before the request is sent (because it's asynchronous requests)

Maybe I'm wrong but I doubt...
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby phpfreechat » Wed Oct 18, 2006 9:57 pm

here is the patch I've written to avoid /update command to overlap :
http://svn.sourceforge.net/viewvc/phpfr ... athrev=833
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bcc » Wed Oct 18, 2006 10:15 pm

However I think your code is useless because this line :

Oh yeah, I didn't actually look at the eval itself. I just assumed it's a normal function call.
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby bcc » Wed Oct 18, 2006 10:29 pm

With you patch, what happens if resposne is not "ok" after the canupdatenexttime is set to false? What happens on the next interval and a call for update?

It seems like it would stop updating for that point on. No?
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Next

Post a reply
29 posts • Page 1 of 2 • 1, 2

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 23 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub