Author: cgutman
Date: Sat Nov 7 19:12:58 2009
New Revision: 44010
URL:
http://svn.reactos.org/svn/reactos?rev=44010&view=rev
Log:
- Remove TCPSleep and TCPWakeup (we make all oskittcp sockets non-blocking)
- Crash ROS better in oskittcp_die
Modified:
trunk/reactos/lib/drivers/ip/transport/tcp/event.c
trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
trunk/reactos/lib/drivers/oskittcp/oskittcp/interface.c
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/event.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Sat Nov 7 19:12:58
2009
@@ -121,74 +121,6 @@
}
return 0;
-}
-
-int TCPSleep( void *ClientData, void *token, int priority, char *msg,
- int tmio ) {
- PSLEEPING_THREAD SleepingThread;
- LARGE_INTEGER Timeout;
-
- ASSERT_LOCKED(&TCPLock);
-
- TI_DbgPrint(DEBUG_TCP,
- ("Called TSLEEP: tok = %x, pri = %d, wmesg = %s, tmio = %x\n",
- token, priority, msg, tmio));
-
- SleepingThread = exAllocatePool( NonPagedPool, sizeof( *SleepingThread ) );
- if( SleepingThread ) {
- KeInitializeEvent( &SleepingThread->Event, NotificationEvent, FALSE );
- SleepingThread->SleepToken = token;
-
- /* We're going to sleep and need to release the lock, otherwise
- it's impossible to re-enter oskittcp to deliver the event that's
- going to wake us */
- TcpipRecursiveMutexLeave( &TCPLock );
-
- TcpipAcquireFastMutex( &SleepingThreadsLock );
- InsertTailList( &SleepingThreadsList, &SleepingThread->Entry );
- TcpipReleaseFastMutex( &SleepingThreadsLock );
-
- Timeout.QuadPart = Int32x32To64(tmio, -10000);
-
- TI_DbgPrint(DEBUG_TCP,("Waiting on %x\n", token));
- KeWaitForSingleObject( &SleepingThread->Event,
- Executive,
- KernelMode,
- TRUE,
- (tmio != 0) ? &Timeout : NULL );
-
- TcpipAcquireFastMutex( &SleepingThreadsLock );
- RemoveEntryList( &SleepingThread->Entry );
- TcpipReleaseFastMutex( &SleepingThreadsLock );
-
- TcpipRecursiveMutexEnter( &TCPLock, TRUE );
-
- exFreePool( SleepingThread );
- } else
- return OSK_ENOBUFS;
-
- TI_DbgPrint(DEBUG_TCP,("Waiting finished: %x\n", token));
- return 0;
-}
-
-void TCPWakeup( void *ClientData, void *token ) {
- PLIST_ENTRY Entry;
- PSLEEPING_THREAD SleepingThread;
-
- ASSERT_LOCKED(&TCPLock);
-
- TcpipAcquireFastMutex( &SleepingThreadsLock );
- Entry = SleepingThreadsList.Flink;
- while( Entry != &SleepingThreadsList ) {
- SleepingThread = CONTAINING_RECORD(Entry, SLEEPING_THREAD, Entry);
- TI_DbgPrint(DEBUG_TCP,("Sleeper @ %x\n", SleepingThread));
- if( SleepingThread->SleepToken == token ) {
- TI_DbgPrint(DEBUG_TCP,("Setting event to wake %x\n", token));
- KeSetEvent( &SleepingThread->Event, IO_NETWORK_INCREMENT, FALSE );
- }
- Entry = Entry->Flink;
- }
- TcpipReleaseFastMutex( &SleepingThreadsLock );
}
/* Memory management routines
Modified: trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/t…
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Sat Nov 7 19:12:58
2009
@@ -17,8 +17,6 @@
static NPAGED_LOOKASIDE_LIST TCPSegmentList;
LIST_ENTRY SignalledConnectionsList;
KSPIN_LOCK SignalledConnectionsLock;
-LIST_ENTRY SleepingThreadsList;
-FAST_MUTEX SleepingThreadsLock;
RECURSIVE_MUTEX TCPLock;
PORT_SET TCPPorts;
@@ -403,11 +401,6 @@
void *data, OSK_PCHAR file, OSK_UINT line );
void TCPMemShutdown( void );
-int TCPSleep( void *ClientData, void *token, int priority, char *msg,
- int tmio );
-
-void TCPWakeup( void *ClientData, void *token );
-
OSKITTCP_EVENT_HANDLERS EventHandlers = {
NULL, /* Client Data */
TCPSocketState, /* SocketState */
@@ -415,8 +408,8 @@
TCPFindInterface, /* FindInterface */
TCPMalloc, /* Malloc */
TCPFree, /* Free */
- TCPSleep, /* Sleep */
- TCPWakeup /* Wakeup */
+ NULL, /* Sleep */
+ NULL, /* Wakeup */
};
static KEVENT TimerLoopEvent;
@@ -490,9 +483,7 @@
NTSTATUS Status;
TcpipRecursiveMutexInit( &TCPLock );
- ExInitializeFastMutex( &SleepingThreadsLock );
KeInitializeSpinLock( &SignalledConnectionsLock );
- InitializeListHead( &SleepingThreadsList );
InitializeListHead( &SignalledConnectionsList );
Status = TCPMemStartup();
if ( ! NT_SUCCESS(Status) ) {
Modified: trunk/reactos/lib/drivers/oskittcp/oskittcp/interface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/oskittcp/oskit…
==============================================================================
--- trunk/reactos/lib/drivers/oskittcp/oskittcp/interface.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/oskittcp/oskittcp/interface.c [iso-8859-1] Sat Nov 7
19:12:58 2009
@@ -566,7 +566,7 @@
void oskittcp_die( const char *file, int line ) {
DbgPrint("\n\n*** OSKITTCP: Panic Called at %s:%d ***\n", file, line);
- *((int *)0) = 0;
+ ASSERT(FALSE);
}
/* Stuff supporting the BSD network-interface interface */