فهرست منبع

!2 return preclose error_succeed first

chenliangyu 1 سال پیش
والد
کامیت
4922ce0d4b
2فایلهای تغییر یافته به همراه13 افزوده شده و 2 حذف شده
  1. 12 1
      Module/mod_chromium/CWebsocketServer.cpp
  2. 1 1
      Module/mod_chromium/mod_chromium.cpp

+ 12 - 1
Module/mod_chromium/CWebsocketServer.cpp

@@ -961,7 +961,18 @@ namespace Chromium {
 			}
 			catch (...)
 			{
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("exception in do_relink");
+				std::exception_ptr p = std::current_exception();
+				if (p) {
+					try {
+						std::rethrow_exception(p);
+					}
+					catch (const boost::thread_interrupted& e) {
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("thread interrupted");
+					}
+					catch (const std::exception& e) {
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("exception: %s", e.what());
+					}
+				}
 			}
 		}
 

+ 1 - 1
Module/mod_chromium/mod_chromium.cpp

@@ -1054,8 +1054,8 @@ namespace Chromium {
 	void CChromiumEntity::OnPreClose(EntityCloseCauseEnum eCloseCause, CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Chromium Run OnPreClose");
-		exitClean();
 		pTransactionContext->SendAnswer(Error_Succeed);
+		exitClean();
 	}
 
 	void CChromiumEntity::exitClean()