• 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

Disconnect in 1-2 minutes

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

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

Postby a3093 » Thu May 01, 2008 11:16 am

We having problem, with the timeout. This is a problem, user's cannot type in the chatroom, because they are idle in the long period of time (ex 1-2 minutes or so)

POST:
pfc_ajax=1&f=handleRequest&cmd=%2Fconnect%20da326533cb9ff71947c477fc35164d24%202fae3120275de71ee16be96f2b6de29b%20
RESPONSE:
pfc.handleResponse('nick', 'connected', 'myuser');
pfc.handleResponse('join', 'ok', Array('2fae3120275de71ee16be96f2b6de29b','mychat'));
pfc.handleResponse('connect', 'ok', Array(''));
pfc.handleResponse('update', 'ok', '');

POST:
pfc_ajax=1&f=handleRequest&cmd=%2Fupdate%20da326533cb9ff71947c477fc35164d24%202fae3120275de71ee16be96f2b6de29b%20 [641 ms]
RESPONSE:
pfc.handleResponse('whois2', 'ok', {"ip":"80.00.00.5","isadmin":"1","floodtime":"1209634661","flood_nbmsg":"","flood_nbchar":"","nick":"myuser","nickid":"d1a1cf2192e0ce637f2f16d4ee491d1f"});
pfc.handleResponse('update', 'ok', '');

POST:
pfc_ajax=1&f=handleRequest&cmd=%2Fupdate%20da326533cb9ff71947c477fc35164d24%202fae3120275de71ee16be96f2b6de29b%20 [703 ms]
RESPONSE:
pfc.handleResponse('update', 'ok', '');
...
...
[1 min - 2 min]
...
...
POST:
pfc_ajax=1&f=handleRequest&cmd=%2Fupdate%20da326533cb9ff71947c477fc35164d24%202fae3120275de71ee16be96f2b6de29b%20 [894 ms]
RESPONSE:
pfc.handleResponse('update', 'ok', '');

POST:
pfc_ajax=1&f=handleRequest&cmd=%2Fupdate%20da326533cb9ff71947c477fc35164d24%202fae3120275de71ee16be96f2b6de29b%20 [1232 ms]
RESPONSE:
pfc.setError('Debes estar conectado para enviar un mensaje', Array());
a3093
Member
 
Posts: 12
Joined: Sat Apr 19, 2008 10:33 pm
Location: Las Palmas de GC (spain)
Top

Postby permutations » Sun May 04, 2008 1:31 pm

I have the same problem with timing out. But what are those post/response values you're sending?

When the user is disconnected, the "Connect" button is still enabled. Sometimes typing /quit and /connect will get things working. Other times, that won't restore all the settings (like typing color) and you have to reload the chatbox completely.

Is the developer aware of this bug? Does anyone have a fix?
Last edited by permutations on Sun May 04, 2008 1:40 pm, edited 1 time in total.
permutations
Member
 
Posts: 88
Joined: Thu Apr 24, 2008 1:09 pm
Top

Postby permutations » Sun May 04, 2008 1:54 pm

I think this message may describe the cause of the problem and the fix:

http://www.phpfreechat.net/forum/viewtopic.php?pid=9711
permutations
Member
 
Posts: 88
Joined: Thu Apr 24, 2008 1:09 pm
Top

Postby a3093 » Mon May 05, 2008 11:08 am

permutations wrote:I have the same problem with timing out. But what are those post/response values you're sending?

It is obtained from the extension of firefox FireBug. It is very good.
a3093
Member
 
Posts: 12
Joined: Sat Apr 19, 2008 10:33 pm
Location: Las Palmas de GC (spain)
Top

Postby a3093 » Mon May 05, 2008 11:20 am

My problem is:

http://sourceforge.net/tracker/index.ph ... tid=809601

and there isn't solution yet :(
a3093
Member
 
Posts: 12
Joined: Sat Apr 19, 2008 10:33 pm
Location: Las Palmas de GC (spain)
Top

Postby phpfreechat » Mon May 05, 2008 1:27 pm

a3093, could you try to change the timeout value of your chat, to this :
$params["timeout"] = 35000;

(dont forget to rehash the chat)
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby a3093 » Mon May 05, 2008 8:58 pm

Hello Kerphi,

I found the bug, but not how to solve.

The file: dataprivatechats_d7c4......f57afchannelid-to-nickidSERVER74808bec........565

is unable to update the date.



In the file: pfccontainer.class.php in the function: removeObsoleteNick there is this line:

if (time() > ($timestamp+$timeout/1000) && $nickid) // user will be disconnected after 'timeout' secondes of inactivity

And its variables are:

time: 1210015962 timestamp: 1210015931 + timeout: 60000 /1000
time: 1210015967 timestamp: 1210015931 + timeout: 60000 /1000
time: 1210015972 timestamp: 1210015931 + timeout: 60000 /1000
time: 1210015977 timestamp: 1210015931 + timeout: 60000 /1000
time: 1210015982 timestamp: 1210015931 + timeout: 60000 /1000
time: 1210015987 timestamp: 1210015931 + timeout: 60000 /1000
time: 1210015992 timestamp: 1210015931 + timeout: 60000 /1000

the timestamp no update!
Last edited by a3093 on Mon May 05, 2008 8:58 pm, edited 1 time in total.
a3093
Member
 
Posts: 12
Joined: Sat Apr 19, 2008 10:33 pm
Location: Las Palmas de GC (spain)
Top

Postby a3093 » Mon May 05, 2008 11:43 pm

and I found the problem.... I think.

FILE: src/containers/file.class.php

Function: setMeta

Original Code:
Code: Select all
 if ($leafvalue == NULL)
    {
     file_put_contents($leaffilename, '', LOCK_EX);
    }
    else
    {
     file_put_contents($leaffilename, $leafvalue, LOCK_EX);
    }

New Code:
Code: Select all
 if ($leafvalue == NULL)
{

    // BAD
    //file_put_contents($leaffilename, '', LOCK_EX);

    // CORRECT
    $file=fopen($leaffilename,"w");
    fwrite($file,time()." rn");
    fclose($file);
}
else
{
    //BAD
    //file_put_contents($leaffilename, $leafvalue, LOCK_EX);

    // CORRECT
    $file=fopen($leaffilename,"w");
    fwrite($file,$leafvalue);
    fclose($file);
}

parameters: (approximately)
$params["refresh_delay"]=5000;
$params["timeout"]=600000;
Last edited by a3093 on Mon May 05, 2008 11:48 pm, edited 1 time in total.
a3093
Member
 
Posts: 12
Joined: Sat Apr 19, 2008 10:33 pm
Location: Las Palmas de GC (spain)
Top

Postby phpfreechat » Tue May 06, 2008 8:58 am

a3093, the LOCK_EX flag is important. It allows concurrent access on the same file.
If you remove this flag, the chat internal files could be corrupted.

Moreover, I don't understand the logic of your patch. Functionally it does exactly the same as before.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby a3093 » Tue May 06, 2008 10:40 am

The problem is that the instruction

file_put_contents($leaffilename, '', LOCK_EX);


do not write anything in the file, does not modify it and possibly that's why so the server does not update the date. Possibly be solved by simply write anything in the file. For example:

file_put_contents ($ leaffilename, time (), LOCK_EX);
a3093
Member
 
Posts: 12
Joined: Sat Apr 19, 2008 10:33 pm
Location: Las Palmas de GC (spain)
Top

Postby cls » Tue May 06, 2008 11:27 am

Hmm, I don't know, if

Code: Select all
file_put_contents($leaffilename, '', LOCK_EX);

is needed to create the file at this point.

Perhaps it helps, if you add

Code: Select all
touch($leaffilename);

after this line.
cls
Member
 
Posts: 57
Joined: Sat Aug 18, 2007 10:29 pm
Location: Germany
  • Website
Top

Postby phpfreechat » Tue May 06, 2008 1:01 pm

Ok, so according to cls's and your idea, could you try this patch ?
Code: Select all
Index: containers/file.class.php
===================================================================
--- containers/file.class.php   (révision 1238)
+++ containers/file.class.php   (copie de travail)
@@ -99,7 +99,7 @@
     $leafexists = file_exists($leaffilename);
     if ($leafvalue == NULL)
     {
-       file_put_contents($leaffilename, '', LOCK_EX);
+      touch($leaffilename);
     }
     else
     {

Please keep me informed if it fixes the problem and I'll commit the patch on the official source code.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby a3093 » Tue May 06, 2008 7:03 pm

It is OK
a3093
Member
 
Posts: 12
Joined: Sat Apr 19, 2008 10:33 pm
Location: Las Palmas de GC (spain)
Top

Postby kswift » Wed May 07, 2008 11:40 am

It still gives me the same errors here (you need to be logged in...). Though they seem to come less frequent? Not sure, still running the patch.
kswift
New member
 
Posts: 2
Joined: Tue May 06, 2008 4:54 pm
Top

Postby Brazo » Fri May 09, 2008 12:11 pm

thank you

this post solves an identical problem on my server !!!

*thumbs up*
Brazo
New member
 
Posts: 2
Joined: Wed Apr 30, 2008 4:53 pm
Top

Next

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

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 6 guests

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