See http://thedailywtf.com/forums/65091/ShowPost.aspx for more information
Below is the code written by the kind-hearted programmer. I have translated the comments of the Code into Chinese, which is very ethical.
/*
* This code is very bad. It's really bad. I sincerely admit that my code is very bad. If you are an intertrode communication company
. I am very sorry that you have to maintain this code. I plan to rewrite this code tomorrow, but I am very forgetful. I often
* Forget the code I wrote. For example, this code is the product of my amnesia.
*
* The ins and outs of things are like this. I cannot remember why the value of accountid (account number) is not set.
* I checked the code again. I just don't understand. Now I have to leave. Fortunately, I found that the debugging record (debugging
* Log) to capture the accountid. Maybe the problem is solved in this way. Find out when accountid is cleared
* It's up to you, dude.
*
* Finally, please accept my sincere apologies again
*/
1 If (accountid = NULL) | (accountid = "") |
2 (serversesion ["accountid"] = NULL) | (serversesion ["accountid"] = ""))
3 {
4 // open session logs
5 filehandle file = f_open (log_path + "\ sessionlog-" + log_file_date + ". log", 1 );
6 While (file! = NULL)
7 {
8
9 tstring line = f_readline (File );
10
11 // look for IP and changereg
12 if (Sfind (line, remote_addr )! =-1) & (Sfind (line, "changereg ")! =-1 ))
13 {
14 // 0000-00-00/accountmaint/changereg /? Accountid = 123456 255.255.255.255.255
15 //*
16 accountid = substr (line, 52, 6 );
17}
18
19 if (f_eof (File) {f_close (File); file = NULL ;}
20}
21
22}