diff options
author | vanilla <vanilla@FreeBSD.org> | 2009-07-02 11:49:39 +0800 |
---|---|---|
committer | vanilla <vanilla@FreeBSD.org> | 2009-07-02 11:49:39 +0800 |
commit | 2979b3b7f9e1cfc1b630f925586293fe1e5ddb27 (patch) | |
tree | 5446cc7e040165fcbf1b44c51a0f6f2a17596b3e /net/spserver | |
parent | 07e119b80d097bd275a4f30ec3e4c50b3e5dd435 (diff) | |
download | freebsd-ports-gnome-2979b3b7f9e1cfc1b630f925586293fe1e5ddb27.tar.gz freebsd-ports-gnome-2979b3b7f9e1cfc1b630f925586293fe1e5ddb27.tar.zst freebsd-ports-gnome-2979b3b7f9e1cfc1b630f925586293fe1e5ddb27.zip |
Add a patch to fix deadloop when client is closing connection, but server has been blocked in handle.
Obtained from: http://code.google.com/p/spserver/source/detail?r=128
Diffstat (limited to 'net/spserver')
-rw-r--r-- | net/spserver/Makefile | 2 | ||||
-rw-r--r-- | net/spserver/files/patch-speventcb.cpp | 74 |
2 files changed, 69 insertions, 7 deletions
diff --git a/net/spserver/Makefile b/net/spserver/Makefile index b767b78bc2b1..58c0ac6dfc27 100644 --- a/net/spserver/Makefile +++ b/net/spserver/Makefile @@ -7,7 +7,7 @@ PORTNAME= spserver PORTVERSION= 0.9.4 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} DISTNAME= ${PORTNAME}-${PORTVERSION}.src diff --git a/net/spserver/files/patch-speventcb.cpp b/net/spserver/files/patch-speventcb.cpp index 806be5a2aa1f..34ebbc9a0810 100644 --- a/net/spserver/files/patch-speventcb.cpp +++ b/net/spserver/files/patch-speventcb.cpp @@ -1,6 +1,6 @@ --- spserver/speventcb.cpp.orig 2008-10-23 22:08:00.000000000 +0800 -+++ spserver/speventcb.cpp 2009-06-03 10:20:01.000000000 +0800 -@@ -177,8 +177,10 @@ ++++ spserver/speventcb.cpp 2009-07-02 11:44:48.000000000 +0800 +@@ -177,14 +177,16 @@ addEvent( session, EV_READ, -1 ); } else { int saved = errno; @@ -13,7 +13,32 @@ if( EAGAIN != saved ) { if( 0 == session->getRunning() ) { -@@ -244,7 +246,7 @@ + SP_EventHelper::doError( session ); + } else { +- addEvent( session, EV_READ, -1 ); ++ //addEvent( session, EV_READ, -1 ); + sp_syslog( LOG_NOTICE, "session(%d.%d) busy, process session error later", + sid.mKey, sid.mSeq ); + } +@@ -196,7 +198,7 @@ + if( 0 == session->getRunning() ) { + SP_EventHelper::doTimeout( session ); + } else { +- addEvent( session, EV_READ, -1 ); ++ //addEvent( session, EV_READ, -1 ); + sp_syslog( LOG_NOTICE, "session(%d.%d) busy, process session timeout later", + sid.mKey, sid.mSeq ); + } +@@ -230,7 +232,7 @@ + sid.mKey, sid.mSeq, errno, session->getStatus(), session->getOutList()->getCount() ); + SP_EventHelper::doError( session ); + } else { +- addEvent( session, EV_WRITE, -1 ); ++ //addEvent( session, EV_WRITE, -1 ); + sp_syslog( LOG_NOTICE, "session(%d.%d) busy, process session error later, errno [%d]", + sid.mKey, sid.mSeq, errno ); + } +@@ -244,10 +246,10 @@ if( SP_Session::eExit == session->getStatus() ) { ret = -1; if( 0 == session->getRunning() ) { @@ -21,7 +46,20 @@ + sp_syslog( LOG_WARNING, "session(%d.%d) normal exit", sid.mKey, sid.mSeq ); SP_EventHelper::doClose( session ); } else { - addEvent( session, EV_WRITE, -1 ); +- addEvent( session, EV_WRITE, -1 ); ++ //addEvent( session, EV_WRITE, -1 ); + sp_syslog( LOG_NOTICE, "session(%d.%d) busy, terminate session later", + sid.mKey, sid.mSeq ); + } +@@ -269,7 +271,7 @@ + if( 0 == session->getRunning() ) { + SP_EventHelper::doTimeout( session ); + } else { +- addEvent( session, EV_WRITE, -1 ); ++ //addEvent( session, EV_WRITE, -1 ); + sp_syslog( LOG_NOTICE, "session(%d.%d) busy, process session timeout later", + sid.mKey, sid.mSeq ); + } @@ -409,7 +411,7 @@ char buffer[ 16 ] = { 0 }; session->getInBuffer()->take( buffer, sizeof( buffer ) ); @@ -31,7 +69,27 @@ session->getInBuffer()->reset(); } } -@@ -553,7 +555,7 @@ +@@ -473,7 +475,7 @@ + sp_syslog( LOG_WARNING, "session(%d.%d) error, r %d(%d), w %d(%d), i %d, o %d, s %d(%d)", + sid.mKey, sid.mSeq, session->getTotalRead(), session->getReading(), + session->getTotalWrite(), session->getWriting(), +- session->getInBuffer()->getSize(), session->getOutList()->getCount(), ++ (int)session->getInBuffer()->getSize(), session->getOutList()->getCount(), + eventArg->getSessionManager()->getCount(), eventArg->getSessionManager()->getFreeCount() ); + + // onResponse will ignore this session, so it's safe to destroy session here +@@ -524,8 +526,8 @@ + sp_syslog( LOG_WARNING, "session(%d.%d) timeout, r %d(%d), w %d(%d), i %d, o %d, s %d(%d)", + sid.mKey, sid.mSeq, session->getTotalRead(), session->getReading(), + session->getTotalWrite(), session->getWriting(), +- session->getInBuffer()->getSize(), session->getOutList()->getCount(), +- eventArg->getSessionManager()->getCount(), eventArg->getSessionManager()->getFreeCount() ); ++ (int)session->getInBuffer()->getSize(), session->getOutList()->getCount(), ++ eventArg->getSessionManager()->getCount(), (int)eventArg->getSessionManager()->getFreeCount() ); + + // onResponse will ignore this session, so it's safe to destroy session here + session->getHandler()->close(); +@@ -553,10 +555,10 @@ SP_EventArg * eventArg = (SP_EventArg*)session->getArg(); SP_Sid_t sid = session->getSid(); @@ -39,4 +97,8 @@ + sp_syslog( LOG_WARNING, "session(%d.%d) close, r %d(%d), w %d(%d), i %d, o %d, s %d(%d)", sid.mKey, sid.mSeq, session->getTotalRead(), session->getReading(), session->getTotalWrite(), session->getWriting(), - session->getInBuffer()->getSize(), session->getOutList()->getCount(), +- session->getInBuffer()->getSize(), session->getOutList()->getCount(), ++ (int)session->getInBuffer()->getSize(), session->getOutList()->getCount(), + eventArg->getSessionManager()->getCount(), eventArg->getSessionManager()->getFreeCount() ); + + session->getHandler()->close(); |