Преглед изворни кода

- Added a func_parse invocation when an invalid socket is found, so that the underlying code (char/map/login) can handle it and free any related resources.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9587 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex пре 18 година
родитељ
комит
807acd0aac
2 измењених фајлова са 7 додато и 0 уклоњено
  1. 3 0
      Changelog-Trunk.txt
  2. 4 0
      src/common/socket.c

+ 3 - 0
Changelog-Trunk.txt

@@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/12/28
+	* Added a func_parse invocation when an invalid socket is found, so that
+	  the underlying code (char/map/login) can handle it and free any related
+	  resources.
 	* Added some skill effect packets so it displays a generic effect for
 	  unknown targetted skills.
 	* Some cleaning in do_sendrecv, added error messages when handling an

+ 4 - 0
src/common/socket.c

@@ -646,6 +646,10 @@ int do_sendrecv(int next)
 				if(h_errno == EBADF) //See the #defines at the top
 				{
 					ShowError("Deleting invalid session %d\n", i);
+				  	//So the code can react accordingly
+					session[i]->eof = 1;
+					if(session[i]->func_parse)
+						session[i]->func_parse(i);
 					free_session_mem(i); //free the bad session
 					continue;
 				}