version 1.28, 2002/06/10 20:33:49
|
version 1.29, 2002/06/19 22:06:33
|
|
|
// Send response message to the client (use synchronous I/O for now: | // Send response message to the client (use synchronous I/O for now: |
| |
#ifdef LOCK_CONNECTION_ENABLED | #ifdef LOCK_CONNECTION_ENABLED |
lock_connection(); |
// lock_connection(); |
#endif | #endif |
_socket->enableBlocking(); | _socket->enableBlocking(); |
| |
|
|
_socket->disableBlocking(); | _socket->disableBlocking(); |
| |
#ifdef LOCK_CONNECTION_ENABLED | #ifdef LOCK_CONNECTION_ENABLED |
unlock_connection(); |
// unlock_connection(); |
#endif | #endif |
Tracer::trace(TRC_HTTP, Tracer::LEVEL4, | Tracer::trace(TRC_HTTP, Tracer::LEVEL4, |
"Total bytes written = %d; Buffer Size = %d; _requestCount = %d", | "Total bytes written = %d; Buffer Size = %d; _requestCount = %d", |
|
|
// let the monitor dispatch function do the cleanup. | // let the monitor dispatch function do the cleanup. |
PEG_METHOD_ENTER(TRC_HTTP, "HTTPConnection::_closeConnection"); | PEG_METHOD_ENTER(TRC_HTTP, "HTTPConnection::_closeConnection"); |
_dying = 1; | _dying = 1; |
_monitor->_entries[_monitor->_findEntry(getSocket())].dying = 1; |
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
// Message* message= new CloseConnectionMessage(_socket->getSocket()); | // Message* message= new CloseConnectionMessage(_socket->getSocket()); |
|
|
do | do |
{ | { |
struct timeval tv = { 0, 1 }; | struct timeval tv = { 0, 1 }; |
|
|
FD_ZERO(&fdread); | FD_ZERO(&fdread); |
// FD_ZERO(&fdwrite); |
|
FD_SET(getSocket(), &fdread); | FD_SET(getSocket(), &fdread); |
// FD_SET(getSocket(), &fdwrite); |
|
events = select(FD_SETSIZE, &fdread, NULL, NULL, &tv); | events = select(FD_SETSIZE, &fdread, NULL, NULL, &tv); |
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
if(events && events != SOCKET_ERROR && _dying.value() == 0 ) | if(events && events != SOCKET_ERROR && _dying.value() == 0 ) |
|
|
} | } |
else | else |
break; | break; |
|
|
// if (FD_ISSET(getSocket(), &fdwrite)) |
|
// { |
|
// events |= SocketMessage::WRITE; |
|
// } |
|
|
|
} | } |
else | else |
break; | break; |