Cannot unsuspend despite on 2'nd warning !

Status
Not open for further replies.

eternal1

New Member
Messages
15
Reaction score
0
Points
0
So I was in the process understanding a few things about the post function in the smf forum software so I could write a mod providing a certain poster privileged functionality. Anyway I just started (like I do always) by writing out a certain variable in the index.php script. I guess I shouldn't have return;ed immediately, or shouldn't have done a while(1){} (sorry about that, I wasn't thinking about the server..) ? I'd like to know for general future purposes (I wasn't aware resources needed to be freed, if the former case was the trouble maker and not the latter, the while() loop, that is), what was the exact cause for the "non-applicable" suspension ?

Am I permanently suspended now ? if so, how do I get some files from the server ? I haven't saved some updates locally.
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
You don't appear to be suspended currently.
 

eternal1

New Member
Messages
15
Reaction score
0
Points
0
I can login to the FTP server now and access my files, but couldn't before.
The forum however remains inaccessible, for me at least.
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
I can visit your main page without a problem. If you have another page other than that with a problem, if you have a link I can investigate as I don't have access to that information.
 

eternal1

New Member
Messages
15
Reaction score
0
Points
0
I can access the main page and the forum now, but had tremendous problems with FTP, can login to FTP too now, at least on and off, and very slowly.

-edit-

I'd still like to know what the exact reason for the suspension was though. If I don't get the reason I won't dare to research my forum mod :(
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
There may be server maintenance or an issue with your server at the moment. If you continue to have a problem with your account being slow, please post back here in the forums and someone will be able to look into the problem further.
 

eternal1

New Member
Messages
15
Reaction score
0
Points
0
Thanks for the replies garretroyce !

Turns out my second suspension with the second warning related to the index page containing this non-removed aforementioned while(1){} loop:

Code:
echo $_REQUEST['message'] . '<br/>';
 while(1){}

Which I thought I had changed to:

Code:
if ($_REQUEST['action'] == 'post2')
{
echo $_REQUEST['message'] . '<br/>';
return;
}

Does anyone have any clue if I dare to update the forum index page and do another test ? are there any resources allocated by the server that needs to be freed by the script before returning (I have a hard time believing this) ?
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
I wouldn't worry too much about freeing resources, as PHP does this very well on it's own. If you were to do something like creating hundreds of file handles (using fopen() and etc) all at the same time without closing any, that would be an issue.

If you're going to use an infinite loop for testing, I have 2 suggestions for you.

1. Provide a way to kill the process. A very easy way to do this is to have the script check for a predetermined file to break the loop:

Code:
while (true) {
  if (is_file('./kill.txt')) {
    break;
  }

2. Lower CPU usage by sleeping
Code:
while (true) {
  usleep(100000); // wait 0.01s before doing anything else
}

I'm writing a script that opens hundreds of file handles and uses huge amounts of resources. It puts my home computer over 60% CPU without the usleep but only 5% using that same exact line. I also close the file handles manually every time through the loop, just to make sure they're not building up needlessly.
 

Mr. DOS

Member
Messages
230
Reaction score
5
Points
18
You might also want to do development locally using something like xampp. Not only is the testing cycle faster because you can edit scripts right off the machine they're run on, but you don't have to worry about a script going haywire and blowing up your account.

--- Mr. DOS
 
Status
Not open for further replies.
Top