From atin at helixcommunity.org  Wed Jun  1 14:43:10 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Wed Jun  1 14:43:12 2005
Subject: [Server-cvs] engine/core _main.cpp,1.75.2.17,1.75.2.18
Message-ID: 

Update of /cvsroot/server/engine/core
In directory cvs-new:/tmp/cvs-serv28577

Modified Files:
      Tag: SERVER_11_0_STABLE
	_main.cpp 
Log Message:
on linux the timer is a cloaned thread.

Synopsis
--------
on solaris /dev/poll was broken and also, when pthreads was turned on the
server hung upon startup.

Reviewed by: dcollins
Branches: SERVER_CURRENT, SERVER_11_0_STABLE

Description
-----------
the solaris /dev/poll code was old and was not updated, so it just needed
fixing like it is on linux with /dev/epoll.

when pthreads was turned on on solaris, it turns out that the controller
thread which spawns off the timer thread was getting all of the SIGALRM
signals being generated by the itimer alarms instead of the timer thread, so
the timer thread got stuck in the calibration loop and didn't return.

the original fix to move the actual calibration of the itimer inside the
controller process worked, but instead of the timer thread getting all of the
SIGALRM signals, the controller got the SIGALRM signal on solaris.

according to the sun documentation, "Effective with the solaris 9 release, all
timers are per process except for the virtual time and profile interval
timers, which remain per-LWP."

so the solution is to have the timer stay a process as before and have the
controller spawn off all of its other descendants as pthreads.

also, since the controller is going to be a process and is lwp 1 (or its
thread id is 1) the rss output looks like this:

--------------------------
...
Option: Show Debug Messages
Option: Report Server Stats (5 seconds)
Using Config File: cfg
Starting PID 8034 TID 1, procnum 0 (controller) ---> new line
Creating Server Space...
Server has allocated 1024 megabytes of memory
Starting PID 8036, procnum 1 (timer)
Calibrating timers...
    Testing 10ms resolution: 10.000ms actual, 0ms drift
Interval timer enabled (10ms resolution).
Starting TID 2, procnum 2 (core)
Starting Helix Server 11.0 Core...
4 CPUs Detected...
...
--------------------------


Testing Performed
-----------------
Verifed that it works on:
platform: sunos-5.8-sparc-server on borabora (4 cpus)
          linux-rhel4-i686 on wocket (4 cpus)
test: 1000+ clients at 20+ clients/sec churn playing a 150 kbps clip
      500 clients (tcp/udp/cloaked) playing the clip from the local fs
      500 clients (tcp/udp/cloaked) playing the clips from a nfs mounted fs


Files Affected
--------------
server/engine/core/pub/platform/unix/servcallback.h
server/engine/core/_main.cpp


Platforms Tested
----------------
sunos-5.8-sparc-server -- HEAD
linux-rhel4-i686 -- SERVER_11_0_STABLE


QA Hints
--------
Verify that the server works just as well as the process based server, if not
better.



Index: _main.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/_main.cpp,v
retrieving revision 1.75.2.17
retrieving revision 1.75.2.18
diff -u -d -r1.75.2.17 -r1.75.2.18
--- _main.cpp	26 May 2005 20:51:57 -0000	1.75.2.17
+++ _main.cpp	1 Jun 2005 21:43:07 -0000	1.75.2.18
@@ -342,6 +342,7 @@
 
 #ifdef PTHREADS_SUPPORTED
 INT32 g_ControllerTid = -1;
+BOOL g_bUnixThreads = TRUE;
 #endif // PTHREADS_SUPPORTED
 
 extern BOOL g_bDisableInternalResolver;
@@ -412,7 +413,8 @@
 BOOL g_bEFenceProtectFreedMemory = FALSE;
 #endif
 
-#define CP_CREATE_SOCKET              1
+#define CP_CREATE_SOCKET              0x1
+#define CP_FORK_PROCESS               0x2
 
 static const int zMaxOpenFDs = 32767;
 
@@ -427,10 +429,6 @@
     _syscall1(int, get_segv_eip, void**, peip);
 #endif
 
-#ifdef PTHREADS_SUPPORTED
-    BOOL g_bUnixThreads = TRUE;
-#endif // PTHREADS_SUPPORTED
-
 #if defined PTHREADS_SUPPORTED || defined _LINUX
 UINT32 g_ulThreadStackSize = 1024 * 1024;
 #endif // defined PTHREADS_SUPPORTED || defined _LINUX
@@ -1455,7 +1453,7 @@
 {
 
 #if defined PTHREADS_SUPPORTED
-    if (g_bUnixThreads)
+    if (g_bUnixThreads && !(flags & CP_FORK_PROCESS))
         return MakeThread(processname, cb, dispatch_queue, flags);
 #endif // defined PTHREADS_SUPPORTED
 
@@ -1475,8 +1473,20 @@
             socketpair(AF_UNIX, SOCK_STREAM, 0, s);
         }
 
-#if defined _LINUX && !defined PTHREADS_SUPPORTED
-        if (g_ulLinuxUseMmapShared)
+#if defined _LINUX && defined PTHREADS_SUPPORTED
+        if (flags & CP_FORK_PROCESS)
+        {
+            linux_fork_data* pData = new linux_fork_data;
+            pData->processname = processname;
+            pData->cb = cb;
+            pData->dispatch_queue = dispatch_queue;
+            pData->flags = flags;
+            pData->proc = proc;
+            pData->process_number = process_number;
+            pid = linuxfork(linuxfork2, pData);
+        }
+#elif defined _LINUX && !defined PTHREADS_SUPPORTED
+        else if (g_ulLinuxUseMmapShared)
         {
             /* New Random seed! */
             srand((unsigned)time(NULL) + process_number);
@@ -2914,6 +2924,7 @@
     if (g_bNoAutoRestart)
     {
         ShutdownServer();
+	exit(0);
     }
 
     return RestartServer();
@@ -5726,6 +5737,16 @@
         &MonitorAliveChecker, NULL, &dwSomeMSParam);
 #endif
 
+#ifdef PTHREADS_SUPPORTED
+#ifdef _LINUX
+    suprintf("Starting PID %lu TID %lu/%d, procnum 0 (controller)\n",
+           getpid(), pthread_self(), gettid());
+#else
+    suprintf("Starting PID %lu TID %lu, procnum 0 (controller)\n",
+           getpid(), pthread_self());
+#endif
+#endif
+
     Process* proc;
     int procnum;
     DispatchQueue* dq;
@@ -6219,7 +6240,7 @@
 
     *pTimerProcInitMutex = 1;
     UnixTimerInitCallback* tcb = new UnixTimerInitCallback;
-    MakeProcess("timer", tcb, dq, 0);
+    MakeProcess("timer", tcb, dq, CP_FORK_PROCESS);
     while (*pTimerProcInitMutex)
         microsleep(1);
 


From atin at helixcommunity.org  Wed Jun  1 14:43:10 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Wed Jun  1 14:43:12 2005
Subject: [Server-cvs] engine/core/pub/platform/unix servcallback.h, 1.6.2.6,
	1.6.2.7
Message-ID: 

Update of /cvsroot/server/engine/core/pub/platform/unix
In directory cvs-new:/tmp/cvs-serv28577/pub/platform/unix

Modified Files:
      Tag: SERVER_11_0_STABLE
	servcallback.h 
Log Message:
on linux the timer is a cloaned thread.

Synopsis
--------
on solaris /dev/poll was broken and also, when pthreads was turned on the
server hung upon startup.

Reviewed by: dcollins
Branches: SERVER_CURRENT, SERVER_11_0_STABLE

Description
-----------
the solaris /dev/poll code was old and was not updated, so it just needed
fixing like it is on linux with /dev/epoll.

when pthreads was turned on on solaris, it turns out that the controller
thread which spawns off the timer thread was getting all of the SIGALRM
signals being generated by the itimer alarms instead of the timer thread, so
the timer thread got stuck in the calibration loop and didn't return.

the original fix to move the actual calibration of the itimer inside the
controller process worked, but instead of the timer thread getting all of the
SIGALRM signals, the controller got the SIGALRM signal on solaris.

according to the sun documentation, "Effective with the solaris 9 release, all
timers are per process except for the virtual time and profile interval
timers, which remain per-LWP."

so the solution is to have the timer stay a process as before and have the
controller spawn off all of its other descendants as pthreads.

also, since the controller is going to be a process and is lwp 1 (or its
thread id is 1) the rss output looks like this:

--------------------------
...
Option: Show Debug Messages
Option: Report Server Stats (5 seconds)
Using Config File: cfg
Starting PID 8034 TID 1, procnum 0 (controller) ---> new line
Creating Server Space...
Server has allocated 1024 megabytes of memory
Starting PID 8036, procnum 1 (timer)
Calibrating timers...
    Testing 10ms resolution: 10.000ms actual, 0ms drift
Interval timer enabled (10ms resolution).
Starting TID 2, procnum 2 (core)
Starting Helix Server 11.0 Core...
4 CPUs Detected...
...
--------------------------


Testing Performed
-----------------
Verifed that it works on:
platform: sunos-5.8-sparc-server on borabora (4 cpus)
          linux-rhel4-i686 on wocket (4 cpus)
test: 1000+ clients at 20+ clients/sec churn playing a 150 kbps clip
      500 clients (tcp/udp/cloaked) playing the clip from the local fs
      500 clients (tcp/udp/cloaked) playing the clips from a nfs mounted fs


Files Affected
--------------
server/engine/core/pub/platform/unix/servcallback.h
server/engine/core/_main.cpp


Platforms Tested
----------------
sunos-5.8-sparc-server -- HEAD
linux-rhel4-i686 -- SERVER_11_0_STABLE


QA Hints
--------
Verify that the server works just as well as the process based server, if not
better.



Index: servcallback.h
===================================================================
RCS file: /cvsroot/server/engine/core/pub/platform/unix/servcallback.h,v
retrieving revision 1.6.2.6
retrieving revision 1.6.2.7
diff -u -d -r1.6.2.6 -r1.6.2.7
--- servcallback.h	31 May 2005 20:18:39 -0000	1.6.2.6
+++ servcallback.h	1 Jun 2005 21:43:08 -0000	1.6.2.7
@@ -82,8 +82,6 @@
     int           nPollMask;
 } FDInfo;
 
-#  define ACCUMULATE_DEV_POLL_CHANGES
-
 #  ifdef _SOLARIS
 #    include  // for uname()
 #  endif // _SOLARIS
@@ -98,8 +96,6 @@
     int           nPollMask;
 } FDInfo;
 
-//#  define ACCUMULATE_EPOLL_CHANGES
-
 #endif // LINUX_EPOLL_SUPPORT
 
 class Callbacks {
@@ -208,7 +204,6 @@
 #endif // LINUX_EPOLL_SUPPORT
 }
 
-
 inline
 Callbacks::~Callbacks()
 {
@@ -380,25 +375,11 @@
 #ifdef DEV_POLL_SUPPORT
     if (m_nPollFD >= 0)
     {
-#  ifdef ACCUMULATE_DEV_POLL_CHANGES
-        // add the appropriate poll bit to the mask
         if (type == HX_WRITERS)
-        {
-            m_FDTable[fd].nPollMask |= POLLWRNORM;
-        }
+            m_FDTable[fd].nPollMask |= POLLOUT;
         else
-        {
-            m_FDTable[fd].nPollMask |= POLLRDNORM;
-        }
-
-        if (!m_bAlreadyChanged[fd])
-        {
-            m_pChangedFDs[m_ulNumChanges].fd = fd;
-            m_ulNumChanges++;
-            m_bAlreadyChanged[fd] = TRUE;
-        }
+            m_FDTable[fd].nPollMask |= POLLIN;
 
-#  else
         // we're going to write the changes all at once before polling
         struct pollfd pollInfo;
         pollInfo.fd = fd;
@@ -410,7 +391,6 @@
         {
             perror("error writing FD to poll");
         }
-#  endif // ACCUMULATE_DEV_POLL_CHANGES
 
         return;
     }
@@ -468,7 +448,7 @@
     if (fd >= count || fd < 0)
         return;
 
-#ifndef LINUX_EPOLL_SUPPORT
+#if !defined DEV_POLL_SUPPORT && !defined LINUX_EPOLL_SUPPORT
     enlist[fd] = FALSE;
     ts_memberlist[fd] = FALSE;
 #endif
@@ -481,48 +461,10 @@
         if (type == -1) // disable all behaviour
             m_FDTable[fd].nPollMask = 0;
         else if (type == HX_WRITERS)
-            m_FDTable[fd].nPollMask &= ~POLLWRNORM;
+            m_FDTable[fd].nPollMask &= ~POLLOUT;
         else ///HX_READERS and HX_ACCEPTORS
-            m_FDTable[fd].nPollMask &= ~POLLRDNORM;
-
-#  ifdef ACCUMULATE_DEV_POLL_CHANGES
-        if (!m_bAlreadyRemoved[fd])
-        {
-            m_pRemovedFDs[m_ulNumRemoves].fd = fd;
-            m_ulNumRemoves++;
-            m_bAlreadyRemoved[fd] = TRUE;
-        }
-
-        // only add to the list of changes if we need to write it
-        // back in because the other behaviour is desired
-        if (m_FDTable[fd].nPollMask != 0)
-        {
-            if (!m_bAlreadyChanged[fd])
-            {
-                m_pChangedFDs[m_ulNumChanges].fd = fd;
-                m_ulNumChanges++;
-                m_bAlreadyChanged[fd] = TRUE;
-            }
-        }
-        else if (m_bAlreadyChanged[fd])
-        {
-            // if the fd has been added to the changed list we need to
-            // remove it if the event mask is 0
+            m_FDTable[fd].nPollMask &= ~POLLIN;
 
-            m_bAlreadyChanged[fd] = FALSE;
-            for (int i = 0; i < count; i++)
-            {
-                if (m_pChangedFDs[i].fd == fd)
-                {
-                    // copy the fd at the end of the list over the target
-                    m_pChangedFDs[i].fd = m_pChangedFDs[m_ulNumChanges - 1].fd;
-                    break;
-                }
-            }
-            ASSERT(m_ulNumChanges);
-            m_ulNumChanges--;
-        }
-#  else
         struct pollfd pollInfo;
         pollInfo.fd = fd;
         pollInfo.events = POLLREMOVE;
@@ -546,7 +488,6 @@
                 perror("error adding FD to poll");
             }
         }
-#  endif // ACCUMULATE_DEV_POLL_CHANGES
 
         return;
     }
@@ -784,37 +725,54 @@
         if (m_nTSPos >= m_nReadyFDs)
             return 0;
 
-        while (!m_FDTable[m_pPollMemberList[m_nTSPos].fd].pReadCB ||
-               !ts_memberlist[m_pPollMemberList[m_nTSPos].fd] ||
-               !enlist[m_pPollMemberList[m_nTSPos].fd])
+	int nFD = m_pPollMemberList[m_nTSPos].fd;
+	struct FDInfo* pFDInfo = &m_FDTable[nFD];
+        while (!nFD ||
+	       !ts_memberlist[nFD] ||
+	       !pFDInfo->nPollMask || 
+	       (!pFDInfo->pReadCB && !pFDInfo->pWriteCB))
         {
             m_nTSPos++;
             if (m_nTSPos >= m_nReadyFDs)
                 return 0;
+	    nFD = m_pPollMemberList[m_nTSPos].fd;
+	    pFDInfo = &m_FDTable[nFD];
         }
 
         if (m_bCleanFinish)
         {
             m_bCleanFinish = FALSE;
 
+	    struct pollfd* pPollInfo = &m_pPollMemberList[m_nTSPos];
+
             // remove the fd if it's gone bad
-            if (m_pPollMemberList[m_nTSPos].revents & POLLNVAL)
+            if (pPollInfo->revents & (POLLNVAL | POLLERR | POLLHUP))
             {
-                // fprintf(stderr, "Removing invalid fd %d\n", m_pPollMemberList[m_nTSPos].fd);
+                // fprintf(stderr, "Removing invalid fd %d\n", nFD);
 		/*
 		 * force a read to cause the connection to fail and begin
 		 * cleanup. without this the connection will stay until a 
 		 * message (like the keep alive) is written to the socket
 		 * and it fails.
 		 */
-                m_FDTable[m_pPollMemberList[m_nTSPos].fd].pReadCB->Func();
-                remove(HX_READERS, m_pPollMemberList[m_nTSPos].fd);
+		if (pFDInfo->pReadCB)
+		    pFDInfo->pReadCB->Func();
+                remove(-1, nFD);
             }
             else
             {
-                //XXXtbradley : we need to support TS Writes as well, eventually
-                m_FDTable[m_pPollMemberList[m_nTSPos].fd].pReadCB->Func();
-                (*pNumReads)++;
+                // execute the read callback if the fd is ready for it
+		if (pPollInfo->revents & POLLIN && pFDInfo->pReadCB)
+		{
+		    pFDInfo->pReadCB->Func();
+		    (*pNumReads)++;
+		}
+                // execute the write callback if the fd is ready for it
+		if (pPollInfo->revents & POLLOUT && pFDInfo->pWriteCB)
+		{
+		    pFDInfo->pWriteCB->Func();
+		    (*pNumWrites)++;
+		}
             }
 
             m_bCleanFinish = TRUE;
@@ -833,49 +791,54 @@
         if (m_nTSPos >= m_nReadyFDs)
             return 0;
 
-        while ((!m_FDTable[m_pEPollEvents[m_nTSPos].data.fd].pReadCB &&
-                !m_FDTable[m_pEPollEvents[m_nTSPos].data.fd].pWriteCB) ||
-               !ts_memberlist[m_pEPollEvents[m_nTSPos].data.fd] ||
-               !m_FDTable[m_pEPollEvents[m_nTSPos].data.fd].nPollMask)
+	int nFD = m_pEPollEvents[m_nTSPos].data.fd;
+	struct FDInfo* pFDInfo = &m_FDTable[nFD];
+        while (!nFD ||
+	       !ts_memberlist[nFD] || 
+	       !pFDInfo->nPollMask ||
+	       (!pFDInfo->pReadCB && !pFDInfo->pWriteCB))
         {
             m_nTSPos++;
             if (m_nTSPos >= m_nReadyFDs)
                 return 0;
+	    nFD = m_pEPollEvents[m_nTSPos].data.fd;
+	    pFDInfo = &m_FDTable[nFD];
         }
 
         if (m_bCleanFinish)
         {
             m_bCleanFinish = FALSE;
+
             struct epoll_event* pEvent = &m_pEPollEvents[m_nTSPos];
 
             // remove the fd if it's gone bad
             if ((pEvent->events & (EPOLLERR | EPOLLHUP)))
             {
-                // fprintf(stderr, "Removing invalid fd %d\n", pEvent->data.fd);
+                // fprintf(stderr, "Removing invalid fd %d\n", nFD);
 		/*
 		 * force a read to cause the connection to fail and begin
 		 * cleanup. without this the connection will stay until a 
 		 * message (like the keep alive) is written to the socket
 		 * and it fails.
 		 */
-		m_FDTable[pEvent->data.fd].pReadCB->Func();
-                remove(-1, pEvent->data.fd);
+		if (pFDInfo->pReadCB)
+		    pFDInfo->pReadCB->Func();
+                remove(-1, nFD);
             }
             else
             {
-                // execute the write callback if the fd is ready for it
-                if (pEvent->events & EPOLLOUT)
-                {
-                    m_FDTable[pEvent->data.fd].pWriteCB->Func();
-                    (*pNumWrites)++;
-                }
-
                 // execute the read callback if the fd is ready for it
-                if (pEvent->events & EPOLLIN)
+                if (pEvent->events & EPOLLIN && pFDInfo->pReadCB)
                 {
-                    m_FDTable[pEvent->data.fd].pReadCB->Func();
+                    pFDInfo->pReadCB->Func();
                     (*pNumReads)++;
                 }
+                // execute the write callback if the fd is ready for it
+                if (pEvent->events & EPOLLOUT && pFDInfo->pWriteCB)
+                {
+                    pFDInfo->pWriteCB->Func();
+                    (*pNumWrites)++;
+                }
             }
 
             m_bCleanFinish = TRUE;
@@ -936,22 +899,29 @@
         if (m_nPos >= m_nReadyFDs)
             return 0;
 
-        while ((!m_FDTable[m_pPollMemberList[m_nPos].fd].pReadCB &&
-                !m_FDTable[m_pPollMemberList[m_nPos].fd].pWriteCB) ||
-               ts_memberlist[m_pPollMemberList[m_nPos].fd] ||
-               !enlist[m_pPollMemberList[m_nPos].fd])
+ 	int nFD = m_pPollMemberList[m_nPos].fd;
+ 	struct FDInfo* pFDInfo = &m_FDTable[nFD];
+        while (!nFD ||
+ 	       ts_memberlist[nFD] ||
+ 	       !pFDInfo->nPollMask ||
+ 	       !enlist[nFD] || 
+ 	       (!pFDInfo->pReadCB && !pFDInfo->pWriteCB))
         {
             m_nPos++;
             if (m_nPos >= m_nReadyFDs)
                 return 0;
+ 	    nFD = m_pPollMemberList[m_nPos].fd;
+ 	    pFDInfo = &m_FDTable[nFD];
         }
 
         if (m_bCleanFinish)
         {
             m_bCleanFinish = FALSE;
-            
+
+ 	    struct pollfd* pPollInfo = &m_pPollMemberList[m_nPos];
+ 
             // remove the fd if it's gone bad
-            if (m_pPollMemberList[m_nPos].revents & POLLNVAL)
+            if (pPollInfo->revents & (POLLNVAL | POLLERR | POLLHUP))
             {
                 // fprintf(stderr, "Removing invalid fd %d\n", m_pPollMemberList[m_nPos].fd);
 		/*
@@ -960,22 +930,22 @@
 		 * message (like the keep alive) is written to the socket
 		 * and it fails.
 		 */
-		m_FDTable[m_pPollMemberList[m_nPos].fd].pReadCB->Func();
-                remove(-1, m_pPollMemberList[m_nPos].fd);
+		if (pPollInfo->pReadCB)
+		    pPollInfo->pReadCB->Func();
+                remove(-1, nFD);
             }
             else
             {
                 // execute the read callback if the fd is ready for it
-                if (m_pPollMemberList[m_nPos].revents & POLLRDNORM)
+                if (pPollInfo->revents & POLLIN && pPollInfo->pReadCB)
                 {
-                    m_FDTable[m_pPollMemberList[m_nPos].fd].pReadCB->Func();
+		    pPollInfo->pReadCB->Func();
                     (*pNumReads)++;
                 }
-
                 // execute the write callback if the fd is ready for it
-                if (m_pPollMemberList[m_nPos].revents & POLLWRNORM)
+                if (pPollInfo->revents & POLLOUT && pPollInfo->pWriteCB)
                 {
-                    m_FDTable[m_pPollMemberList[m_nPos].fd].pWriteCB->Func();
+		    pPollInfo->pWriteCB->Func();
                     (*pNumWrites)++;
                 }
             }
@@ -996,19 +966,25 @@
         if (m_nPos >= m_nReadyFDs)
             return 0;
 
-        while ((!m_FDTable[m_pEPollEvents[m_nPos].data.fd].pReadCB &&
-                !m_FDTable[m_pEPollEvents[m_nPos].data.fd].pWriteCB) ||
-               ts_memberlist[m_pEPollEvents[m_nPos].data.fd] ||
-               !m_FDTable[m_pEPollEvents[m_nTSPos].data.fd].nPollMask)
+ 	int nFD = m_pEPollEvents[m_nPos].data.fd;
+ 	struct FDInfo* pFDInfo = &m_FDTable[nFD];
+        while (!nFD ||
+ 	       ts_memberlist[nFD] ||
+ 	       !pFDInfo->nPollMask ||
+ 	       !enlist[nFD] || 
+ 	       (!pFDInfo->pReadCB && !pFDInfo->pWriteCB))
         {
             m_nPos++;
             if (m_nPos >= m_nReadyFDs)
                 return 0;
+ 	    nFD = m_pEPollEvents[m_nPos].data.fd;
+ 	    pFDInfo = &m_FDTable[nFD];
         }
 
         if (m_bCleanFinish)
         {
             m_bCleanFinish = FALSE;
+
             struct epoll_event* pEvent = &m_pEPollEvents[m_nPos];
             
             // remove the fd if it's gone bad
@@ -1021,24 +997,24 @@
 		 * message (like the keep alive) is written to the socket
 		 * and it fails.
 		 */
-		m_FDTable[pEvent->data.fd].pReadCB->Func();
+		if (pFDInfo->pReadCB)
+		    pFDInfo->pReadCB->Func();
                 remove(-1, pEvent->data.fd);
             }
             else
             {
-                // execute the write callback if the fd is ready for it
-                if (pEvent->events & EPOLLOUT)
-                {
-                    m_FDTable[pEvent->data.fd].pWriteCB->Func();
-                    (*pNumWrites)++;
-                }
-
                 // execute the read callback if the fd is ready for it
-                if (pEvent->events & EPOLLIN)
+                if (pEvent->events & EPOLLIN && pFDInfo->pReadCB)
                 {
-                    m_FDTable[pEvent->data.fd].pReadCB->Func();
+                    pFDInfo->pReadCB->Func();
                     (*pNumReads)++;
                 }
+                // execute the write callback if the fd is ready for it
+                if (pEvent->events & EPOLLOUT && pFDInfo->pWriteCB)
+                {
+                    pFDInfo->pWriteCB->Func();
+                    (*pNumWrites)++;
+                }
             }
 
             m_bCleanFinish = TRUE;
@@ -1191,43 +1167,11 @@
 inline int
 Callbacks::Poll(int timeout)
 {
-#  ifdef ACCUMULATE_DEV_POLL_CHANGES
-    // first remove any FDs that need to be
-    if (m_ulNumRemoves > 0)
-    {
-        if (write(m_nPollFD,
-                  m_pRemovedFDs,
-                  sizeof(struct pollfd) * m_ulNumRemoves)
-            != sizeof(struct pollfd) * m_ulNumRemoves)
-        {
-            perror("error removing FD from poll");
-        }
-
-        m_ulNumRemoves = 0;
-        memset(m_bAlreadyRemoved, 0, count);
-    }
-
-    // now change any fd event masks to what they need to be
-    if (m_ulNumChanges > 0)
-    {
-        for (int i = 0; i < m_ulNumChanges; i++)
-        {
-            m_pChangedFDs[i].events = m_FDTable[m_pChangedFDs[i].fd].nPollMask;
-        }
-
-        if (write(m_nPollFD, m_pChangedFDs,
-                  sizeof(struct pollfd) * m_ulNumChanges)
-            != sizeof(struct pollfd) * m_ulNumChanges)
+    if (m_nPos < m_nReadyFDs || m_nTSPos < m_nReadyFDs)
         {
-            perror("error adding FD to poll");
-        }
-
-        m_ulNumChanges = 0;
-        memset(m_bAlreadyChanged, 0, count);
+        //we still have events to process, don't overwrite the events list
+        return m_nReadyFDs;
     }
-#  endif // ACCUMULATE_DEV_POLL_CHANGES
-
-    // now do the polling
 
     struct dvpoll pollInfo;
     pollInfo.dp_fds = m_pPollMemberList;
@@ -1236,10 +1180,10 @@
 
     m_nReadyFDs = ioctl(m_nPollFD, DP_POLL, &pollInfo);
     if (m_nReadyFDs < 0 && errno != EINTR)
-    {
         perror("/dev/poll ioctl DP_POLL failed");
-    }
 
+    if (m_nReadyFDs < 0)
+        m_nReadyFDs = 0;
     return m_nReadyFDs;
 }
 #endif // DEV_POLL_SUPPORT
@@ -1257,19 +1201,12 @@
 
     m_nReadyFDs = epoll_wait(m_nPollFD, m_pEPollEvents, EPOLL_EVENTS_MAX, timeout);
     if (m_nReadyFDs < 0 && errno != EINTR && errno != 0)
-    {
         perror("epoll_wait failed");
-    }
 
     if (m_nReadyFDs < 0)
-    {
         m_nReadyFDs = 0;
-    }
-
     return m_nReadyFDs;
 }
 #endif // LINUX_EPOLL_SUPPORT
-
-
 
 #endif/*_CALLBACK_H_*/


From jsimpson at helixcommunity.org  Wed Jun  1 16:51:48 2005
From: jsimpson at helixcommunity.org (jsimpson@helixcommunity.org)
Date: Wed Jun  1 16:51:50 2005
Subject: [Server-cvs] common/analysis resolve.pl,1.9,1.10
Message-ID: 

Update of /cvsroot/server/common/analysis
In directory cvs-new:/tmp/cvs-serv8046

Modified Files:
	resolve.pl 
Log Message:
Prints '(nil)' lines in resolved stacks.


Index: resolve.pl
===================================================================
RCS file: /cvsroot/server/common/analysis/resolve.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- resolve.pl	22 Mar 2005 01:22:02 -0000	1.9
+++ resolve.pl	1 Jun 2005 23:51:45 -0000	1.10
@@ -377,7 +377,7 @@
       if ($line =~ /^\*\*\* .* Fault/ || 
           $line =~ /^Dumping alloc traces:/) {
         print ">>> Fault (~$timestamp)\n";
-         print $line;
+        print $line;
         while (defined ($line = getline(\*LOG))) {
           if ($line =~ /^[TP]ID (\S+)/) {
             pid_info($1);
@@ -394,6 +394,7 @@
       if ($line =~ /^size:/) { print $line; }
       if ($line =~ /^Heartbeat Stack Trace/) { print $line; }
       if ($line =~ /^Trace:/) { print $line; }
+      if ($line =~ /^ ?\(nil\)/) {print $line; }
   }
   
   if ($line =~ /^Creating .* Space/i) {


From CalanthAmo9017 at jjkr.com  Wed Jun  1 22:37:45 2005
From: CalanthAmo9017 at jjkr.com (Calanthe Amos)
Date: Wed Jun  1 22:38:44 2005
Subject: [Server-cvs] Re: Just  do lt
Message-ID: 

Hello, 
Oh, but of course!  Blood's irony laughed in his eyes.  Yet,denunciation.   He spoke, Pitt tells us, a dreadful kind of English,There was a  slight severity in her tone, as if to reprove the mixtureanother who  had been a gunner, a man named Ogle.Majesty's Government, which you  would not find ungrateful.  YouOn that pretext, he made an excursion  into the awakening town, andsuspect this gravity for a mask under  which Lord Julian was secretlyBlood, who rescued me.light eyes  blazed:  his face was set.and what's left of the fort until we put to  sea.But what are you going to do?  Is it that you will tell me?   Ithad escaped with Peter Blood from the Barbados plantations, andBut  that you should bestow gifts on them, considering that if yourThe  boats pulled away from the shore, with their loads of  laughing,Weston.  But he has not told you what I did there.be  responsible for the Dutch uneasiness.  They saw the Jongvrouw
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050602/2f1bc3bb/attachment.htm
From atin at helixcommunity.org  Thu Jun  2 10:25:36 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Thu Jun  2 10:25:40 2005
Subject: [Server-cvs] engine/core/pub/platform/unix servcallback.h, 1.6.2.7,
	1.6.2.8
Message-ID: 

Update of /cvsroot/server/engine/core/pub/platform/unix
In directory cvs-new:/tmp/cvs-serv2746/pub/platform/unix

Modified Files:
      Tag: SERVER_11_0_STABLE
	servcallback.h 
Log Message:
dumb mistake! it was a change in another platform's #ifdef.


Index: servcallback.h
===================================================================
RCS file: /cvsroot/server/engine/core/pub/platform/unix/servcallback.h,v
retrieving revision 1.6.2.7
retrieving revision 1.6.2.8
diff -u -d -r1.6.2.7 -r1.6.2.8
--- servcallback.h	1 Jun 2005 21:43:08 -0000	1.6.2.7
+++ servcallback.h	2 Jun 2005 17:25:34 -0000	1.6.2.8
@@ -930,8 +930,8 @@
 		 * message (like the keep alive) is written to the socket
 		 * and it fails.
 		 */
-		if (pPollInfo->pReadCB)
-		    pPollInfo->pReadCB->Func();
+		if (pFDInfo->pReadCB)
+		    pFDInfo->pReadCB->Func();
                 remove(-1, nFD);
             }
             else


From atin at helixcommunity.org  Thu Jun  2 12:44:20 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Thu Jun  2 12:44:22 2005
Subject: [Server-cvs] engine/core/pub/platform/unix servcallback.h, 1.6.2.8,
	1.6.2.9
Message-ID: 

Update of /cvsroot/server/engine/core/pub/platform/unix
In directory cvs-new:/tmp/cvs-serv17576/pub/platform/unix

Modified Files:
      Tag: SERVER_11_0_STABLE
	servcallback.h 
Log Message:
fix another build buster.


Index: servcallback.h
===================================================================
RCS file: /cvsroot/server/engine/core/pub/platform/unix/servcallback.h,v
retrieving revision 1.6.2.8
retrieving revision 1.6.2.9
diff -u -d -r1.6.2.8 -r1.6.2.9
--- servcallback.h	2 Jun 2005 17:25:34 -0000	1.6.2.8
+++ servcallback.h	2 Jun 2005 19:44:18 -0000	1.6.2.9
@@ -937,15 +937,15 @@
             else
             {
                 // execute the read callback if the fd is ready for it
-                if (pPollInfo->revents & POLLIN && pPollInfo->pReadCB)
+                if (pPollInfo->revents & POLLIN && pFDInfo->pReadCB)
                 {
-		    pPollInfo->pReadCB->Func();
+		    pFDInfo->pReadCB->Func();
                     (*pNumReads)++;
                 }
                 // execute the write callback if the fd is ready for it
-                if (pPollInfo->revents & POLLOUT && pPollInfo->pWriteCB)
+                if (pPollInfo->revents & POLLOUT && pFDInfo->pWriteCB)
                 {
-		    pPollInfo->pWriteCB->Func();
+		    pFDInfo->pWriteCB->Func();
                     (*pNumWrites)++;
                 }
             }


From dcollins at helixcommunity.org  Thu Jun  2 16:14:46 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Thu Jun  2 16:14:47 2005
Subject: [Server-cvs] common/analysis resolve.pl,1.10,1.11
Message-ID: 

Update of /cvsroot/server/common/analysis
In directory cvs-new:/tmp/cvs-serv27719

Modified Files:
	resolve.pl 
Log Message:
Version 1.9 of this appears to have been checked in as a DOS text file,
converting back to more CVS friendly Unix-style newlines.  No non-whitespace
changes.


Index: resolve.pl
===================================================================
RCS file: /cvsroot/server/common/analysis/resolve.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- resolve.pl	1 Jun 2005 23:51:45 -0000	1.10
+++ resolve.pl	2 Jun 2005 23:14:42 -0000	1.11
@@ -1,509 +1,509 @@
-#!/usr/bin/perl -w
-#
-# ***** BEGIN LICENSE BLOCK *****  
-# Source last modified: $Id$ 
-#   
-# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
-#       
-# The contents of this file, and the files included with this file, 
-# are subject to the current version of the RealNetworks Public 
-# Source License (the "RPSL") available at 
-# http://www.helixcommunity.org/content/rpsl unless you have licensed 
[...987 lines suppressed...]
+
+At present, the only optional flag that can be specified is the
+--echoall flag, which will result in all input lines being echoed
+in the output, with the stacks being resolved in the output.
+
+If you are using plugins with embedded symbols, the 'nm' utility is 
+REQUIRED and MUST BE IN YOUR PATH for this script work. It is used 
+to extract the symbol information from the plugins that contain them.
+There must be a plugin with symbols in the symbols-dir
+corresponding to every plugin that was loaded by the server.
+
+If instead you are using map files, there must be a *.map file
+in the symbols-dir corresponding to every plugin that was
+loaded by the server.
+
+EOF
+exit(1);
+}
+
+


From atin at helixcommunity.org  Thu Jun  2 18:14:38 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Thu Jun  2 18:14:41 2005
Subject: [Server-cvs] engine/core/pub/platform/unix servcallback.h, 1.10,
	1.11
Message-ID: 

Update of /cvsroot/server/engine/core/pub/platform/unix
In directory cvs-new:/tmp/cvs-serv1873/pub/platform/unix

Modified Files:
	servcallback.h 
Log Message:
Synopsis                                                                        
--------                                                                        
on solaris /dev/poll was broken and also, when pthreads was turned on the       
server hung upon startup.                                                       
                                                                                
Reviewer: jcarlton, dcollins                                                    
Branches: SERVER_CURRENT_RN, SERVER_11_0_STABLE_RN                              
                                                                                
Description                                                                     
-----------                                                                     
the solaris /dev/poll code was old and was not updated, so it just needed       
fixing like it is on linux with /dev/epoll.                                     
                                                                                
when pthreads was turned on on solaris, it turns out that the controller        
thread which spawns off the timer thread was getting all of the SIGALRM         
signals being generated by the itimer alarms instead of the timer thread, so    
the timer thread got stuck in the calibration loop and didn't return.           
                                                                                
the fix was to move the actual calibration of the itimer inside the controller  
thread and only after a resolution has been determined does the timer thread    
get spawned with the timer resolution passed in via a member var of the         
UnixTimerInitCallback object.                                                   
                                                                                
                                                                                
Testing Performed                                                               
-----------------
Verifed that it works on solaris 9 (sunos-5.8-sparc-server) on borabora         
    with 1000+ clients at 20+ clients/sec churn playing a 150 kbps clip.        
    500 clients (tcp/udp/cloaked) playing the clip from the local fs            
    500 clients (tcp/udp/cloaked) playing the clips from a nfs mounted fs       
                                                                                
                                                                                
Files Affected                                                                  
--------------                                                                  
server/engine/core/pub/platform/unix/servcallback.h                             
server/engine/core/_main.cpp, pub/_main.h                                       
                                                                                
                                                                                
Platforms Tested                                                                
----------------                                                                
sunos-5.8-sparc-server                                                          
                                                                                
                                                                                
QA Hints
----------------                                                                
Verify that the server works just as well as the process based server, if not   
better.


Index: servcallback.h
===================================================================
RCS file: /cvsroot/server/engine/core/pub/platform/unix/servcallback.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- servcallback.h	26 May 2005 20:48:34 -0000	1.10
+++ servcallback.h	3 Jun 2005 01:14:36 -0000	1.11
@@ -82,8 +82,6 @@
     int           nPollMask;
 } FDInfo;
 
-#  define ACCUMULATE_DEV_POLL_CHANGES
-
 #  ifdef _SOLARIS
 #    include  // for uname()
 #  endif // _SOLARIS
@@ -98,8 +96,6 @@
     int           nPollMask;
 } FDInfo;
 
-//#  define ACCUMULATE_EPOLL_CHANGES
-
 #endif // LINUX_EPOLL_SUPPORT
 
 class Callbacks {
@@ -178,6 +174,7 @@
 #define EPOLL_EVENTS_MAX 1000 //guess for now, make configurable
 #endif
 
+
 inline
 Callbacks::Callbacks()
 {
@@ -208,7 +205,6 @@
 #endif // LINUX_EPOLL_SUPPORT
 }
 
-
 inline
 Callbacks::~Callbacks()
 {
@@ -380,25 +376,11 @@
 #ifdef DEV_POLL_SUPPORT
     if (m_nPollFD >= 0)
     {
-#  ifdef ACCUMULATE_DEV_POLL_CHANGES
-        // add the appropriate poll bit to the mask
         if (type == HX_WRITERS)
-        {
-            m_FDTable[fd].nPollMask |= POLLWRNORM;
-        }
+            m_FDTable[fd].nPollMask |= POLLOUT;
         else
-        {
-            m_FDTable[fd].nPollMask |= POLLRDNORM;
-        }
-
-        if (!m_bAlreadyChanged[fd])
-        {
-            m_pChangedFDs[m_ulNumChanges].fd = fd;
-            m_ulNumChanges++;
-            m_bAlreadyChanged[fd] = TRUE;
-        }
+            m_FDTable[fd].nPollMask |= POLLIN;
 
-#  else
         // we're going to write the changes all at once before polling
         struct pollfd pollInfo;
         pollInfo.fd = fd;
@@ -410,7 +392,6 @@
         {
             perror("error writing FD to poll");
         }
-#  endif // ACCUMULATE_DEV_POLL_CHANGES
 
         return;
     }
@@ -468,7 +449,7 @@
     if (fd >= count || fd < 0)
         return;
 
-#ifndef LINUX_EPOLL_SUPPORT
+#if !defined DEV_POLL_SUPPORT && !defined LINUX_EPOLL_SUPPORT
     enlist[fd] = FALSE;
     ts_memberlist[fd] = FALSE;
 #endif
@@ -481,48 +462,10 @@
         if (type == -1) // disable all behaviour
             m_FDTable[fd].nPollMask = 0;
         else if (type == HX_WRITERS)
-            m_FDTable[fd].nPollMask &= ~POLLWRNORM;
+            m_FDTable[fd].nPollMask &= ~POLLOUT;
         else ///HX_READERS and HX_ACCEPTORS
-            m_FDTable[fd].nPollMask &= ~POLLRDNORM;
-
-#  ifdef ACCUMULATE_DEV_POLL_CHANGES
-        if (!m_bAlreadyRemoved[fd])
-        {
-            m_pRemovedFDs[m_ulNumRemoves].fd = fd;
-            m_ulNumRemoves++;
-            m_bAlreadyRemoved[fd] = TRUE;
-        }
-
-        // only add to the list of changes if we need to write it
-        // back in because the other behaviour is desired
-        if (m_FDTable[fd].nPollMask != 0)
-        {
-            if (!m_bAlreadyChanged[fd])
-            {
-                m_pChangedFDs[m_ulNumChanges].fd = fd;
-                m_ulNumChanges++;
-                m_bAlreadyChanged[fd] = TRUE;
-            }
-        }
-        else if (m_bAlreadyChanged[fd])
-        {
-            // if the fd has been added to the changed list we need to
-            // remove it if the event mask is 0
+            m_FDTable[fd].nPollMask &= ~POLLIN;
 
-            m_bAlreadyChanged[fd] = FALSE;
-            for (int i = 0; i < count; i++)
-            {
-                if (m_pChangedFDs[i].fd == fd)
-                {
-                    // copy the fd at the end of the list over the target
-                    m_pChangedFDs[i].fd = m_pChangedFDs[m_ulNumChanges - 1].fd;
-                    break;
-                }
-            }
-            ASSERT(m_ulNumChanges);
-            m_ulNumChanges--;
-        }
-#  else
         struct pollfd pollInfo;
         pollInfo.fd = fd;
         pollInfo.events = POLLREMOVE;
@@ -546,7 +489,6 @@
                 perror("error adding FD to poll");
             }
         }
-#  endif // ACCUMULATE_DEV_POLL_CHANGES
 
         return;
     }
@@ -784,38 +726,55 @@
         if (m_nTSPos >= m_nReadyFDs)
             return 0;
 
-        while (!m_FDTable[m_pPollMemberList[m_nTSPos].fd].pReadCB ||
-               !ts_memberlist[m_pPollMemberList[m_nTSPos].fd] ||
-               !enlist[m_pPollMemberList[m_nTSPos].fd])
+	int nFD = m_pPollMemberList[m_nTSPos].fd;
+	struct FDInfo* pFDInfo = &m_FDTable[nFD];
+        while (!nFD ||
+	       !ts_memberlist[nFD] ||
+	       !pFDInfo->nPollMask || 
+	       (!pFDInfo->pReadCB && !pFDInfo->pWriteCB))
         {
             m_nTSPos++;
             if (m_nTSPos >= m_nReadyFDs)
                 return 0;
+	    nFD = m_pPollMemberList[m_nTSPos].fd;
+	    pFDInfo = &m_FDTable[nFD];
         }
 
         if (m_bCleanFinish)
         {
             m_bCleanFinish = FALSE;
 
+	    struct pollfd* pPollInfo = &m_pPollMemberList[m_nTSPos];
+
             // remove the fd if it's gone bad
-            if (m_pPollMemberList[m_nTSPos].revents & POLLNVAL)
+            if (pPollInfo->revents & (POLLNVAL | POLLERR | POLLHUP))
             {
-                // fprintf(stderr, "Removing invalid fd %d\n", m_pPollMemberList[m_nTSPos].fd);
+                // fprintf(stderr, "Removing invalid fd %d\n", nFD);
 		/*
 		 * force a read to cause the connection to fail and begin
 		 * cleanup. without this the connection will stay until a 
 		 * message (like the keep alive) is written to the socket
 		 * and it fails.
 		 */
-                m_FDTable[m_pPollMemberList[m_nTSPos].fd].pReadCB->Func();
-                remove(HX_READERS, m_pPollMemberList[m_nTSPos].fd);
+		if (pFDInfo->pReadCB)
+		    pFDInfo->pReadCB->Func();
+                remove(-1, pPollInfo->fd);
             }
             else
             {
-                //XXXtbradley : we need to support TS Writes as well, eventually
-                m_FDTable[m_pPollMemberList[m_nTSPos].fd].pReadCB->Func();
+                // execute the read callback if the fd is ready for it
+		if (pPollInfo->revents & POLLIN && pFDInfo->pReadCB)
+		{
+		    pFDInfo->pReadCB->Func();
                 (*pNumReads)++;
             }
+                // execute the write callback if the fd is ready for it
+		if (pPollInfo->revents & POLLOUT && pFDInfo->pWriteCB)
+		{
+		    pFDInfo->pWriteCB->Func();
+		    (*pNumWrites)++;
+		}
+            }
 
             m_bCleanFinish = TRUE;
         }
@@ -833,49 +792,54 @@
         if (m_nTSPos >= m_nReadyFDs)
             return 0;
 
-        while ((!m_FDTable[m_pEPollEvents[m_nTSPos].data.fd].pReadCB &&
-                !m_FDTable[m_pEPollEvents[m_nTSPos].data.fd].pWriteCB) ||
-               !ts_memberlist[m_pEPollEvents[m_nTSPos].data.fd] ||
-               !m_FDTable[m_pEPollEvents[m_nTSPos].data.fd].nPollMask)
+	int nFD = m_pEPollEvents[m_nTSPos].data.fd;
+	struct FDInfo* pFDInfo = &m_FDTable[nFD];
+        while (!nFD ||
+	       !ts_memberlist[nFD] || 
+	       !pFDInfo->nPollMask ||
+	       (!pFDInfo->pReadCB && !pFDInfo->pWriteCB))
         {
             m_nTSPos++;
             if (m_nTSPos >= m_nReadyFDs)
                 return 0;
+	    nFD = m_pEPollEvents[m_nTSPos].data.fd;
+	    pFDInfo = &m_FDTable[nFD];
         }
 
         if (m_bCleanFinish)
         {
             m_bCleanFinish = FALSE;
+
             struct epoll_event* pEvent = &m_pEPollEvents[m_nTSPos];
 
             // remove the fd if it's gone bad
             if ((pEvent->events & (EPOLLERR | EPOLLHUP)))
             {
-                // fprintf(stderr, "Removing invalid fd %d\n", pEvent->data.fd);
+                // fprintf(stderr, "Removing invalid fd %d\n", nFD);
 		/*
 		 * force a read to cause the connection to fail and begin
 		 * cleanup. without this the connection will stay until a 
 		 * message (like the keep alive) is written to the socket
 		 * and it fails.
 		 */
-		m_FDTable[pEvent->data.fd].pReadCB->Func();
+		if (pFDInfo->pReadCB)
+		    pFDInfo->pReadCB->Func();
                 remove(-1, pEvent->data.fd);
             }
             else
             {
-                // execute the write callback if the fd is ready for it
-                if (pEvent->events & EPOLLOUT)
-                {
-                    m_FDTable[pEvent->data.fd].pWriteCB->Func();
-                    (*pNumWrites)++;
-                }
-
                 // execute the read callback if the fd is ready for it
-                if (pEvent->events & EPOLLIN)
+                if (pEvent->events & EPOLLIN && pFDInfo->pReadCB)
                 {
-                    m_FDTable[pEvent->data.fd].pReadCB->Func();
+                    pFDInfo->pReadCB->Func();
                     (*pNumReads)++;
                 }
+                // execute the write callback if the fd is ready for it
+                if (pEvent->events & EPOLLOUT && pFDInfo->pWriteCB)
+                {
+                    pFDInfo->pWriteCB->Func();
+                    (*pNumWrites)++;
+                }
             }
 
             m_bCleanFinish = TRUE;
@@ -936,46 +900,53 @@
         if (m_nPos >= m_nReadyFDs)
             return 0;
 
-        while ((!m_FDTable[m_pPollMemberList[m_nPos].fd].pReadCB &&
-                !m_FDTable[m_pPollMemberList[m_nPos].fd].pWriteCB) ||
-               ts_memberlist[m_pPollMemberList[m_nPos].fd] ||
-               !enlist[m_pPollMemberList[m_nPos].fd])
+	int nFD = m_pPollMemberList[m_nPos].fd;
+	struct FDInfo* pFDInfo = &m_FDTable[nFD];
+        while (!nFD ||
+	       ts_memberlist[nFD] ||
+	       !pFDInfo->nPollMask ||
+	       !enlist[nFD] || 
+	       (!pFDInfo->pReadCB && !pFDInfo->pWriteCB))
         {
             m_nPos++;
             if (m_nPos >= m_nReadyFDs)
                 return 0;
+	    nFD = m_pPollMemberList[m_nPos].fd;
+	    pFDInfo = &m_FDTable[nFD];
         }
 
         if (m_bCleanFinish)
         {
             m_bCleanFinish = FALSE;
             
+	    struct pollfd* pPollInfo = &m_pPollMemberList[m_nPos];
+
             // remove the fd if it's gone bad
-            if (m_pPollMemberList[m_nPos].revents & POLLNVAL)
+            if (pPollInfo->revents & (POLLNVAL | POLLERR | POLLHUP))
             {
-                // fprintf(stderr, "Removing invalid fd %d\n", m_pPollMemberList[m_nPos].fd);
+                // fprintf(stderr, "Removing invalid fd %d\n", nFD);
 		/*
 		 * force a read to cause the connection to fail and begin
 		 * cleanup. without this the connection will stay until a 
 		 * message (like the keep alive) is written to the socket
 		 * and it fails.
 		 */
-		m_FDTable[m_pPollMemberList[m_nPos].fd].pReadCB->Func();
-                remove(-1, m_pPollMemberList[m_nPos].fd);
+		if (pFDInfo->pReadCB)
+		    pFDInfo->pReadCB->Func();
+                remove(-1, pPollInfo->fd);
             }
             else
             {
                 // execute the read callback if the fd is ready for it
-                if (m_pPollMemberList[m_nPos].revents & POLLRDNORM)
+                if (pPollInfo->revents & POLLIN && pFDInfo->pReadCB)
                 {
-                    m_FDTable[m_pPollMemberList[m_nPos].fd].pReadCB->Func();
+                    pFDInfo->pReadCB->Func();
                     (*pNumReads)++;
                 }
-
                 // execute the write callback if the fd is ready for it
-                if (m_pPollMemberList[m_nPos].revents & POLLWRNORM)
+                if (pPollInfo->revents & POLLOUT && pFDInfo->pWriteCB)
                 {
-                    m_FDTable[m_pPollMemberList[m_nPos].fd].pWriteCB->Func();
+		    pFDInfo->pWriteCB->Func();
                     (*pNumWrites)++;
                 }
             }
@@ -996,48 +967,56 @@
         if (m_nPos >= m_nReadyFDs)
             return 0;
 
-        while ((!m_FDTable[m_pEPollEvents[m_nPos].data.fd].pReadCB &&
-                !m_FDTable[m_pEPollEvents[m_nPos].data.fd].pWriteCB) ||
-               ts_memberlist[m_pEPollEvents[m_nPos].data.fd] ||
-               !m_FDTable[m_pEPollEvents[m_nTSPos].data.fd].nPollMask)
+	int nFD = m_pEPollEvents[m_nPos].data.fd;
+	struct FDInfo* pFDInfo = &m_FDTable[nFD];
+        while (!nFD ||
+	       ts_memberlist[nFD] ||
+	       !pFDInfo->nPollMask ||
+	       !enlist[nFD] || 
+	       (!pFDInfo->pReadCB && !pFDInfo->pWriteCB))
         {
             m_nPos++;
             if (m_nPos >= m_nReadyFDs)
                 return 0;
+	    nFD = m_pEPollEvents[m_nPos].data.fd;
+	    pFDInfo = &m_FDTable[nFD];
         }
 
         if (m_bCleanFinish)
         {
             m_bCleanFinish = FALSE;
+            
             struct epoll_event* pEvent = &m_pEPollEvents[m_nPos];
             
             // remove the fd if it's gone bad
             if ((pEvent->events & (EPOLLERR | EPOLLHUP)))
             {
-                // fprintf(stderr, "Removing invalid fd %d\n", pEvent->data.fd);
+                // fprintf(stderr, "Removing invalid fd %d\n", nFD);
 		/*
 		 * force a read to cause the connection to fail and begin
 		 * cleanup. without this the connection will stay until a 
 		 * message (like the keep alive) is written to the socket
 		 * and it fails.
 		 */
-		m_FDTable[pEvent->data.fd].pReadCB->Func();
-                remove(-1, pEvent->data.fd);
+		if (pFDInfo->pReadCB)
+		    pFDInfo->pReadCB->Func();
+                remove(-1, nFD);
             }
             else
             {
-                // execute the write callback if the fd is ready for it
-                if (pEvent->events & EPOLLOUT)
-                {
-                    m_FDTable[pEvent->data.fd].pWriteCB->Func();
-                    (*pNumWrites)++;
-                }
-
                 // execute the read callback if the fd is ready for it
-                if (pEvent->events & EPOLLIN)
+                if (pEvent->events & EPOLLIN && pFDInfo->pReadCB)
                 {
-                    m_FDTable[pEvent->data.fd].pReadCB->Func();
+                    pFDInfo->pReadCB->Func();
                     (*pNumReads)++;
+		    bOneOp = TRUE;
+                }
+                // execute the write callback if the fd is ready for it
+                if (pEvent->events & EPOLLOUT && pFDInfo->pWriteCB)
+                {
+                    pFDInfo->pWriteCB->Func();
+                    (*pNumWrites)++;
+		    bOneOp = TRUE;
                 }
             }
 
@@ -1191,43 +1170,11 @@
 inline int
 Callbacks::Poll(int timeout)
 {
-#  ifdef ACCUMULATE_DEV_POLL_CHANGES
-    // first remove any FDs that need to be
-    if (m_ulNumRemoves > 0)
-    {
-        if (write(m_nPollFD,
-                  m_pRemovedFDs,
-                  sizeof(struct pollfd) * m_ulNumRemoves)
-            != sizeof(struct pollfd) * m_ulNumRemoves)
-        {
-            perror("error removing FD from poll");
-        }
-
-        m_ulNumRemoves = 0;
-        memset(m_bAlreadyRemoved, 0, count);
-    }
-
-    // now change any fd event masks to what they need to be
-    if (m_ulNumChanges > 0)
-    {
-        for (int i = 0; i < m_ulNumChanges; i++)
-        {
-            m_pChangedFDs[i].events = m_FDTable[m_pChangedFDs[i].fd].nPollMask;
-        }
-
-        if (write(m_nPollFD, m_pChangedFDs,
-                  sizeof(struct pollfd) * m_ulNumChanges)
-            != sizeof(struct pollfd) * m_ulNumChanges)
+    if (m_nPos < m_nReadyFDs || m_nTSPos < m_nReadyFDs)
         {
-            perror("error adding FD to poll");
-        }
-
-        m_ulNumChanges = 0;
-        memset(m_bAlreadyChanged, 0, count);
+        //we still have events to process, don't overwrite the events list
+        return m_nReadyFDs;
     }
-#  endif // ACCUMULATE_DEV_POLL_CHANGES
-
-    // now do the polling
 
     struct dvpoll pollInfo;
     pollInfo.dp_fds = m_pPollMemberList;
@@ -1236,15 +1183,14 @@
 
     m_nReadyFDs = ioctl(m_nPollFD, DP_POLL, &pollInfo);
     if (m_nReadyFDs < 0 && errno != EINTR)
-    {
         perror("/dev/poll ioctl DP_POLL failed");
-    }
 
+    if (m_nReadyFDs < 0)
+        m_nReadyFDs = 0;
     return m_nReadyFDs;
 }
 #endif // DEV_POLL_SUPPORT
 
-
 #ifdef LINUX_EPOLL_SUPPORT
 inline int
 Callbacks::EventPoll(int timeout)
@@ -1255,21 +1201,17 @@
         return m_nReadyFDs;
     }
 
+    // if (!timeout)
+	// timeout = 1;
+
     m_nReadyFDs = epoll_wait(m_nPollFD, m_pEPollEvents, EPOLL_EVENTS_MAX, timeout);
     if (m_nReadyFDs < 0 && errno != EINTR && errno != 0)
-    {
         perror("epoll_wait failed");
-    }
 
     if (m_nReadyFDs < 0)
-    {
         m_nReadyFDs = 0;
-    }
-
     return m_nReadyFDs;
 }
 #endif // LINUX_EPOLL_SUPPORT
-
-
 
 #endif/*_CALLBACK_H_*/


From atin at helixcommunity.org  Thu Jun  2 18:15:35 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Thu Jun  2 18:15:37 2005
Subject: [Server-cvs] engine/core _main.cpp,1.91,1.92
Message-ID: 

Update of /cvsroot/server/engine/core
In directory cvs-new:/tmp/cvs-serv6171

Modified Files:
	_main.cpp 
Log Message:
Synopsis                                                                        
--------                                                                        
on solaris /dev/poll was broken and also, when pthreads was turned on the       
server hung upon startup.                                                       
                                                                                
Reviewer: jcarlton, dcollins                                                    
Branches: SERVER_CURRENT_RN, SERVER_11_0_STABLE_RN                              
                                                                                
Description                                                                     
-----------                                                                     
the solaris /dev/poll code was old and was not updated, so it just needed       
fixing like it is on linux with /dev/epoll.                                     
                                                                                
when pthreads was turned on on solaris, it turns out that the controller        
thread which spawns off the timer thread was getting all of the SIGALRM         
signals being generated by the itimer alarms instead of the timer thread, so    
the timer thread got stuck in the calibration loop and didn't return.           
                                                                                
the fix was to move the actual calibration of the itimer inside the controller  
thread and only after a resolution has been determined does the timer thread    
get spawned with the timer resolution passed in via a member var of the         
UnixTimerInitCallback object.                                                   
                                                                                
                                                                                
Testing Performed                                                               
-----------------
Verifed that it works on solaris 9 (sunos-5.8-sparc-server) on borabora         
    with 1000+ clients at 20+ clients/sec churn playing a 150 kbps clip.        
    500 clients (tcp/udp/cloaked) playing the clip from the local fs            
    500 clients (tcp/udp/cloaked) playing the clips from a nfs mounted fs       
                                                                                
                                                                                
Files Affected                                                                  
--------------                                                                  
server/engine/core/pub/platform/unix/servcallback.h                             
server/engine/core/_main.cpp, pub/_main.h                                       
                                                                                
                                                                                
Platforms Tested                                                                
----------------                                                                
sunos-5.8-sparc-server                                                          
                                                                                
                                                                                
QA Hints                                                                        
--------
Verify that the server works just as well as the process based server, if not   
better.


Index: _main.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/_main.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- _main.cpp	26 May 2005 20:48:32 -0000	1.91
+++ _main.cpp	3 Jun 2005 01:15:33 -0000	1.92
@@ -342,6 +342,7 @@
 
 #ifdef PTHREADS_SUPPORTED
 INT32 g_ControllerTid = -1;
+BOOL g_bUnixThreads = TRUE;
 #endif // PTHREADS_SUPPORTED
 
 extern BOOL g_bDisableInternalResolver;
@@ -412,7 +413,8 @@
 BOOL g_bEFenceProtectFreedMemory = FALSE;
 #endif
 
-#define CP_CREATE_SOCKET              1
+#define CP_CREATE_SOCKET              0x1
+#define CP_FORK_PROCESS               0x2
 
 static const int zMaxOpenFDs = 32767;
 
@@ -427,10 +429,6 @@
     _syscall1(int, get_segv_eip, void**, peip);
 #endif
 
-#ifdef PTHREADS_SUPPORTED
-    BOOL g_bUnixThreads = TRUE;
-#endif // PTHREADS_SUPPORTED
-
 #if defined PTHREADS_SUPPORTED || defined _LINUX
 UINT32 g_ulThreadStackSize = 1024 * 1024;
 #endif // defined PTHREADS_SUPPORTED || defined _LINUX
@@ -1455,7 +1453,7 @@
 {
 
 #if defined PTHREADS_SUPPORTED
-    if (g_bUnixThreads)
+    if (g_bUnixThreads && !(flags & CP_FORK_PROCESS))
         return MakeThread(processname, cb, dispatch_queue, flags);
 #endif // defined PTHREADS_SUPPORTED
 
@@ -1475,8 +1473,20 @@
             socketpair(AF_UNIX, SOCK_STREAM, 0, s);
         }
 
-#if defined _LINUX && !defined PTHREADS_SUPPORTED
-        if (g_ulLinuxUseMmapShared)
+#if defined _LINUX && defined PTHREADS_SUPPORTED
+        if (flags & CP_FORK_PROCESS)
+        {
+            linux_fork_data* pData = new linux_fork_data;
+            pData->processname = processname;
+            pData->cb = cb;
+            pData->dispatch_queue = dispatch_queue;
+            pData->flags = flags;
+            pData->proc = proc;
+            pData->process_number = process_number;
+            pid = linuxfork(linuxfork2, pData);
+        }
+#elif defined _LINUX && !defined PTHREADS_SUPPORTED
+        else if (g_ulLinuxUseMmapShared)
         {
             /* New Random seed! */
             srand((unsigned)time(NULL) + process_number);
@@ -5726,6 +5736,16 @@
         &MonitorAliveChecker, NULL, &dwSomeMSParam);
 #endif
 
+#ifdef PTHREADS_SUPPORTED
+#ifdef _LINUX
+    suprintf("Starting PID %lu TID %lu/%d, procnum 0 (controller)\n",
+           getpid(), pthread_self(), gettid());
+#else
+    suprintf("Starting PID %lu TID %lu, procnum 0 (controller)\n",
+           getpid(), pthread_self());
+#endif
+#endif
+
     Process* proc;
     int procnum;
     DispatchQueue* dq;
@@ -6219,7 +6239,7 @@
 
     *pTimerProcInitMutex = 1;
     UnixTimerInitCallback* tcb = new UnixTimerInitCallback;
-    MakeProcess("timer", tcb, dq, 0);
+    MakeProcess("timer", tcb, dq, CP_FORK_PROCESS);
     while (*pTimerProcInitMutex)
         microsleep(1);
 


From Linnie at gaydata.com  Thu Jun  2 18:56:03 2005
From: Linnie at gaydata.com (Linnie Valentin)
Date: Thu Jun  2 18:56:11 2005
Subject: [Server-cvs] Re: Like a  light switch turned on
Message-ID: 

Hello, 
Standing beside Captain Blood, he looked astern, following  theapprehensively.man to apply to me.  Still, considering that ye  willingly did meclosely followed by one who in every particular, save  that oftook his prisoner by the breast of his doublet and shook  him.There was a fight in the Windward Passage at the outset with ahis  patient.  But there was no response to his greeting.  Instead,the  risks and studied how to lessen them.  In these desperateThat'll be  the signal to lie to, said Blood, in the same listlessBlood received  word that the Deputy-Governor begged to be allowedto answer.  What do  you seek aboard my ship?a-roving for the sheer love of it,  considering that this spirit wasit was densely wooded to the water's  edge.  The eyes of theanswered thereafter, as was required of him,  that he would be triedThis deputy proved to be an officer named  Calverley, a vigorous,Enthroned upon an empty cask sat the French  filibuster to transact
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050602/8ebfce96/attachment.htm
From atin at helixcommunity.org  Thu Jun  2 23:35:17 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Thu Jun  2 23:35:19 2005
Subject: [Server-cvs] engine/core/pub/platform/unix servcallback.h, 1.11,
	1.12
Message-ID: 

Update of /cvsroot/server/engine/core/pub/platform/unix
In directory cvs-new:/tmp/cvs-serv5949/pub/platform/unix

Modified Files:
	servcallback.h 
Log Message:
yet another build buster on head by atin ;-b


Index: servcallback.h
===================================================================
RCS file: /cvsroot/server/engine/core/pub/platform/unix/servcallback.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- servcallback.h	3 Jun 2005 01:14:36 -0000	1.11
+++ servcallback.h	3 Jun 2005 06:35:15 -0000	1.12
@@ -1009,14 +1009,12 @@
                 {
                     pFDInfo->pReadCB->Func();
                     (*pNumReads)++;
-		    bOneOp = TRUE;
                 }
                 // execute the write callback if the fd is ready for it
                 if (pEvent->events & EPOLLOUT && pFDInfo->pWriteCB)
                 {
                     pFDInfo->pWriteCB->Func();
                     (*pNumWrites)++;
-		    bOneOp = TRUE;
                 }
             }
 


From atin at helixcommunity.org  Fri Jun  3 13:00:21 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Fri Jun  3 13:00:21 2005
Subject: [Server-cvs] engine/core hxprotmgr.cpp,1.5,1.6
Message-ID: 

Update of /cvsroot/server/engine/core
In directory cvs-new:/tmp/cvs-serv5634

Modified Files:
	hxprotmgr.cpp 
Log Message:
Synopsis                                                                        
========                                                                        
a socket leak was happening in the core process (thread) in the server under
load with churn where clients were connecting and disconnecting rapidly.   

Branches: HEAD, SERVER_11_0_STABLE                                              
Suggested Reviewer: jcarlton, dcollins


Description                                                                     
===========                                                                     
the HXSocketConnection object (which is the first IHXSocketResponse object for
the TCP socket) didn't call IHXSocket::Close() when it received a               
HX_SOCK_EVENT_CLOSE, so if such an event did happen then the socket leaked. 
                                                                             
the way to repro this on solaris was to run the server with a decent load with
churn (close to 100% cpu usage) and watch the 3rd column of the rss output   
line "Registered FDs:" increase with time.                                      

the fix was to call IHXSocket::Close() when it received a HX_SOCK_EVENT_CLOSE.


Files Affected                                                                  
==============                                                                  
server/engine/core/hxprotmgr.cpp                                                


Testing Performed                                                               
=================                                                               
Unit Tests:                                                                     
- test the server with 800+ clients tcp/udp/cloaked playing a 150 kbps rm file
  for 40 seconds, generating a churn of 20+ client/sec with realsim and latest
  helixsim clients.                                                             

Integration Tests:                                                              
- None.                                                                         

Leak Tests:                                                                     
- same as unit test.                                                                                                                                                         

Performance Tests:                                                              
- None.                                                                         

Platforms Tested: sunos-5.8-sparc-server, linux-rhel4-i686
Build verified:   sunos-5.8-sparc-server, linux-rhel4-i686                      


QA Hints                                                                        
===============                                                                 
under load with churn the core proc's "Registered FDs" (3rd number in the rss 
line) should not increase as time goes on.


Index: hxprotmgr.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/hxprotmgr.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- hxprotmgr.cpp	24 Aug 2004 21:37:29 -0000	1.5
+++ hxprotmgr.cpp	3 Jun 2005 20:00:18 -0000	1.6
@@ -268,6 +268,7 @@
         HX_RELEASE(pBuf);
         break;
     case HX_SOCK_EVENT_CLOSE:
+	m_pSock->Close();
         HX_RELEASE(m_pSock);
         break;
     case HX_SOCK_EVENT_DISPATCH:


From atin at helixcommunity.org  Fri Jun  3 13:03:11 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Fri Jun  3 13:03:13 2005
Subject: [Server-cvs] engine/core hxprotmgr.cpp,1.5,1.5.2.1
Message-ID: 

Update of /cvsroot/server/engine/core
In directory cvs-new:/tmp/cvs-serv13160

Modified Files:
      Tag: SERVER_11_0_STABLE
	hxprotmgr.cpp 
Log Message:
Synopsis                                                                        
========                                                                        
a socket leak was happening in the core process (thread) in the server under    
load with churn where clients were connecting and disconnecting rapidly.        

Branches: HEAD, SERVER_11_0_STABLE                                              
Suggested Reviewer: jcarlton                                                      


Description                                                                     
===========                                                                     
the HXSocketConnection object (which is the first IHXSocketResponse object for  
the TCP socket) didn't call IHXSocket::Close() when it received a               
HX_SOCK_EVENT_CLOSE, so if such an event did happen then the socket leaked.     

the way to repro this on solaris was to run the server with a decent load with  
churn (close to 100% cpu usage) and watch the 3rd column of the rss output      
line "Registered FDs:" increase with time.                                      

the fix was to call IHXSocket::Close() when it received a HX_SOCK_EVENT_CLOSE.  


Files Affected                                                                  
==============                                                                  
server/engine/core/hxprotmgr.cpp                                                


Testing Performed
=================
Unit Tests: 
- test the server with 800+ clients tcp/udp/cloaked playing a 150 kbps rm file  
  for 40 seconds, generating a churn of 20+ client/sec with realsim and latest
helixsim clients.

Integration Tests:                                                              
- None.                                                                         

Leak Tests:                                                                     
- None.                                                                         

Performance Tests:                                                              
- None.                                                                         

Platforms Tested: sunos-5.8-sparc-server, linux-rhel4-i686                      
Build verified:   sunos-5.8-sparc-server, linux-rhel4-i686


QA Hints
=============== 
under load with churn the core proc's "Registered FDs" (3rd number in the rss 
line) should not increase as time goes on.


Index: hxprotmgr.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/hxprotmgr.cpp,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- hxprotmgr.cpp	24 Aug 2004 21:37:29 -0000	1.5
+++ hxprotmgr.cpp	3 Jun 2005 20:03:08 -0000	1.5.2.1
@@ -268,6 +268,7 @@
         HX_RELEASE(pBuf);
         break;
     case HX_SOCK_EVENT_CLOSE:
+	m_pSock->Close();
         HX_RELEASE(m_pSock);
         break;
     case HX_SOCK_EVENT_DISPATCH:


From LadnAegle_4358 at garber.com  Sat Jun  4 02:30:59 2005
From: LadnAegle_4358 at garber.com (Aegle Ladner)
Date: Sat Jun  4 02:31:12 2005
Subject: [Server-cvs] Re: Works  Wonders
Message-ID: 

Hello, 
others who overheard them, as they showed at a council held thatSpaniards.of it, returned empty-handed to Port Royal, there to find awaitingIt may have been a couple of hours later, when Captain Blood, asSteed's proclamation?  Ye'll have read it, no doubt?exposition of the circumstances.  In that amazement he left her, andHe knew not which was the greater lie.  For Mr. Blood had spent abeen too credulous of all the unspeakable things attributed to Peterthe affair might have ended in a very different manner.  But,The well-beloved hero was moved to the soul of him by thatyour corpse'll be carried out of it.  Ye mangy hound, d'ye daredecision.stern.  Nor were they as vigilant as they should have been, or elseremained yet to be probed.  That the Cinco Llagas was now in friendlyPeter Blood, stripped of his coat, the sleeves of his coarse shirtand who commands this expedition.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050604/dad5130a/attachment.htm
From Wilk at kaufmanfire.com  Sun Jun  5 11:39:00 2005
From: Wilk at kaufmanfire.com (Anantha Wilks)
Date: Sun Jun  5 11:39:17 2005
Subject: [Server-cvs] Re: Hi Aggain
Message-ID: 

Hello, 
a gorgeous butterfly, that was like black and scarlet velvet andcomplete pirate.  There was not another buccaneer in all theother had been sunk, but not before the English ship had transferredTHE REBELS-CONVICTAn amende.  In my mind I dishonoured you by deeming you his like,he roundly expressed his disapproval.  The Dutch were a friendlyAstronomy, is it?  Faith, now, I couldn't tell the Belt of Orionmight follow some other leader.Whither has Wolverstone gone?his acquaintance there.by surprise.although they failed on this occasion to observe the slight changetwo spectators on the poop, and increased the admiring wonder inwhich Blood became guilty in those days of inaction, thereby sinkingclattering towards them from beyond the corner round which she hadExpecting? Dyke stared at him, open-mouthed.  Was you expecting
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050605/22ceba1d/attachment.htm
From HiteAnania at gammonindia.com  Mon Jun  6 10:16:54 2005
From: HiteAnania at gammonindia.com (Ananias Hite)
Date: Mon Jun  6 10:17:04 2005
Subject: [Server-cvs] Re: I don't waait anymore
Message-ID: 

Hello, 
rigging of the Spanish vessels, riding at anchor less than a quarterblunderers.at last, and was venting his fury in unprintable abuse.  CaptainOn the mole at Port Royal, under the low, embattled wall of the fort,his great height looked down sardonically upon Lord Julian, tallfor what I want.hold at once an impartial investigation into the affair, and thewell that you should understand it.round to face his lordship with that question.  Later he was toWhy, so you shall, villain; so you shall.  His lordship's voicework, for the blood you have murderously shed, and for your violenceus, it is for us to fulfil the pledges.  The articles are confirmed,But this is the man I meant, she said.vigorously that the council was relieved by Captain Blood's own actThese wounded men were conveyed to a long shed on the wharf, andGallantry will often win through, even against overwhelming
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050606/18edb306/attachment.htm
From darrick at helixcommunity.org  Mon Jun  6 20:03:26 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Mon Jun  6 20:03:28 2005
Subject: [Server-cvs] datatype/common/pktskim/unittest Umakefil, 1.1.2.2,
	1.1.2.3 testpktskim.cpp, 1.1.2.4, 1.1.2.5
Message-ID: 

Update of /cvsroot/server/datatype/common/pktskim/unittest
In directory cvs:/tmp/cvs-serv28893/unittest

Modified Files:
      Tag: SERVER_11_0_STABLE
	Umakefil testpktskim.cpp 
Log Message:
Synopsis
========
Apply suggestions from CR meeting to pktskimmer.

Branches: SERVER_11_0_STABLE_RN
CR: ghori, jzeng, ssmith, mtuncer


Description
===========
Applied bug fixes/efficiency tuning suggestions from CR meeting to the packet skimmer objects.


Build verified: win32-i386-vc7, linux-rhel4, sunos-5.9



Index: Umakefil
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/unittest/Umakefil,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- Umakefil	31 May 2005 21:35:27 -0000	1.1.2.2
+++ Umakefil	7 Jun 2005 03:03:23 -0000	1.1.2.3
@@ -1,7 +1,7 @@
 # ***** BEGIN LICENSE BLOCK *****  
 # Source last modified: $Id$ 
 #   
-# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+# Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
 #       
 # The contents of this file, and the files included with this file, 
 # are subject to the current version of the RealNetworks Public 

Index: testpktskim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/unittest/testpktskim.cpp,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- testpktskim.cpp	31 May 2005 21:35:27 -0000	1.1.2.4
+++ testpktskim.cpp	7 Jun 2005 03:03:23 -0000	1.1.2.5
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 


From darrick at helixcommunity.org  Mon Jun  6 20:03:25 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Mon Jun  6 20:03:28 2005
Subject: [Server-cvs] datatype/common/pktskim Umakefil, 1.1.2.2,
	1.1.2.3 h263skim.cpp, 1.1.2.2, 1.1.2.3 h263skim.h, 1.1.2.1,
	1.1.2.2 h264skim.cpp, 1.1.2.1, 1.1.2.2 mp4skim.cpp, 1.1.2.2,
	1.1.2.3 skimbase.cpp, 1.1.2.2, 1.1.2.3 skimbase.h, 1.1.2.2, 1.1.2.3
Message-ID: 

Update of /cvsroot/server/datatype/common/pktskim
In directory cvs:/tmp/cvs-serv28893

Modified Files:
      Tag: SERVER_11_0_STABLE
	Umakefil h263skim.cpp h263skim.h h264skim.cpp mp4skim.cpp 
	skimbase.cpp skimbase.h 
Log Message:
Synopsis
========
Apply suggestions from CR meeting to pktskimmer.

Branches: SERVER_11_0_STABLE_RN
CR: ghori, jzeng, ssmith, mtuncer


Description
===========
Applied bug fixes/efficiency tuning suggestions from CR meeting to the packet skimmer objects.


Build verified: win32-i386-vc7, linux-rhel4, sunos-5.9



Index: h264skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/h264skim.cpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- h264skim.cpp	26 May 2005 18:18:10 -0000	1.1.2.1
+++ h264skim.cpp	7 Jun 2005 03:03:23 -0000	1.1.2.2
@@ -243,6 +243,7 @@
 
    
     if (FAILED(hr = GetRTPPacketInfo(pRTPHdr, 
+                                     uiPayloadSize,
                                      ulPacketInfo,
                                      pH264Hdr)))
     {

Index: skimbase.h
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/skimbase.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- skimbase.h	26 May 2005 18:18:10 -0000	1.1.2.2
+++ skimbase.h	7 Jun 2005 03:03:23 -0000	1.1.2.3
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 
@@ -35,6 +35,8 @@
  *   
  * ***** END LICENSE BLOCK ***** */  
 
+#include 
+#include 
 
 // PacketInfo mask flags.
 
@@ -83,8 +85,35 @@
     void DebugOut(UINT32 ulDebugLevel, const char* szFormat, ...);
 
     HX_RESULT GetRTPPacketInfo(BYTE* pRTPPkt,
+                               UINT32 ulPktLen,
                                UINT32& ulPacketInfo,
                                BYTE*& pPayloadStart);
     UINT32 m_ulRefCount;
     UINT32 m_ulDebugLevel;
 };
+
+
+///////////////////////////////////////////////////////////////////////////////
+// PacketSkimmer::DebugOut() - output debugging info for given debuglevel
+// args: ulDebugLevel - debug level to output at, see skimbase.h
+//       szFormat - printf style format string
+//       ... - printf style var args
+///////////////////////////////////////////////////////////////////////////////
+
+inline void
+PacketSkimmer::DebugOut(UINT32 ulDebugLevel,
+                        const char* szFormat,
+                        ...)
+{
+    if (!(m_ulDebugLevel & ulDebugLevel))
+    {
+        return;
+    }
+
+    va_list args;
+    va_start(args, szFormat);
+    vfprintf(stderr, szFormat, args);
+    va_end(args);
+}
+
+

Index: skimbase.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/skimbase.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- skimbase.cpp	31 May 2005 21:35:26 -0000	1.1.2.2
+++ skimbase.cpp	7 Jun 2005 03:03:23 -0000	1.1.2.3
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 
@@ -44,9 +44,11 @@
 
 #include "hxcom.h"
 #include "hxengin.h"
+#include "hxmarsh.h"
 
 #include "skimbase.h"
 
+
 ///////////////////////////////////////////////////////////////////////////////
 // PacketSkimmer::PacketSkimmer()
 ///////////////////////////////////////////////////////////////////////////////
@@ -112,30 +114,6 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-// PacketSkimmer::DebugOut() - output debugging info for given debuglevel
-// args: ulDebugLevel - debug level to output at, see skimbase.h
-//       szFormat - printf style format string
-//       ... - printf style var args
-///////////////////////////////////////////////////////////////////////////////
-
-void
-PacketSkimmer::DebugOut(UINT32 ulDebugLevel,
-                        const char* szFormat,
-                        ...)
-{
-    if (!(m_ulDebugLevel & ulDebugLevel))
-    {
-        return;
-    }
-
-    va_list args;
-    va_start(args, szFormat);
-    vfprintf(stderr, szFormat, args);
-    va_end(args);
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
 // PacketSkimmer::GetRTPPacketInfo() - skim RTP header for relevant info
 //
 // See RFC1889 for RTP packet format info.
@@ -148,15 +126,16 @@
 
 HX_RESULT 
 PacketSkimmer::GetRTPPacketInfo(BYTE* pRTPPkt,
+                                UINT32 ulPktLen,
                                 UINT32& ulPacketInfo,
                                 BYTE*& pPayloadStart)
 {
     pPayloadStart = NULL;
-    UINT8 uiRTPVer    = 0 | (pRTPPkt[0] >> 6) & 0x03;
+    UINT8 uiRTPVer    = (pRTPPkt[0] >> 6) & 0x03;
 
-    // Enforce supported RTP version.
+    // Enforce supported RTP version and minimum pkt length
 
-    if (uiRTPVer != 2)
+    if (uiRTPVer != 2 || ulPktLen < 12)
     {
         return HXR_INVALID_PARAMETER;
     }
@@ -164,10 +143,14 @@
     // Extension hdr length and CSRC count.
     // These affect the total header length.
 
-    UINT8 uiRTPExt    = 0 | ((pRTPPkt[0] >> 4) & 1);
+    UINT8 uiRTPExt    = ((pRTPPkt[0] >> 4) & 1);
     UINT8 uiRTPCC     = pRTPPkt[0] & 0x0F;
 
 
+    // Currently all datatypes use marker bit to denote frame end.
+    // In the future if a datatype does NOT use marker bit in this way,
+    // this code will have to change!
+
     UINT8 uiRTPMarker = ((pRTPPkt[1] >> 7) & 1);
 
     if (uiRTPMarker)
@@ -178,8 +161,7 @@
     // Pkt type and seq no only used for debug output
     UINT8 uiRTPPT     = pRTPPkt[1] & 0x7F;
 
-    UINT16 uiRTPSeqNo = ((UINT16)pRTPPkt[2] << 8) & 0xFF00;
-    uiRTPSeqNo |= pRTPPkt[3];
+    UINT16 uiRTPSeqNo = getshort( &(pRTPPkt[2]) );
 
 
     DebugOut(SKIM_DBG_RTP_VERBOSE, 
@@ -204,8 +186,7 @@
     {
         BYTE* pRTPExt = pPayloadStart; 
 
-        UINT16 uiRTPExtLen = ((UINT16)pRTPExt[2] << 8) & 0xFF00;
-        uiRTPExtLen |= pRTPExt[3];
+        UINT16 uiRTPExtLen = getshort( &(pRTPExt[2]) );
 
         DebugOut(SKIM_DBG_RTP_VERBOSE, "RTPExt: Len: %u\n", uiRTPExtLen);
 

Index: h263skim.h
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/h263skim.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- h263skim.h	17 May 2005 22:56:36 -0000	1.1.2.1
+++ h263skim.h	7 Jun 2005 03:03:23 -0000	1.1.2.2
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 

Index: Umakefil
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/Umakefil,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- Umakefil	26 May 2005 18:18:10 -0000	1.1.2.2
+++ Umakefil	7 Jun 2005 03:03:23 -0000	1.1.2.3
@@ -1,7 +1,7 @@
 # ***** BEGIN LICENSE BLOCK *****  
 # Source last modified: $Id$ 
 #   
-# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+# Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
 #       
 # The contents of this file, and the files included with this file, 
 # are subject to the current version of the RealNetworks Public 
@@ -41,6 +41,7 @@
 project.AddModuleIncludes("common/include", 
                           "server/include",
                           "common/dbgtool/pub",
+                          "common/util/pub",
                           "server/common/util/pub")
 
 project.AddSources("skimbase.cpp", 

Index: mp4skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/mp4skim.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- mp4skim.cpp	3 Jun 2005 21:33:03 -0000	1.1.2.2
+++ mp4skim.cpp	7 Jun 2005 03:03:23 -0000	1.1.2.3
@@ -79,6 +79,7 @@
 
    
     if (FAILED(hr = GetRTPPacketInfo(pRTPHdr, 
+                                     pPacket->GetSize(),
                                      ulPacketInfo,
                                      pMP4Hdr)))
     {

Index: h263skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/h263skim.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- h263skim.cpp	31 May 2005 21:35:26 -0000	1.1.2.2
+++ h263skim.cpp	7 Jun 2005 03:03:23 -0000	1.1.2.3
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 
@@ -46,6 +46,7 @@
 
 #include "skimbase.h"
 #include "h263skim.h"
+#include "hxassert.h"
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -71,6 +72,8 @@
 {
     HX_RESULT hr = HXR_OK;
 
+    UINT32 ulReqdPktLen = 0;
+
     UINT8 uiH263PTypeFmt = 0;
     UINT8 uiFrameType = 0;
     UINT8 uiH263UFEP = 0;
@@ -83,27 +86,36 @@
     UINT8 uiH263PLen  = 0;
     UINT8 uiH263PEBit = 0;
 
+
     BYTE* pRTPHdr = (BYTE*)pPacket->GetBuffer();
+    UINT32 ulPktLen = pPacket->GetSize();
+
     BYTE* pH263Hdr = NULL;
     BYTE* pH263Payload = NULL;
    
-    ulPacketInfo = 0;
+    ulPacketInfo = 0;    
 
     // Enforce minimum size: RTP hdr(12) + H263 hdr(2) + H263 payload(3).
 
-    if (pPacket->GetSize() < 17) 
-    {
-        hr = HXR_INVALID_PARAMETER;
-        goto bail;
-    }
-
     if (FAILED(hr = GetRTPPacketInfo(pRTPHdr, 
+                                     ulPktLen,
                                      ulPacketInfo,
                                      pH263Hdr)))
     {
-        goto bail;
+        return hr;
     }
 
+    HX_ASSERT(pH263Hdr);
+
+    // min. len  =  rtp hdr len         + min. H263 hdr length                 
+    ulReqdPktLen = (pH263Hdr - pRTPHdr) + 2;
+
+    // Minimum req'd RTP hdr missing!
+    if (ulPktLen < ulReqdPktLen)
+    {
+        ulPacketInfo = 0;
+        return HXR_INVALID_PARAMETER;
+    }
 
     ////// Scan H263 Header
 
@@ -145,18 +157,26 @@
     // Enforce all-zero H263 reserved bits.
     if (uiH263RR) 
     {
-        hr = HXR_INVALID_PARAMETER;
-        goto bail;
+        ulPacketInfo = 0;
+        return HXR_INVALID_PARAMETER;
     }
 
 
     ///// Scan H263 Payload
 
-    
+    // reqd len  += 1 byte vrc hdr + extra picture hdr + minimum payload size
+    ulReqdPktLen += uiH263VBit + uiH263PLen + 3;
+
+    // Ensure that there's valid payload.
+    if (ulPktLen < ulReqdPktLen)
+    {
+        ulPacketInfo = 0;
+        return HXR_INVALID_PARAMETER;        
+    }
+
     // 2 byte for minimum hdr + 1 byte VRC hdr + extra picture hdr
     pH263Payload = pH263Hdr + 2 + uiH263VBit + uiH263PLen;
 
-
     // Contents: 6-bit picture start code (PSC)
     //           8-bit temporal reference (TR)
     //           n-bit PTYPE (at least 8 bit)
@@ -176,6 +196,9 @@
     
     if (uiH263PTypeFmt == 0x07) // PLUSPTYPE header present
     {
+        // At least one more byte required for PLUSPTYPE info.
+        ulReqdPktLen++;
+
         uiFrameType = 0;
 
         // PLUSPTYPE Contents:
@@ -188,6 +211,15 @@
 
         uiH263UFEP = ((pH263Payload[2] << 1) | pH263Payload[3] >> 7) & 0x07;
 
+        ulReqdPktLen += uiH263UFEP ? 1 : 0;
+
+        // Ensure that there's actually PLUSPTYPE information.
+        if (ulPktLen < ulReqdPktLen)
+        {
+            ulPacketInfo = 0;
+            return HXR_INVALID_PARAMETER;        
+        }
+
         if (uiH263UFEP == 1) // OPPTYPE present, then MPPTYPE
         {
             uiFrameType = (pH263Payload[5] >> 2) & 0x07;
@@ -224,11 +256,6 @@
     }
 
     return hr;
-
-bail: // Failure.
-
-    ulPacketInfo = 0;
-    return hr;
 }
 
 
@@ -304,4 +331,4 @@
                  szFrameType);
     }
 
-}
\ No newline at end of file
+}


From darrick at helixcommunity.org  Mon Jun  6 20:06:40 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Mon Jun  6 20:06:43 2005
Subject: [Server-cvs] 
	datatype/common/pktskim Umakefil, 1.3, 1.4 h263skim.cpp,
	1.3, 1.4 h263skim.h, 1.2, 1.3 h264skim.cpp, 1.2,
	1.3 h264skim.h, 1.2, 1.3 mp4skim.cpp, 1.3, 1.4 mp4skim.h, 1.2,
	1.3 skimbase.cpp, 1.3, 1.4 skimbase.h, 1.2, 1.3
Message-ID: 

Update of /cvsroot/server/datatype/common/pktskim
In directory cvs:/tmp/cvs-serv32765

Modified Files:
	Umakefil h263skim.cpp h263skim.h h264skim.cpp h264skim.h 
	mp4skim.cpp mp4skim.h skimbase.cpp skimbase.h 
Log Message:
Synopsis
========
Apply suggestions from CR meeting to pktskimmer.

Branches: SERVER_11_0_STABLE_RN
CR: ghori, jzeng, ssmith, mtuncer


Description
===========
Applied bug fixes/efficiency tuning suggestions from CR meeting to the packet skimmer objects.


Build verified: win32-i386-vc7, linux-rhel4, sunos-5.9



Index: h264skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/h264skim.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- h264skim.cpp	26 May 2005 18:22:51 -0000	1.2
+++ h264skim.cpp	7 Jun 2005 03:06:37 -0000	1.3
@@ -243,6 +243,7 @@
 
    
     if (FAILED(hr = GetRTPPacketInfo(pRTPHdr, 
+                                     uiPayloadSize,
                                      ulPacketInfo,
                                      pH264Hdr)))
     {


Index: skimbase.h
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/skimbase.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- skimbase.h	17 May 2005 23:37:50 -0000	1.2
+++ skimbase.h	7 Jun 2005 03:06:37 -0000	1.3
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 
@@ -35,6 +35,8 @@
  *   
  * ***** END LICENSE BLOCK ***** */  
 
+#include 
+#include 
 
 // PacketInfo mask flags.
 
@@ -83,8 +85,35 @@
     void DebugOut(UINT32 ulDebugLevel, const char* szFormat, ...);
 
     HX_RESULT GetRTPPacketInfo(BYTE* pRTPPkt,
+                               UINT32 ulPktLen,
                                UINT32& ulPacketInfo,
                                BYTE*& pPayloadStart);
     UINT32 m_ulRefCount;
     UINT32 m_ulDebugLevel;
-};
\ No newline at end of file
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+// PacketSkimmer::DebugOut() - output debugging info for given debuglevel
+// args: ulDebugLevel - debug level to output at, see skimbase.h
+//       szFormat - printf style format string
+//       ... - printf style var args
+///////////////////////////////////////////////////////////////////////////////
+
+inline void
+PacketSkimmer::DebugOut(UINT32 ulDebugLevel,
+                        const char* szFormat,
+                        ...)
+{
+    if (!(m_ulDebugLevel & ulDebugLevel))
+    {
+        return;
+    }
+
+    va_list args;
+    va_start(args, szFormat);
+    vfprintf(stderr, szFormat, args);
+    va_end(args);
+}
+
+


Index: h263skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/h263skim.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- h263skim.cpp	31 May 2005 21:38:06 -0000	1.3
+++ h263skim.cpp	7 Jun 2005 03:06:37 -0000	1.4
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 
@@ -46,6 +46,7 @@
 
 #include "skimbase.h"
 #include "h263skim.h"
+#include "hxassert.h"
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -71,6 +72,8 @@
 {
     HX_RESULT hr = HXR_OK;
 
+    UINT32 ulReqdPktLen = 0;
+
     UINT8 uiH263PTypeFmt = 0;
     UINT8 uiFrameType = 0;
     UINT8 uiH263UFEP = 0;
@@ -83,27 +86,36 @@
     UINT8 uiH263PLen  = 0;
     UINT8 uiH263PEBit = 0;
 
+
     BYTE* pRTPHdr = (BYTE*)pPacket->GetBuffer();
+    UINT32 ulPktLen = pPacket->GetSize();
+
     BYTE* pH263Hdr = NULL;
     BYTE* pH263Payload = NULL;
    
-    ulPacketInfo = 0;
+    ulPacketInfo = 0;    
 
     // Enforce minimum size: RTP hdr(12) + H263 hdr(2) + H263 payload(3).
 
-    if (pPacket->GetSize() < 17) 
-    {
-        hr = HXR_INVALID_PARAMETER;
-        goto bail;
-    }
-
     if (FAILED(hr = GetRTPPacketInfo(pRTPHdr, 
+                                     ulPktLen,
                                      ulPacketInfo,
                                      pH263Hdr)))
     {
-        goto bail;
+        return hr;
     }
 
+    HX_ASSERT(pH263Hdr);
+
+    // min. len  =  rtp hdr len         + min. H263 hdr length                 
+    ulReqdPktLen = (pH263Hdr - pRTPHdr) + 2;
+
+    // Minimum req'd RTP hdr missing!
+    if (ulPktLen < ulReqdPktLen)
+    {
+        ulPacketInfo = 0;
+        return HXR_INVALID_PARAMETER;
+    }
 
     ////// Scan H263 Header
 
@@ -145,18 +157,26 @@
     // Enforce all-zero H263 reserved bits.
     if (uiH263RR) 
     {
-        hr = HXR_INVALID_PARAMETER;
-        goto bail;
+        ulPacketInfo = 0;
+        return HXR_INVALID_PARAMETER;
     }
 
 
     ///// Scan H263 Payload
 
-    
+    // reqd len  += 1 byte vrc hdr + extra picture hdr + minimum payload size
+    ulReqdPktLen += uiH263VBit + uiH263PLen + 3;
+
+    // Ensure that there's valid payload.
+    if (ulPktLen < ulReqdPktLen)
+    {
+        ulPacketInfo = 0;
+        return HXR_INVALID_PARAMETER;        
+    }
+
     // 2 byte for minimum hdr + 1 byte VRC hdr + extra picture hdr
     pH263Payload = pH263Hdr + 2 + uiH263VBit + uiH263PLen;
 
-
     // Contents: 6-bit picture start code (PSC)
     //           8-bit temporal reference (TR)
     //           n-bit PTYPE (at least 8 bit)
@@ -176,6 +196,9 @@
     
     if (uiH263PTypeFmt == 0x07) // PLUSPTYPE header present
     {
+        // At least one more byte required for PLUSPTYPE info.
+        ulReqdPktLen++;
+
         uiFrameType = 0;
 
         // PLUSPTYPE Contents:
@@ -188,6 +211,15 @@
 
         uiH263UFEP = ((pH263Payload[2] << 1) | pH263Payload[3] >> 7) & 0x07;
 
+        ulReqdPktLen += uiH263UFEP ? 1 : 0;
+
+        // Ensure that there's actually PLUSPTYPE information.
+        if (ulPktLen < ulReqdPktLen)
+        {
+            ulPacketInfo = 0;
+            return HXR_INVALID_PARAMETER;        
+        }
+
         if (uiH263UFEP == 1) // OPPTYPE present, then MPPTYPE
         {
             uiFrameType = (pH263Payload[5] >> 2) & 0x07;
@@ -224,11 +256,6 @@
     }
 
     return hr;
-
-bail: // Failure.
-
-    ulPacketInfo = 0;
-    return hr;
 }
 
 
@@ -304,4 +331,4 @@
                  szFrameType);
     }
 
-}
\ No newline at end of file
+}

Index: Umakefil
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/Umakefil,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Umakefil	26 May 2005 18:22:51 -0000	1.3
+++ Umakefil	7 Jun 2005 03:06:37 -0000	1.4
@@ -1,7 +1,7 @@
 # ***** BEGIN LICENSE BLOCK *****  
 # Source last modified: $Id$ 
 #   
-# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+# Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
 #       
 # The contents of this file, and the files included with this file, 
 # are subject to the current version of the RealNetworks Public 
@@ -41,6 +41,7 @@
 project.AddModuleIncludes("common/include", 
                           "server/include",
                           "common/dbgtool/pub",
+                          "common/util/pub",
                           "server/common/util/pub")
 
 project.AddSources("skimbase.cpp", 

Index: mp4skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/mp4skim.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mp4skim.cpp	3 Jun 2005 21:46:58 -0000	1.3
+++ mp4skim.cpp	7 Jun 2005 03:06:37 -0000	1.4
@@ -79,6 +79,7 @@
 
    
     if (FAILED(hr = GetRTPPacketInfo(pRTPHdr, 
+                                     pPacket->GetSize(),
                                      ulPacketInfo,
                                      pMP4Hdr)))
     {

Index: h263skim.h
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/h263skim.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- h263skim.h	17 May 2005 23:37:50 -0000	1.2
+++ h263skim.h	7 Jun 2005 03:06:37 -0000	1.3
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 

Index: skimbase.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/skimbase.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- skimbase.cpp	31 May 2005 21:38:06 -0000	1.3
+++ skimbase.cpp	7 Jun 2005 03:06:37 -0000	1.4
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 
@@ -44,9 +44,11 @@
 
 #include "hxcom.h"
 #include "hxengin.h"
+#include "hxmarsh.h"
 
 #include "skimbase.h"
 
+
 ///////////////////////////////////////////////////////////////////////////////
 // PacketSkimmer::PacketSkimmer()
 ///////////////////////////////////////////////////////////////////////////////
@@ -112,30 +114,6 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////
-// PacketSkimmer::DebugOut() - output debugging info for given debuglevel
-// args: ulDebugLevel - debug level to output at, see skimbase.h
-//       szFormat - printf style format string
-//       ... - printf style var args
-///////////////////////////////////////////////////////////////////////////////
-
-void
-PacketSkimmer::DebugOut(UINT32 ulDebugLevel,
-                        const char* szFormat,
-                        ...)
-{
-    if (!(m_ulDebugLevel & ulDebugLevel))
-    {
-        return;
-    }
-
-    va_list args;
-    va_start(args, szFormat);
-    vfprintf(stderr, szFormat, args);
-    va_end(args);
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
 // PacketSkimmer::GetRTPPacketInfo() - skim RTP header for relevant info
 //
 // See RFC1889 for RTP packet format info.
@@ -148,15 +126,16 @@
 
 HX_RESULT 
 PacketSkimmer::GetRTPPacketInfo(BYTE* pRTPPkt,
+                                UINT32 ulPktLen,
                                 UINT32& ulPacketInfo,
                                 BYTE*& pPayloadStart)
 {
     pPayloadStart = NULL;
-    UINT8 uiRTPVer    = 0 | (pRTPPkt[0] >> 6) & 0x03;
+    UINT8 uiRTPVer    = (pRTPPkt[0] >> 6) & 0x03;
 
-    // Enforce supported RTP version.
+    // Enforce supported RTP version and minimum pkt length
 
-    if (uiRTPVer != 2)
+    if (uiRTPVer != 2 || ulPktLen < 12)
     {
         return HXR_INVALID_PARAMETER;
     }
@@ -164,10 +143,14 @@
     // Extension hdr length and CSRC count.
     // These affect the total header length.
 
-    UINT8 uiRTPExt    = 0 | ((pRTPPkt[0] >> 4) & 1);
+    UINT8 uiRTPExt    = ((pRTPPkt[0] >> 4) & 1);
     UINT8 uiRTPCC     = pRTPPkt[0] & 0x0F;
 
 
+    // Currently all datatypes use marker bit to denote frame end.
+    // In the future if a datatype does NOT use marker bit in this way,
+    // this code will have to change!
+
     UINT8 uiRTPMarker = ((pRTPPkt[1] >> 7) & 1);
 
     if (uiRTPMarker)
@@ -178,8 +161,7 @@
     // Pkt type and seq no only used for debug output
     UINT8 uiRTPPT     = pRTPPkt[1] & 0x7F;
 
-    UINT16 uiRTPSeqNo = ((UINT16)pRTPPkt[2] << 8) & 0xFF00;
-    uiRTPSeqNo |= pRTPPkt[3];
+    UINT16 uiRTPSeqNo = getshort( &(pRTPPkt[2]) );
 
 
     DebugOut(SKIM_DBG_RTP_VERBOSE, 
@@ -204,8 +186,7 @@
     {
         BYTE* pRTPExt = pPayloadStart; 
 
-        UINT16 uiRTPExtLen = ((UINT16)pRTPExt[2] << 8) & 0xFF00;
-        uiRTPExtLen |= pRTPExt[3];
+        UINT16 uiRTPExtLen = getshort( &(pRTPExt[2]) );
 
         DebugOut(SKIM_DBG_RTP_VERBOSE, "RTPExt: Len: %u\n", uiRTPExtLen);
 


From darrick at helixcommunity.org  Mon Jun  6 20:06:40 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Mon Jun  6 20:06:43 2005
Subject: [Server-cvs] datatype/common/pktskim/unittest Umakefil, 1.3,
	1.4 testpktskim.cpp, 1.4, 1.5 win32.pcf, 1.2, 1.3
Message-ID: 

Update of /cvsroot/server/datatype/common/pktskim/unittest
In directory cvs:/tmp/cvs-serv32765/unittest

Modified Files:
	Umakefil testpktskim.cpp win32.pcf 
Log Message:
Synopsis
========
Apply suggestions from CR meeting to pktskimmer.

Branches: SERVER_11_0_STABLE_RN
CR: ghori, jzeng, ssmith, mtuncer


Description
===========
Applied bug fixes/efficiency tuning suggestions from CR meeting to the packet skimmer objects.


Build verified: win32-i386-vc7, linux-rhel4, sunos-5.9




Index: Umakefil
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/unittest/Umakefil,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Umakefil	31 May 2005 21:38:07 -0000	1.3
+++ Umakefil	7 Jun 2005 03:06:38 -0000	1.4
@@ -1,7 +1,7 @@
 # ***** BEGIN LICENSE BLOCK *****  
 # Source last modified: $Id$ 
 #   
-# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+# Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
 #       
 # The contents of this file, and the files included with this file, 
 # are subject to the current version of the RealNetworks Public 

Index: testpktskim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/unittest/testpktskim.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- testpktskim.cpp	31 May 2005 21:38:07 -0000	1.4
+++ testpktskim.cpp	7 Jun 2005 03:06:38 -0000	1.5
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 


From Rena at fuji.com  Tue Jun  7 12:09:42 2005
From: Rena at fuji.com (Renatus Bradford)
Date: Tue Jun  7 12:10:08 2005
Subject: [Server-cvs] Re: 25 mg did the triick
Message-ID: 

Hello, 
treated without harshness even by the soulless planter to whom hewere in possession, and on the upper deck groups of disarmedbehaviour.  The Captain damned his soul to hell for answer.  And thenalmost unawares in the moment of confusion following the punishingsharply upon her across the wind, so sharply that almost beforesailed away, setting an example of desertion from which the loyaltyTheir sloop had encountered and had been sunk three days ago by theponds to the south.silence to the Captain, and went blundering and stumbling in histhat she might make amends; that she might set a term to allUnderstand this clearly:  to the first shot from the Encarnacionlordship was not disturbed.To succour a wounded man, as was my sacred duty.he could not forget his rancour; you, because... because having toldtroops five hundred; and M. de Cussy will inform you of theOh!  You are insufferable!  She tore her hand free and backed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050607/d8936919/attachment.htm
From dcollins at helixcommunity.org  Tue Jun  7 15:50:35 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Tue Jun  7 15:50:36 2005
Subject: [Server-cvs] engine/session player.cpp,1.84.2.11,1.84.2.11.2.1
Message-ID: 

Update of /cvsroot/server/engine/session
In directory cvs:/tmp/cvs-serv32478

Modified Files:
      Tag: SERVER_11_0_BETA2
	player.cpp 
Log Message:
Synopsis
========
PR 142191: UPTIME: RHEL4 Server CAs with helixsim if link char is not disabled

Branches: SERVER_11_0_BETA2_RN, SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
Reviewed By: Jamie


Description
===========
This PR refers to a CA that occurs whenever helixsim 2.0.0.70 is used
to play certain clips from the server.  It is an uptime blocker.


Files Affected
==============

server/engine/session/player.cpp


Testing Performed
=================

Unit Tests:
- None.

Integration Tests:
- used helixsim 2.0.0.70 to generate connections as described in the PR.

Leak Tests:
- None.

Performance Tests:
- None.

Platforms Tested: linux-rhel4-i686
Build verified:   linux-rhel4-i686


QA Hints
===============

Regress PR 142191.   Do *not* use --disable-link-char.



Index: player.cpp
===================================================================
RCS file: /cvsroot/server/engine/session/player.cpp,v
retrieving revision 1.84.2.11
retrieving revision 1.84.2.11.2.1
diff -u -d -r1.84.2.11 -r1.84.2.11.2.1
--- player.cpp	4 May 2005 18:58:09 -0000	1.84.2.11
+++ player.cpp	7 Jun 2005 22:50:32 -0000	1.84.2.11.2.1
@@ -4634,14 +4634,17 @@
         //by this time.
 
         //Aggregate Link-Char will not be processed if Link-Char set on a Stream Level
-        if (linkCharParams.m_bSessionAggregate && !m_unLinkCharSetupCount)
+        if (linkCharParams.m_bSessionAggregate)
         {
-            if (!m_pSessionAggrLinkCharParams)
+            if (m_unLinkCharSetupCount == 0)
             {
-                m_pSessionAggrLinkCharParams = new LinkCharParams;
-            }
+                if (!m_pSessionAggrLinkCharParams)
+                {
+                    m_pSessionAggrLinkCharParams = new LinkCharParams;
+                }
 
-            *m_pSessionAggrLinkCharParams = linkCharParams;
+                *m_pSessionAggrLinkCharParams = linkCharParams;
+            }
         }
         else
         {


From dcollins at helixcommunity.org  Tue Jun  7 15:50:54 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Tue Jun  7 15:50:55 2005
Subject: [Server-cvs] engine/session player.cpp,1.84.2.11,1.84.2.12
Message-ID: 

Update of /cvsroot/server/engine/session
In directory cvs:/tmp/cvs-serv1626

Modified Files:
      Tag: SERVER_11_0_STABLE
	player.cpp 
Log Message:
Synopsis
========
PR 142191: UPTIME: RHEL4 Server CAs with helixsim if link char is not disabled

Branches: SERVER_11_0_BETA2_RN, SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
Reviewed By: Jamie


Description
===========
This PR refers to a CA that occurs whenever helixsim 2.0.0.70 is used
to play certain clips from the server.  It is an uptime blocker.


Files Affected
==============

server/engine/session/player.cpp


Testing Performed
=================

Unit Tests:
- None.

Integration Tests:
- used helixsim 2.0.0.70 to generate connections as described in the PR.

Leak Tests:
- None.

Performance Tests:
- None.

Platforms Tested: linux-rhel4-i686
Build verified:   linux-rhel4-i686


QA Hints
===============

Regress PR 142191.   Do *not* use --disable-link-char.



Index: player.cpp
===================================================================
RCS file: /cvsroot/server/engine/session/player.cpp,v
retrieving revision 1.84.2.11
retrieving revision 1.84.2.12
diff -u -d -r1.84.2.11 -r1.84.2.12
--- player.cpp	4 May 2005 18:58:09 -0000	1.84.2.11
+++ player.cpp	7 Jun 2005 22:50:51 -0000	1.84.2.12
@@ -4634,14 +4634,17 @@
         //by this time.
 
         //Aggregate Link-Char will not be processed if Link-Char set on a Stream Level
-        if (linkCharParams.m_bSessionAggregate && !m_unLinkCharSetupCount)
+        if (linkCharParams.m_bSessionAggregate)
         {
-            if (!m_pSessionAggrLinkCharParams)
+            if (m_unLinkCharSetupCount == 0)
             {
-                m_pSessionAggrLinkCharParams = new LinkCharParams;
-            }
+                if (!m_pSessionAggrLinkCharParams)
+                {
+                    m_pSessionAggrLinkCharParams = new LinkCharParams;
+                }
 
-            *m_pSessionAggrLinkCharParams = linkCharParams;
+                *m_pSessionAggrLinkCharParams = linkCharParams;
+            }
         }
         else
         {


From dcollins at helixcommunity.org  Tue Jun  7 15:51:15 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Tue Jun  7 15:51:17 2005
Subject: [Server-cvs] engine/session player.cpp,1.95,1.96
Message-ID: 

Update of /cvsroot/server/engine/session
In directory cvs:/tmp/cvs-serv2290

Modified Files:
	player.cpp 
Log Message:
Synopsis
========
PR 142191: UPTIME: RHEL4 Server CAs with helixsim if link char is not disabled

Branches: SERVER_11_0_BETA2_RN, SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
Reviewed By: Jamie


Description
===========
This PR refers to a CA that occurs whenever helixsim 2.0.0.70 is used
to play certain clips from the server.  It is an uptime blocker.


Files Affected
==============

server/engine/session/player.cpp


Testing Performed
=================

Unit Tests:
- None.

Integration Tests:
- used helixsim 2.0.0.70 to generate connections as described in the PR.

Leak Tests:
- None.

Performance Tests:
- None.

Platforms Tested: linux-rhel4-i686
Build verified:   linux-rhel4-i686


QA Hints
===============

Regress PR 142191.   Do *not* use --disable-link-char.



Index: player.cpp
===================================================================
RCS file: /cvsroot/server/engine/session/player.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- player.cpp	4 May 2005 18:57:29 -0000	1.95
+++ player.cpp	7 Jun 2005 22:51:13 -0000	1.96
@@ -4634,14 +4634,17 @@
         //by this time.
 
         //Aggregate Link-Char will not be processed if Link-Char set on a Stream Level
-        if (linkCharParams.m_bSessionAggregate && !m_unLinkCharSetupCount)
+        if (linkCharParams.m_bSessionAggregate)
         {
-            if (!m_pSessionAggrLinkCharParams)
+            if (m_unLinkCharSetupCount == 0)
             {
-                m_pSessionAggrLinkCharParams = new LinkCharParams;
-            }
+                if (!m_pSessionAggrLinkCharParams)
+                {
+                    m_pSessionAggrLinkCharParams = new LinkCharParams;
+                }
 
-            *m_pSessionAggrLinkCharParams = linkCharParams;
+                *m_pSessionAggrLinkCharParams = linkCharParams;
+            }
         }
         else
         {


From tmarshall at helixcommunity.org  Wed Jun  8 09:11:32 2005
From: tmarshall at helixcommunity.org (tmarshall@helixcommunity.org)
Date: Wed Jun  8 09:11:34 2005
Subject: [Server-cvs] engine/core server.ver,1.1826.2.2043,1.1826.2.2044
Message-ID: 

Update of /cvsroot/server/engine/core
In directory cvs:/tmp/cvs-serv12155

Modified Files:
      Tag: SERVER_10_1_STABLE
	server.ver 
Log Message:
Update to 10.07


Index: server.ver
===================================================================
RCS file: /cvsroot/server/engine/core/server.ver,v
retrieving revision 1.1826.2.2043
retrieving revision 1.1826.2.2044
diff -u -d -r1.1826.2.2043 -r1.1826.2.2044
--- server.ver	8 Jun 2005 10:35:03 -0000	1.1826.2.2043
+++ server.ver	8 Jun 2005 16:11:27 -0000	1.1826.2.2044
@@ -2,12 +2,12 @@
  * Copyright (C) 1997-2002 RealNetworks Corporation. All rights reserved.
  */
 #ifdef _MACINTOSH
-#define TARVER_ULONG32_VERSION ((10<<28)|(0<<20)|(6<<12)|2038)
+#define TARVER_ULONG32_VERSION ((10<<28)|(0<<20)|(7<<12)|2038)
 #else
-#define TARVER_ULONG32_VERSION (UINT32)((10L<<28L)|(0L<<20L)|(6L<< 12L)|2038L)
+#define TARVER_ULONG32_VERSION (UINT32)((10L<<28L)|(0L<<20L)|(7L<< 12L)|2038L)
 #endif
-#define TARVER_LIST_VERSION 10,0,6,2038
+#define TARVER_LIST_VERSION 10,0,7,2038
 #define TARVER_MAJOR_VERSION 10
 #define TARVER_MINOR_VERSION 0
-#define TARVER_STRING_VERSION "10.0.6.2038"
+#define TARVER_STRING_VERSION "10.0.7.2038"
 #define TARVER_STR_BUILD_NAME ""


From rishimathew at helixcommunity.org  Wed Jun  8 10:56:01 2005
From: rishimathew at helixcommunity.org (rishimathew@helixcommunity.org)
Date: Wed Jun  8 10:56:02 2005
Subject: [Server-cvs] fs/asncfs - New directory
Message-ID: 

Update of /cvsroot/server/fs/asncfs
In directory cvs:/tmp/cvs-serv30329/asncfs

Log Message:
Directory /cvsroot/server/fs/asncfs added to the repository



From rishimathew at helixcommunity.org  Wed Jun  8 10:58:40 2005
From: rishimathew at helixcommunity.org (rishimathew@helixcommunity.org)
Date: Wed Jun  8 10:58:41 2005
Subject: [Server-cvs] fs/asncfs/unix - New directory
Message-ID: 

Update of /cvsroot/server/fs/asncfs/unix
In directory cvs:/tmp/cvs-serv1052/unix

Log Message:
Directory /cvsroot/server/fs/asncfs/unix added to the repository



From rishimathew at helixcommunity.org  Wed Jun  8 11:05:02 2005
From: rishimathew at helixcommunity.org (rishimathew@helixcommunity.org)
Date: Wed Jun  8 11:05:05 2005
Subject: [Server-cvs] build/BIF SERVER_CURRENT_COMMON.bif,1.4,1.5
Message-ID: 

Update of /cvsroot/server/build/BIF
In directory cvs:/tmp/cvs-serv7446

Modified Files:
	SERVER_CURRENT_COMMON.bif 
Log Message:
Moving Asynchronous File System from server_rn/fs/asncfs to server/fs/asncfs


Index: SERVER_CURRENT_COMMON.bif
===================================================================
RCS file: /cvsroot/server/build/BIF/SERVER_CURRENT_COMMON.bif,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- SERVER_CURRENT_COMMON.bif	17 May 2005 23:39:59 -0000	1.4
+++ SERVER_CURRENT_COMMON.bif	8 Jun 2005 18:05:00 -0000	1.5
@@ -48,6 +48,12 @@
       
     
 
+    
+      
+        server_fs_asncfs
+      
+    
+
     
       
 	server_access_auth_dbmgr


From darrick at helixcommunity.org  Wed Jun  8 11:53:49 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Wed Jun  8 11:53:51 2005
Subject: [Server-cvs] broadcast/transport/rtp/recv Umakefil, 1.6.2.1,
	1.6.2.2 qtbcobj.cpp, 1.12.6.5, 1.12.6.6 qtstream.cpp, 1.10.4.3,
	1.10.4.4 qtstream.h, 1.4.4.1, 1.4.4.2
Message-ID: 

Update of /cvsroot/server/broadcast/transport/rtp/recv
In directory cvs:/tmp/cvs-serv27695

Modified Files:
      Tag: SERVER_11_0_STABLE
	Umakefil qtbcobj.cpp qtstream.cpp qtstream.h 
Log Message:
Synopsis
========
Integrate PacketSkimmer into qtbcplin.


Branches: SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
CR: ghori, jzeng, atin, ssmith, mtuncer


Description
===========
Add support for 3GPP keyframe detection to qtbcplin.


Build verified: win32-i386-vc7, linux-rhel4, sunos-5.9




Index: Umakefil
===================================================================
RCS file: /cvsroot/server/broadcast/transport/rtp/recv/Umakefil,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -d -r1.6.2.1 -r1.6.2.2
--- Umakefil	4 Dec 2004 20:13:28 -0000	1.6.2.1
+++ Umakefil	8 Jun 2005 18:53:46 -0000	1.6.2.2
@@ -41,13 +41,15 @@
     "common/dbgtool/pub",
     "common/netio/pub",
     "common/runtime/pub",
-    "server/include")
+    "server/include",
+    "server/datatype/common/pktskim")
 
 project.AddSources("qtbcplin.cpp", "qtbcobj.cpp", "qtstream.cpp", 
     "sdpinfo.cpp", "qtdirmgr.cpp", "guids.cpp", "qtreceiver.cpp")
 
 project.AddModuleLibraries(
     "server/common/util[servutillib]",
+    "server/datatype/common/pktskim[pktskimlib]",
     "protocol/transport/rtp[rtptranlib]",
     "protocol/sdp[sdplib]",
     "protocol/rtsp[rtsplib]",

Index: qtstream.h
===================================================================
RCS file: /cvsroot/server/broadcast/transport/rtp/recv/qtstream.h,v
retrieving revision 1.4.4.1
retrieving revision 1.4.4.2
diff -u -d -r1.4.4.1 -r1.4.4.2
--- qtstream.h	6 Dec 2004 01:13:23 -0000	1.4.4.1
+++ qtstream.h	8 Jun 2005 18:53:46 -0000	1.4.4.2
@@ -129,6 +129,7 @@
     
 
     HX_RESULT	HandlePacket(void);
+    void SetupKeyframeDetection();
 
     /* make sure to send smallest ts pkt to the core */
     HX_RESULT	GetNextTS   (REF(UINT32) ulTS);
@@ -162,6 +163,7 @@
     BOOL		    m_bStarted;
     BOOL		    m_bFirstPkt;
     BOOL		    m_bClosed;
+    PacketSkimmer*          m_pPktSkimmer;
 
     // timeout
     BOOL		    m_bReceivedPkt;

Index: qtbcobj.cpp
===================================================================
RCS file: /cvsroot/server/broadcast/transport/rtp/recv/qtbcobj.cpp,v
retrieving revision 1.12.6.5
retrieving revision 1.12.6.6
diff -u -d -r1.12.6.5 -r1.12.6.6
--- qtbcobj.cpp	12 Mar 2005 00:32:44 -0000	1.12.6.5
+++ qtbcobj.cpp	8 Jun 2005 18:53:46 -0000	1.12.6.6
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 
@@ -52,7 +52,7 @@
 
 #define CHAR_LF	0x0a
 #define CHAR_CR	0x0d
-	       
+
 /****************************************************************************
  * Includes
  */
@@ -86,6 +86,8 @@
 #include "packetq.h"
 #include "livekeyframe.h"
 
+#include "skimbase.h"
+
 #include "sdpinfo.h"
 #include "qtstream.h"
 #include "qtbcplin.h"
@@ -1581,7 +1583,7 @@
 void
 QTBCStreamsObject::StartBuffering()
 {
-//    printf("StartBuffering...\n");
+//   printf("StartBuffering...\n");
     for (UINT16 i = 0; i < m_pStreamInfo->GetSize(); i++)
     {
 	MediaDescription* pStreamInfo = (MediaDescription*)(*m_pStreamInfo)[i];
@@ -1661,7 +1663,7 @@
 	    }
 	}
 
-	HX_ASSERT(ulDelay / 1000);
+	//HX_ASSERT(ulDelay / 1000);
 
 	HXTimeval tv = m_pScheduler->GetCurrentSchedulerTime();
 	tv.tv_sec += ulDelay / 1000;

Index: qtstream.cpp
===================================================================
RCS file: /cvsroot/server/broadcast/transport/rtp/recv/qtstream.cpp,v
retrieving revision 1.10.4.3
retrieving revision 1.10.4.4
diff -u -d -r1.10.4.3 -r1.10.4.4
--- qtstream.cpp	4 Feb 2005 20:56:44 -0000	1.10.4.3
+++ qtstream.cpp	8 Jun 2005 18:53:46 -0000	1.10.4.4
@@ -52,6 +52,7 @@
 #include "hxtypes.h"
 #include "netbyte.h"
 #include "hxcom.h"
+#include "hxmon.h"
 #include "hxassert.h"
 #include "hxcomm.h"
 #include "hxengin.h"
@@ -64,6 +65,9 @@
 #include "ntptime.h"
 #include "hxtick.h"
 
+#include "skimbase.h"
+#include "h263skim.h"
+
 #ifdef XXX_RTCP_DEBUG
 #include "tconverter.h"
 #include "sdpinfo.h"
@@ -110,6 +114,7 @@
     , m_ulBufferdelay   (DEFAULT_BUFFER_DURATION)
     , m_bStarted        (FALSE)
     , m_bReceivedPkt    (FALSE)
+    , m_pPktSkimmer     (NULL)
 {
     m_pContext = pContext;
     m_pContext->AddRef();
@@ -268,6 +273,8 @@
     {
         m_pResolver->GetHostByName(pAddress);
     }
+
+    SetupKeyframeDetection();
 }
 
 void
@@ -285,6 +292,7 @@
     HX_RELEASE(m_pContext);
     HX_RELEASE(m_pClassFactory);
     HX_RELEASE(m_pResolver);
+    HX_RELEASE(m_pPktSkimmer);
 
     if (m_pReceiver)
     {
@@ -305,6 +313,78 @@
     }
 }
 
+void
+QTStream::SetupKeyframeDetection()
+{
+    IHXValues* pStreamHeader = NULL;
+    IHXBuffer* pMimeType = NULL;
+    const char* szMimeType = NULL;
+    IHXRegistry* pRegistry = NULL;
+    INT32 nEnabled = 0;
+    INT32 nDebugLevel = 0;
+   
+    m_pContext->QueryInterface(IID_IHXRegistry, (void**)&pRegistry);
+
+    // Enabled by default.
+    if (SUCCEEDED(pRegistry->GetIntByName("config.3GPPKeyframeDetection.Enabled", 
+                  nEnabled)))
+    {
+        if (!nEnabled)
+        {
+            goto cleanup;
+        }
+    }
+
+    m_pClassFactory->CreateInstance(IID_IHXValues, (void**)&pStreamHeader);
+    
+    if (FAILED(m_pStreamsObj->GetStreamHeader(m_nStreamNum, pStreamHeader)))
+    {
+        goto cleanup;
+    }
+
+    if (FAILED(pStreamHeader->GetPropertyCString("MimeType", pMimeType)))
+    {
+        goto cleanup;
+    }
+
+    szMimeType = (const char*)pMimeType->GetBuffer();
+
+    if (strncasecmp(szMimeType, "video/", 6))
+    {
+        goto cleanup;
+    }
+
+
+    if (!strncasecmp(szMimeType + 6, "H263-2000", 8))
+    {
+        m_pPktSkimmer = new H263PacketSkimmer;
+        m_pPktSkimmer->AddRef();
+    }
+    // Other packetizer issues go here.
+
+    else
+    {
+        goto cleanup;
+    }
+
+
+    if (SUCCEEDED(pRegistry->GetIntByName("config.3GPPKeyframeDetection.DebugLevel", 
+                  nDebugLevel)))
+    {
+        if (m_pPktSkimmer && nDebugLevel > 0)
+        {
+            m_pPktSkimmer->SetDebugLevel((UINT32)nDebugLevel);
+        }
+    }
+
+
+cleanup:
+
+    HX_RELEASE(pRegistry);
+    HX_RELEASE(pStreamHeader);
+    HX_RELEASE(pMimeType);
+}
+
 STDMETHODIMP
 QTStream::GetHostByNameDone(HX_RESULT status, UINT32 ulAddr)
 {
@@ -443,6 +523,9 @@
                    ULONG32 ulAddr,
                    UINT16 nPort)
 {
+    UINT8 uiFlags = 0;
+    UINT32 ulPktInfo = 0;
+
     if (m_bStreamDone)
     {
         return HXR_OK;
@@ -484,12 +567,33 @@
         goto bail;
     }
     HX_ASSERT(pPacket);
+ 
+    uiFlags = 0;
+
+    uiFlags = HX_ASM_SWITCH_OFF;
+
+    if (m_pPktSkimmer)
+    {
+        ulPktInfo = 0;
+
+        if (SUCCEEDED(m_pPktSkimmer->GetPacketInfo(pBuffer, ulPktInfo))
+        &&  (ulPktInfo & SKIMINFO_PKT_KEYFRAME)
+        &&  (ulPktInfo & SKIMINFO_PKT_FRAMESTART))
+        {
+            uiFlags |= HX_ASM_SWITCH_ON;
+        }
+    }
+    else
+    {
+        uiFlags = HX_ASM_SWITCH_ON | HX_ASM_SWITCH_OFF;
+    }
+
 
     hResult = pPacket->Set(pBuffer,
                            HX_GET_TICKCOUNT(),  // HXTime (?)
                            m_nStreamNum,
-                           HX_ASM_SWITCH_ON | HX_ASM_SWITCH_OFF,
-                           0);                  // not RTCP
+                           uiFlags,
+                           0);                  // not RTCP    
 
     if (FAILED(hResult))
     {


From darrick at helixcommunity.org  Wed Jun  8 11:54:02 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Wed Jun  8 11:54:03 2005
Subject: [Server-cvs] broadcast/transport/rtp/recv Umakefil, 1.7,
	1.8 qtbcobj.cpp, 1.16, 1.17 qtstream.cpp, 1.14,
	1.15 qtstream.h, 1.5, 1.6
Message-ID: 

Update of /cvsroot/server/broadcast/transport/rtp/recv
In directory cvs:/tmp/cvs-serv28208

Modified Files:
	Umakefil qtbcobj.cpp qtstream.cpp qtstream.h 
Log Message:
Synopsis
========
Integrate PacketSkimmer into qtbcplin.


Branches: SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
CR: ghori, jzeng, atin, ssmith, mtuncer


Description
===========
Add support for 3GPP keyframe detection to qtbcplin.


Build verified: win32-i386-vc7, linux-rhel4, sunos-5.9



Index: Umakefil
===================================================================
RCS file: /cvsroot/server/broadcast/transport/rtp/recv/Umakefil,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Umakefil	4 Dec 2004 20:27:29 -0000	1.7
+++ Umakefil	8 Jun 2005 18:54:00 -0000	1.8
@@ -41,13 +41,15 @@
     "common/dbgtool/pub",
     "common/netio/pub",
     "common/runtime/pub",
-    "server/include")
+    "server/include",
+    "server/datatype/common/pktskim")
 
 project.AddSources("qtbcplin.cpp", "qtbcobj.cpp", "qtstream.cpp", 
     "sdpinfo.cpp", "qtdirmgr.cpp", "guids.cpp", "qtreceiver.cpp")
 
 project.AddModuleLibraries(
     "server/common/util[servutillib]",
+    "server/datatype/common/pktskim[pktskimlib]",
     "protocol/transport/rtp[rtptranlib]",
     "protocol/sdp[sdplib]",
     "protocol/rtsp[rtsplib]",

Index: qtstream.h
===================================================================
RCS file: /cvsroot/server/broadcast/transport/rtp/recv/qtstream.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- qtstream.h	6 Dec 2004 01:16:38 -0000	1.5
+++ qtstream.h	8 Jun 2005 18:54:00 -0000	1.6
@@ -129,6 +129,7 @@
     
 
     HX_RESULT	HandlePacket(void);
+    void SetupKeyframeDetection();
 
     /* make sure to send smallest ts pkt to the core */
     HX_RESULT	GetNextTS   (REF(UINT32) ulTS);
@@ -162,6 +163,7 @@
     BOOL		    m_bStarted;
     BOOL		    m_bFirstPkt;
     BOOL		    m_bClosed;
+    PacketSkimmer*          m_pPktSkimmer;
 
     // timeout
     BOOL		    m_bReceivedPkt;

Index: qtbcobj.cpp
===================================================================
RCS file: /cvsroot/server/broadcast/transport/rtp/recv/qtbcobj.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- qtbcobj.cpp	12 Mar 2005 00:28:00 -0000	1.16
+++ qtbcobj.cpp	8 Jun 2005 18:54:00 -0000	1.17
@@ -1,7 +1,7 @@
 /* ***** BEGIN LICENSE BLOCK *****  
  * Source last modified: $Id$ 
  *   
- * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.  
  *       
  * The contents of this file, and the files included with this file, 
  * are subject to the current version of the RealNetworks Public 
@@ -52,7 +52,7 @@
 
 #define CHAR_LF	0x0a
 #define CHAR_CR	0x0d
-	       
+
 /****************************************************************************
  * Includes
  */
@@ -86,6 +86,8 @@
 #include "packetq.h"
 #include "livekeyframe.h"
 
+#include "skimbase.h"
+
 #include "sdpinfo.h"
 #include "qtstream.h"
 #include "qtbcplin.h"
@@ -842,6 +844,7 @@
     , m_bInitDoneCalled(FALSE)
     , m_bStreamsReady(FALSE)
     , m_bStartSendingPacket(FALSE)
+    , m_bStreamsClosing(FALSE)
 {
     m_bDidSessionEnd;m_pContext = pContext;
     m_bSendImmediate;m_pContext->AddRef();
@@ -1580,7 +1583,7 @@
 void
 QTBCStreamsObject::StartBuffering()
 {
-//    printf("StartBuffering...\n");
+//   printf("StartBuffering...\n");
     for (UINT16 i = 0; i < m_pStreamInfo->GetSize(); i++)
     {
 	MediaDescription* pStreamInfo = (MediaDescription*)(*m_pStreamInfo)[i];
@@ -1660,7 +1663,7 @@
 	    }
 	}
 
-	HX_ASSERT(ulDelay / 1000);
+	//HX_ASSERT(ulDelay / 1000);
 
 	HXTimeval tv = m_pScheduler->GetCurrentSchedulerTime();
 	tv.tv_sec += ulDelay / 1000;
@@ -2074,6 +2077,13 @@
 void
 QTBCStreamsObject::CloseAllStreams()
 {
+    if (m_bStreamsClosing)
+    {
+        return;
+    }
+
+    m_bStreamsClosing = TRUE;
+
     QTStream* pStream = NULL;
 
     for (INT32 i =0; i < m_pStreams->GetSize(); i++)
@@ -2518,6 +2528,9 @@
 
     HX_ASSERT(m_pFileObject);
     m_pFileObject->AddRef();
+
+    HX_ASSERT(m_pResponse);
+    m_pResponse->AddRef();
 }
 
 /****************************************************************************

Index: qtstream.cpp
===================================================================
RCS file: /cvsroot/server/broadcast/transport/rtp/recv/qtstream.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- qtstream.cpp	4 Feb 2005 20:56:51 -0000	1.14
+++ qtstream.cpp	8 Jun 2005 18:54:00 -0000	1.15
@@ -52,11 +52,11 @@
 #include "hxtypes.h"
 #include "netbyte.h"
 #include "hxcom.h"
+#include "hxmon.h"
 #include "hxassert.h"
 #include "hxcomm.h"
 #include "hxengin.h"
 #include "ihxpckts.h"
-#include "bufnum.h"
 #include "rtpwrap.h"
 #include "pkthndlr.h"
 #include "tconverter.h" // CHXTimestampConverter
@@ -65,6 +65,9 @@
 #include "ntptime.h"
 #include "hxtick.h"
 
+#include "skimbase.h"
+#include "h263skim.h"
+
 #ifdef XXX_RTCP_DEBUG
 #include "tconverter.h"
 #include "sdpinfo.h"
@@ -111,6 +114,7 @@
     , m_ulBufferdelay   (DEFAULT_BUFFER_DURATION)
     , m_bStarted        (FALSE)
     , m_bReceivedPkt    (FALSE)
+    , m_pPktSkimmer     (NULL)
 {
     m_pContext = pContext;
     m_pContext->AddRef();
@@ -269,6 +273,8 @@
     {
         m_pResolver->GetHostByName(pAddress);
     }
+
+    SetupKeyframeDetection();
 }
 
 void
@@ -286,6 +292,7 @@
     HX_RELEASE(m_pContext);
     HX_RELEASE(m_pClassFactory);
     HX_RELEASE(m_pResolver);
+    HX_RELEASE(m_pPktSkimmer);
 
     if (m_pReceiver)
     {
@@ -306,6 +313,78 @@
     }
 }
 
+void
+QTStream::SetupKeyframeDetection()
+{
+    IHXValues* pStreamHeader = NULL;
+    IHXBuffer* pMimeType = NULL;
+    const char* szMimeType = NULL;
+    IHXRegistry* pRegistry = NULL;
+    INT32 nEnabled = 0;
+    INT32 nDebugLevel = 0;
+   
+    m_pContext->QueryInterface(IID_IHXRegistry, (void**)&pRegistry);
+
+    // Enabled by default.
+    if (SUCCEEDED(pRegistry->GetIntByName("config.3GPPKeyframeDetection.Enabled", 
+                  nEnabled)))
+    {
+        if (!nEnabled)
+        {
+            goto cleanup;
+        }
+    }
+
+    m_pClassFactory->CreateInstance(IID_IHXValues, (void**)&pStreamHeader);
+    
+    if (FAILED(m_pStreamsObj->GetStreamHeader(m_nStreamNum, pStreamHeader)))
+    {
+        goto cleanup;
+    }
+
+    if (FAILED(pStreamHeader->GetPropertyCString("MimeType", pMimeType)))
+    {
+        goto cleanup;
+    }
+
+    szMimeType = (const char*)pMimeType->GetBuffer();
+
+    if (strncasecmp(szMimeType, "video/", 6))
+    {
+        goto cleanup;
+    }
+
+
+    if (!strncasecmp(szMimeType + 6, "H263-2000", 8))
+    {
+        m_pPktSkimmer = new H263PacketSkimmer;
+        m_pPktSkimmer->AddRef();
+    }
+    // Other packetizer issues go here.
+
+    else
+    {
+        goto cleanup;
+    }
+
+
+    if (SUCCEEDED(pRegistry->GetIntByName("config.3GPPKeyframeDetection.DebugLevel", 
+                  nDebugLevel)))
+    {
+        if (m_pPktSkimmer && nDebugLevel > 0)
+        {
+            m_pPktSkimmer->SetDebugLevel((UINT32)nDebugLevel);
+        }
+    }
+
+
+cleanup:
+
+    HX_RELEASE(pRegistry);
+    HX_RELEASE(pStreamHeader);
+    HX_RELEASE(pMimeType);
+}
+
 STDMETHODIMP
 QTStream::GetHostByNameDone(HX_RESULT status, UINT32 ulAddr)
 {
@@ -444,6 +523,9 @@
                    ULONG32 ulAddr,
                    UINT16 nPort)
 {
+    UINT8 uiFlags = 0;
+    UINT32 ulPktInfo = 0;
+
     if (m_bStreamDone)
     {
         return HXR_OK;
@@ -485,12 +567,33 @@
         goto bail;
     }
     HX_ASSERT(pPacket);
+ 
+    uiFlags = 0;
+
+    uiFlags = HX_ASM_SWITCH_OFF;
+
+    if (m_pPktSkimmer)
+    {
+        ulPktInfo = 0;
+
+        if (SUCCEEDED(m_pPktSkimmer->GetPacketInfo(pBuffer, ulPktInfo))
+        &&  (ulPktInfo & SKIMINFO_PKT_KEYFRAME)
+        &&  (ulPktInfo & SKIMINFO_PKT_FRAMESTART))
+        {
+            uiFlags |= HX_ASM_SWITCH_ON;
+        }
+    }
+    else
+    {
+        uiFlags = HX_ASM_SWITCH_ON | HX_ASM_SWITCH_OFF;
+    }
+
 
     hResult = pPacket->Set(pBuffer,
                            HX_GET_TICKCOUNT(),  // HXTime (?)
                            m_nStreamNum,
-                           HX_ASM_SWITCH_ON | HX_ASM_SWITCH_OFF,
-                           0);                  // not RTCP
+                           uiFlags,
+                           0);                  // not RTCP    
 
     if (FAILED(hResult))
     {
@@ -837,7 +940,6 @@
                      HX_ASM_SWITCH_ON | HX_ASM_SWITCH_OFF,
                      1);                        // RTCP
 
-
         m_pParent->m_pStreamsObj->AddPacket(pPacket);
     }
 


From 5huong at absolutemotion.com  Wed Jun  8 12:58:21 2005
From: 5huong at absolutemotion.com (Vanessa J. Smith)
Date: Wed Jun  8 13:04:49 2005
Subject: [Server-cvs] Cheap software
Message-ID: <65d601c56c64$2bfce42c$3284008b@absolutemotion.com>

Skipped content of type multipart/alternative
From rishimathew at helixcommunity.org  Wed Jun  8 11:01:10 2005
From: rishimathew at helixcommunity.org (rishimathew@helixcommunity.org)
Date: Wed Jun  8 13:57:51 2005
Subject: [Server-cvs] fs/asncfs/unix LICENSE.txt, NONE, 1.1 RCSL.txt, NONE,
	1.1 RPSL.txt, NONE, 1.1 mmapbuf.cpp, NONE, 1.1 mmapbuf.h, NONE, 1.1
Message-ID: 

Update of /cvsroot/server/fs/asncfs/unix
In directory cvs:/tmp/cvs-serv1322/unix

Added Files:
	LICENSE.txt RCSL.txt RPSL.txt mmapbuf.cpp mmapbuf.h 
Log Message:
Moving Asynchronous file system from server_rn/fs/asncfs to server/fs/asncfs


--- NEW FILE: RPSL.txt ---
RealNetworks Public Source License Version 1.0
(Rev. Date October 28, 2002)

1. General Definitions. This License applies to any program or other work which
RealNetworks, Inc., or any other entity that elects to use this license,
("Licensor") makes publicly available and which contains a notice placed by
Licensor identifying such program or work as "Original Code" and stating that it
is subject to the terms of this RealNetworks Public Source License version 1.0
(or subsequent version thereof) ("License"). You are not required to accept this
License. However, nothing else grants You permission to use, copy, modify or
distribute the software or its derivative works. These actions are prohibited by
law if You do not accept this License. Therefore, by modifying, copying or
distributing the software (or any work based on the software), You indicate your
acceptance of this License to do so, and all its terms and conditions. In
addition, you agree to the terms of this License by clicking the Accept button
or downloading the software. As used in this License:

1.1 "Applicable Patent Rights" mean: (a) in the case where Licensor is the
grantor of rights, claims of patents that (i) are now or hereafter acquired,
owned by or assigned to Licensor and (ii) are necessarily infringed by using or
making the Original Code alone and not in combination with other software or
hardware; and (b) in the case where You are the grantor of rights, claims of
patents that (i) are now or hereafter acquired, owned by or assigned to You and
(ii) are infringed (directly or indirectly) by using or making Your
Modifications, taken alone or in combination with Original Code.

1.2 "Compatible Source License" means any one of the licenses listed on Exhibit
B or at https://www.helixcommunity.org/content/complicense or other licenses
specifically identified by Licensor in writing. Notwithstanding any term to the
contrary in any Compatible Source License, any code covered by any Compatible
Source License that is used with Covered Code must be made readily available in
Source Code format for royalty-free use under the terms of the Compatible Source
License or this License.

1.3 "Contributor" means any person or entity that creates or contributes to the
creation of Modifications.

1.4 "Covered Code" means the Original Code, Modifications, the combination of
Original Code and any Modifications, and/or any respective portions thereof.

1.5 "Deploy" means to use, sublicense or distribute Covered Code other than for
Your internal research and development (R&D) and/or Personal Use, and includes
without limitation, any and all internal use or distribution of Covered Code
within Your business or organization except for R&D use and/or Personal Use, as
well as direct or indirect sublicensing or distribution of Covered Code by You
to any third party in any form or manner.

1.6 "Derivative Work" means either the Covered Code or any derivative work under
United States copyright law, and including any work containing or including any
portion of the Covered Code or Modifications, either verbatim or with
modifications and/or translated into another language. Derivative Work also
includes any work which combines any portion of Covered Code or Modifications
with code not otherwise governed by the terms of this License.

1.7 "Externally Deploy" means to Deploy the Covered Code in any way that may be
accessed or used by anyone other than You, used to provide any services to
anyone other than You, or used in any way to deliver any content to anyone other
than You, whether the Covered Code is distributed to those parties, made
available as an application intended for use over a computer network, or used to
provide services or otherwise deliver content to anyone other than You.

1.8. "Interface" means interfaces, functions, properties, class definitions,
APIs, header files, GUIDs, V-Tables, and/or protocols allowing one piece of
software, firmware or hardware to communicate or interoperate with another piece
of software, firmware or hardware.

1.9 "Modifications" mean any addition to, deletion from, and/or change to, the
substance and/or structure of the Original Code, any previous Modifications, the
combination of Original Code and any previous Modifications, and/or any
respective portions thereof. When code is released as a series of files, a
Modification is: (a) any addition to or deletion from the contents of a file
containing Covered Code; and/or (b) any new file or other representation of
computer program statements that contains any part of Covered Code.

1.10 "Original Code" means (a) the Source Code of a program or other work as
originally made available by Licensor under this License, including the Source
Code of any updates or upgrades to such programs or works made available by
Licensor under this License, and that has been expressly identified by Licensor
as such in the header file(s) of such work; and (b) the object code compiled
from such Source Code and originally made available by Licensor under this
License.

1.11 "Personal Use" means use of Covered Code by an individual solely for his or
her personal, private and non-commercial purposes. An individual's use of
Covered Code in his or her capacity as an officer, employee, member, independent
contractor or agent of a corporation, business or organization (commercial or
non-commercial) does not qualify as Personal Use.

1.12 "Source Code" means the human readable form of a program or other work that
is suitable for making modifications to it, including all modules it contains,
plus any associated interface definition files, scripts used to control
compilation and installation of an executable (object code).

1.13 "You" or "Your" means an individual or a legal entity exercising rights
under this License. For legal entities, "You" or "Your" includes any entity
which controls, is controlled by, or is under common control with, You, where
"control" means (a) the power, direct or indirect, to cause the direction or
management of such entity, whether by contract or otherwise, or (b) ownership of
fifty percent (50%) or more of the outstanding shares or beneficial ownership of
such entity.

2. Permitted Uses; Conditions & Restrictions. Subject to the terms and
conditions of this License, Licensor hereby grants You, effective on the date
You accept this License (via downloading or using Covered Code or otherwise
indicating your acceptance of this License), a worldwide, royalty-free,
non-exclusive copyright license, to the extent of Licensor's copyrights cover
the Original Code, to do the following:

2.1 You may reproduce, display, perform, modify and Deploy Covered Code,
provided that in each instance:

(a) You must retain and reproduce in all copies of Original Code the copyright
and other proprietary notices and disclaimers of Licensor as they appear in the
Original Code, and keep intact all notices in the Original Code that refer to
this License;

(b) You must include a copy of this License with every copy of Source Code of
Covered Code and documentation You distribute, and You may not offer or impose
any terms on such Source Code that alter or restrict this License or the
recipients' rights hereunder, except as permitted under Section 6;

(c) You must duplicate, to the extent it does not already exist, the notice in
Exhibit A in each file of the Source Code of all Your Modifications, and cause
the modified files to carry prominent notices stating that You changed the files
and the date of any change;

(d) You must make Source Code of all Your Externally Deployed Modifications
publicly available under the terms of this License, including the license grants
set forth in Section 3 below, for as long as you Deploy the Covered Code or
twelve (12) months from the date of initial Deployment, whichever is longer. You
should preferably distribute the Source Code of Your Deployed Modifications
electronically (e.g. download from a web site); and

(e) if You Deploy Covered Code in object code, executable form only, You must
include a prominent notice, in the code itself as well as in related
documentation, stating that Source Code of the Covered Code is available under
the terms of this License with information on how and where to obtain such
Source Code. You must also include the Object Code Notice set forth in Exhibit A
in the "about" box or other appropriate place where other copyright notices are
placed, including any packaging materials.

2.2 You expressly acknowledge and agree that although Licensor and each
Contributor grants the licenses to their respective portions of the Covered Code
set forth herein, no assurances are provided by Licensor or any Contributor that
the Covered Code does not infringe the patent or other intellectual property
rights of any other entity. Licensor and each Contributor disclaim any liability
to You for claims brought by any other entity based on infringement of
intellectual property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, You hereby assume sole responsibility to
secure any other intellectual property rights needed, if any. For example, if a
third party patent license is required to allow You to make, use, sell, import
or offer for sale the Covered Code, it is Your responsibility to acquire such
license(s).

2.3 Subject to the terms and conditions of this License, Licensor hereby grants
You, effective on the date You accept this License (via downloading or using
Covered Code or otherwise indicating your acceptance of this License), a
worldwide, royalty-free, perpetual, non-exclusive patent license under
Licensor's Applicable Patent Rights to make, use, sell, offer for sale and
import the Covered Code, provided that in each instance you comply with the
terms of this License.

3. Your Grants. In consideration of, and as a condition to, the licenses granted
to You under this License:

(a) You grant to Licensor and all third parties a non-exclusive, perpetual,
irrevocable, royalty free license under Your Applicable Patent Rights and other
intellectual property rights owned or controlled by You, to make, sell, offer
for sale, use, import, reproduce, display, perform, modify, distribute and
Deploy Your Modifications of the same scope and extent as Licensor's licenses
under Sections 2.1 and 2.2; and

(b) You grant to Licensor and its subsidiaries a non-exclusive, worldwide,
royalty-free, perpetual and irrevocable license, under Your Applicable Patent
Rights and other intellectual property rights owned or controlled by You, to
make, use, sell, offer for sale, import, reproduce, display, perform,
distribute, modify or have modified (for Licensor and/or its subsidiaries),
sublicense and distribute Your Modifications, in any form and for any purpose,
through multiple tiers of distribution.

(c) You agree not use any information derived from Your use and review of the
Covered Code, including but not limited to any algorithms or inventions that may
be contained in the Covered Code, for the purpose of asserting any of Your
patent rights, or assisting a third party to assert any of its patent rights,
against Licensor or any Contributor.

4. Derivative Works. You may create a Derivative Work by combining Covered Code
with other code not otherwise governed by the terms of this License and
distribute the Derivative Work as an integrated product. In each such instance,
You must make sure the requirements of this License are fulfilled for the
Covered Code or any portion thereof, including all Modifications.

4.1 You must cause any Derivative Work that you distribute, publish or
Externally Deploy, that in whole or in part contains or is derived from the
Covered Code or any part thereof, to be licensed as a whole at no charge to all
third parties under the terms of this License and no other license except as
provided in Section 4.2. You also must make Source Code available for the
Derivative Work under the same terms as Modifications, described in Sections 2
and 3, above.

4.2 Compatible Source Licenses. Software modules that have been independently
developed without any use of Covered Code and which contain no portion of the
Covered Code, Modifications or other Derivative Works, but are used or combined
in any way wtih the Covered Code or any Derivative Work to form a larger
Derivative Work, are exempt from the conditions described in Section 4.1 but
only to the extent that: the software module, including any software that is
linked to, integrated with, or part of the same applications as, the software
module by any method must be wholly subject to one of the Compatible Source
Licenses. Notwithstanding the foregoing, all Covered Code must be subject to the
terms of this License. Thus, the entire Derivative Work must be licensed under a
combination of the RPSL (for Covered Code) and a Compatible Source License for
any independently developed software modules within the Derivative Work. The
foregoing requirement applies even if the Compatible Source License would
ordinarily allow the software module to link with, or form larger works with,
other software that is not subject to the Compatible Source License. For
example, although the Mozilla Public License v1.1 allows Mozilla code to be
combined with proprietary software that is not subject to the MPL, if
MPL-licensed code is used with Covered Code the MPL-licensed code could not be
combined or linked with any code not governed by the MPL. The general intent of
this section 4.2 is to enable use of Covered Code with applications that are
wholly subject to an acceptable open source license. You are responsible for
determining whether your use of software with Covered Code is allowed under Your
license to such software.

4.3 Mere aggregation of another work not based on the Covered Code with the
Covered Code (or with a work based on the Covered Code) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License. If You deliver the Covered Code for combination and/or integration with
an application previously provided by You (for example, via automatic updating
technology), such combination and/or integration constitutes a Derivative Work
subject to the terms of this License.

5. Exclusions From License Grant. Nothing in this License shall be deemed to
grant any rights to trademarks, copyrights, patents, trade secrets or any other
intellectual property of Licensor or any Contributor except as expressly stated
herein. No right is granted to the trademarks of Licensor or any Contributor
even if such marks are included in the Covered Code. Nothing in this License
shall be interpreted to prohibit Licensor from licensing under different terms
from this License any code that Licensor otherwise would have a right to
license. Modifications, Derivative Works and/or any use or combination of
Covered Code with other technology provided by Licensor or third parties may
require additional patent licenses from Licensor which Licensor may grant in its
sole discretion. No patent license is granted separate from the Original Code or
combinations of the Original Code with other software or hardware.

5.1. Trademarks. This License does not grant any rights to use the trademarks or
trade names owned by Licensor ("Licensor Marks" defined in Exhibit C) or to any
trademark or trade name belonging to any Contributor. No Licensor Marks may be
used to endorse or promote products derived from the Original Code other than as
permitted by the Licensor Trademark Policy defined in Exhibit C.

6. Additional Terms. You may choose to offer, and to charge a fee for, warranty,
support, indemnity or liability obligations and/or other rights consistent with
the scope of the license granted herein ("Additional Terms") to one or more
recipients of Covered Code. However, You may do so only on Your own behalf and
as Your sole responsibility, and not on behalf of Licensor or any Contributor.
You must obtain the recipient's agreement that any such Additional Terms are
offered by You alone, and You hereby agree to indemnify, defend and hold
Licensor and every Contributor harmless for any liability incurred by or claims
asserted against Licensor or such Contributor by reason of any such Additional
Terms.

7. Versions of the License. Licensor may publish revised and/or new versions of
this License from time to time. Each version will be given a distinguishing
version number. Once Original Code has been published under a particular version
of this License, You may continue to use it under the terms of that version. You
may also choose to use such Original Code under the terms of any subsequent
version of this License published by Licensor. No one other than Licensor has
the right to modify the terms applicable to Covered Code created under this
License.

8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part
pre-release, untested, or not fully tested works. The Covered Code may contain
errors that could cause failures or loss of data, and may be incomplete or
contain inaccuracies. You expressly acknowledge and agree that use of the
Covered Code, or any portion thereof, is at Your sole and entire risk. THE
COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF
ANY KIND AND LICENSOR AND LICENSOR'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS
"LICENSOR" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY
DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF
SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET
ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. LICENSOR AND EACH
CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE
COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR
REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR
ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR
WRITTEN DOCUMENTATION, INFORMATION OR ADVICE GIVEN BY LICENSOR, A LICENSOR
AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You
acknowledge that the Covered Code is not intended for use in high risk
activities, including, but not limited to, the design, construction, operation
or maintenance of nuclear facilities, aircraft navigation, aircraft
communication systems, or air traffic control machines in which case the failure
of the Covered Code could lead to death, personal injury, or severe physical or
environmental damage. Licensor disclaims any express or implied warranty of
fitness for such uses.

9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT
SHALL LICENSOR OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR
YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER
UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE OR STRICT
LIABILITY), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF LICENSOR OR SUCH
CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND
NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME
JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR
CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event
shall Licensor's total liability to You for all damages (other than as may be
required by applicable law) under this License exceed the amount of ten dollars
($10.00).

10. Ownership. Subject to the licenses granted under this License, each
Contributor retains all rights, title and interest in and to any Modifications
made by such Contributor. Licensor retains all rights, title and interest in and
to the Original Code and any Modifications made by or on behalf of Licensor
("Licensor Modifications"), and such Licensor Modifications will not be
automatically subject to this License. Licensor may, at its sole discretion,
choose to license such Licensor Modifications under this License, or on
different terms from those contained in this License or may choose not to
license them at all.

11. Termination. 

11.1 Term and Termination. The term of this License is perpetual unless
terminated as provided below. This License and the rights granted hereunder will
terminate:

(a) automatically without notice from Licensor if You fail to comply with any
term(s) of this License and fail to cure such breach within 30 days of becoming
aware of such breach;

(b) immediately in the event of the circumstances described in Section 12.5(b);
or

(c) automatically without notice from Licensor if You, at any time during the
term of this License, commence an action for patent infringement against
Licensor (including by cross-claim or counter claim in a lawsuit);

(d) upon written notice from Licensor if You, at any time during the term of
this License, commence an action for patent infringement against any third party
alleging that the Covered Code itself (excluding combinations with other
software or hardware) infringes any patent (including by cross-claim or counter
claim in a lawsuit).

11.2 Effect of Termination. Upon termination, You agree to immediately stop any
further use, reproduction, modification, sublicensing and distribution of the
Covered Code and to destroy all copies of the Covered Code that are in your
possession or control. All sublicenses to the Covered Code which have been
properly granted prior to termination shall survive any termination of this
License. Provisions which, by their nature, should remain in effect beyond the
termination of this License shall survive, including but not limited to Sections
3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for
compensation, indemnity or damages of any sort solely as a result of terminating
this License in accordance with its terms, and termination of this License will
be without prejudice to any other right or remedy of any party.

12. Miscellaneous.

12.1 Government End Users. The Covered Code is a "commercial item" as defined in
FAR 2.101. Government software and technical data rights in the Covered Code
include only those rights customarily provided to the public as defined in this
License. This customary commercial license in technical data and software is
provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer
Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical
Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software
or Computer Software Documentation). Accordingly, all U.S. Government End Users
acquire Covered Code with only those rights set forth herein.

12.2 Relationship of Parties. This License will not be construed as creating an
agency, partnership, joint venture or any other form of legal association
between or among You, Licensor or any Contributor, and You will not represent to
the contrary, whether expressly, by implication, appearance or otherwise.

12.3 Independent Development. Nothing in this License will impair Licensor's
right to acquire, license, develop, have others develop for it, market and/or
distribute technology or products that perform the same or similar functions as,
or otherwise compete with, Modifications, Derivative Works, technology or
products that You may develop, produce, market or distribute.

12.4 Waiver; Construction. Failure by Licensor or any Contributor to enforce any
provision of this License will not be deemed a waiver of future enforcement of
that or any other provision. Any law or regulation which provides that the
language of a contract shall be construed against the drafter will not apply to
this License.

12.5 Severability. (a) If for any reason a court of competent jurisdiction finds
any provision of this License, or portion thereof, to be unenforceable, that
provision of the License will be enforced to the maximum extent permissible so
as to effect the economic benefits and intent of the parties, and the remainder
of this License will continue in full force and effect. (b) Notwithstanding the
foregoing, if applicable law prohibits or restricts You from fully and/or
specifically complying with Sections 2 and/or 3 or prevents the enforceability
of either of those Sections, this License will immediately terminate and You
must immediately discontinue any use of the Covered Code and destroy all copies
of it that are in your possession or control.

12.6 Dispute Resolution. Any litigation or other dispute resolution between You
and Licensor relating to this License shall take place in the Seattle,
Washington, and You and Licensor hereby consent to the personal jurisdiction of,
and venue in, the state and federal courts within that District with respect to
this License. The application of the United Nations Convention on Contracts for
the International Sale of Goods is expressly excluded.

12.7 Export/Import Laws. This software is subject to all export and import laws
and restrictions and regulations of the country in which you receive the Covered
Code and You are solely responsible for ensuring that You do not export,
re-export or import the Covered Code or any direct product thereof in violation
of any such restrictions, laws or regulations, or without all necessary
authorizations.

12.8 Entire Agreement; Governing Law. This License constitutes the entire
agreement between the parties with respect to the subject matter hereof. This
License shall be governed by the laws of the United States and the State of
Washington.

Where You are located in the province of Quebec, Canada, the following clause
applies: The parties hereby confirm that they have requested that this License
and all related documents be drafted in English. Les parties ont exigé
que le présent contrat et tous les documents connexes soient
rédigés en anglais.

								EXHIBIT A.  

"Copyright © 1995-2002
RealNetworks, Inc. and/or its licensors. All Rights Reserved.

The contents of this file, and the files included with this file, are subject to
the current version of the RealNetworks Public Source License Version 1.0 (the
"RPSL") available at https://www.helixcommunity.org/content/rpsl unless you have
licensed the file under the RealNetworks Community Source License Version 1.0
(the "RCSL") available at https://www.helixcommunity.org/content/rcsl, in which
case the RCSL will apply. You may also obtain the license terms directly from
RealNetworks. You may not use this file except in compliance with the RPSL or,
if you have a valid RCSL with RealNetworks applicable to this file, the RCSL.
Please see the applicable RPSL or RCSL for the rights, obligations and
limitations governing use of the contents of the file.

This file is part of the Helix DNA Technology. RealNetworks is the developer of
the Original code and owns the copyrights in the portions it created.

This file, and the files included with this file, is distributed and made
available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING
WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.

Contributor(s): ____________________________________ 

Technology Compatibility Kit Test
Suite(s) Location (if licensed under the RCSL): ______________________________ 

Object Code Notice: Helix DNA Client technology included. Copyright (c)
RealNetworks, Inc., 1995-2002. All rights reserved.


								EXHIBIT B 

Compatible Source Licenses for the RealNetworks Public Source License. The
following list applies to the most recent version of the license as of October
25, 2002, unless otherwise indicated.

* Academic Free License
* Apache Software License
* Apple Public Source License
* Artistic license
* Attribution Assurance Licenses
* BSD license
* Common Public License (1)
* Eiffel Forum License
* GNU General Public License (GPL) (1)
* GNU Library or "Lesser" General Public License (LGPL) (1)
* IBM Public License
* Intel Open Source License
* Jabber Open Source License
* MIT license
* MITRE Collaborative Virtual Workspace License (CVW License)
* Motosoto License
* Mozilla Public License 1.0 (MPL)
* Mozilla Public License 1.1 (MPL)
* Nokia Open Source License
* Open Group Test Suite License
* Python Software Foundation License
* Ricoh Source Code Public License
* Sun Industry Standards Source License (SISSL)
* Sun Public License
* University of Illinois/NCSA Open Source License
* Vovida Software License v. 1.0
* W3C License
* X.Net License
* Zope Public License
* zlib/libpng license

(1) Note: because this license contains certain reciprocal licensing terms that
purport to extend to independently developed code, You may be prohibited under
the terms of this otherwise compatible license from using code licensed under
its terms with Covered Code because Covered Code may only be licensed under the
RealNetworks Public Source License. Any attempt to apply non RPSL license terms,
including without limitation the GPL, to Covered Code is expressly forbidden.
You are responsible for ensuring that Your use of Compatible Source Licensed
code does not violate either the RPSL or the Compatible Source License.

The latest version of this list can be found at:
https://www.helixcommunity.org/content/complicense

								EXHIBIT C 

RealNetworks' Trademark policy.  

RealNetworks defines the following trademarks collectively as "Licensor
Trademarks": "RealNetworks", "RealPlayer", "RealJukebox", "RealSystem",
"RealAudio", "RealVideo", "RealOne Player", "RealMedia", "Helix" or any other
trademarks or trade names belonging to RealNetworks.

RealNetworks "Licensor Trademark Policy" forbids any use of Licensor Trademarks
except as permitted by and in strict compliance at all times with RealNetworks'
third party trademark usage guidelines which are posted at
http://www.realnetworks.com/info/helixlogo.html.


--- NEW FILE: mmapbuf.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: mmapbuf.cpp,v 1.1 2005/06/08 18:01:08 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */


#include "hxtypes.h"
#include "hxcom.h"

#include 
#include 

#if defined(_LINUX) && !defined(__USE_BSD)
#  define __USE_BSD
#endif

#include 

#include "hxassert.h"
#include "ihxpckts.h"

#include "mmapbuf.h"

#ifdef _LINUX

// we define this here because on linux-2.2 it doesn't exist
extern int madvise(void *start, size_t length, int advice);
asm (".weak  madvise");

// if this isn't defined we won't be using it so it doesn't really
// matter what value we set for it, but we need to be able to compile
// on linux 2.2 and we might as well set the value that looks correct
#  ifndef MADV_WILLNEED
#    define MADV_WILLNEED 0x3
#  endif // MADV_WILLNEED

#endif // _LINUX

#ifdef _SOLARIS
extern int madvise(caddr_t, size_t, int);
#endif

AsyncFSMMapBuffer::AsyncFSMMapBuffer(void* pBuffer, size_t length)
{
    m_pBuffer = pBuffer;
    m_ulLength = length;
    m_lRefCount = 0;
}

AsyncFSMMapBuffer::~AsyncFSMMapBuffer()
{
    if (m_pBuffer)
        munmap((char*)m_pBuffer, m_ulLength);
    m_pBuffer = 0;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//      IUnknown::QueryInterface
//  Purpose:
//      Implement this to export the interfaces supported by your
//      object.
//
STDMETHODIMP
AsyncFSMMapBuffer::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
        AddRef();
        *ppvObj = this;
        return HXR_OK;
    }

    if (IsEqualIID(riid, IID_IHXBuffer))
    {
        AddRef();
        *ppvObj = (IHXBuffer*)this;
        return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//      IUnknown::AddRef
//  Purpose:
//      Everyone usually implements this the same... feel free to use
//      this implementation.
//
STDMETHODIMP_(ULONG32)
AsyncFSMMapBuffer::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//      IUnknown::Release
//  Purpose:
//      Everyone usually implements this the same... feel free to use
//      this implementation.
//
STDMETHODIMP_(ULONG32)
AsyncFSMMapBuffer::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}

STDMETHODIMP
AsyncFSMMapBuffer::Get(REF(UCHAR*) pData, REF(ULONG32) ulLength)
{
    pData = (UCHAR*)m_pBuffer;
    ulLength = (ULONG32)m_ulLength;

    return HXR_OK;
}

STDMETHODIMP
AsyncFSMMapBuffer::Set(const UCHAR* pData, ULONG32 ulLength)
{
    HX_ASSERT(0);
    return HXR_FAIL;
}

STDMETHODIMP
AsyncFSMMapBuffer::SetSize(ULONG32 ulLength)
{
    HX_ASSERT(0);
    return HXR_FAIL;
}

STDMETHODIMP_(ULONG32)
AsyncFSMMapBuffer::GetSize()
{
    return m_ulLength;
}

STDMETHODIMP_(UCHAR*)
AsyncFSMMapBuffer::GetBuffer()
{
    return (UCHAR*)m_pBuffer;
}

HX_RESULT
LoadMemoryNow(char* pBuf, size_t ulCount, size_t ulPageSize)
{
#if defined _SOLARIS

    if (madvise(pBuf, ulCount, MADV_WILLNEED) < 0)
    {
        perror("madvise failed");
        return HXR_FAIL;
    }

    return HXR_OK;

#elif defined _LINUX

    // since linux is threaded there's a race condition to set this var
    // but it doesn't matter, everyone's setting it to the same value
    static BOOL g_bMAdviseSupported = TRUE;

    if (g_bMAdviseSupported && madvise != 0)
    {
        if (madvise(pBuf, ulCount, MADV_WILLNEED) < 0)
        {
            if (errno == ENOSYS)
            {
                // madvise defined but not implemented
                g_bMAdviseSupported = FALSE;
                goto TOUCH_EACH_PAGE;
            }
            perror("madvise failed");
            return HXR_FAIL;
        }
        return HXR_OK;
    }

#endif // _SOLARIS

TOUCH_EACH_PAGE:
    // touch each page to force the os to do an nfs read for each
    volatile char ch;
    volatile char* volatile pBuffer = pBuf;
    char* limit = ulCount + pBuf;
    for (size_t i = 0; (pBuffer + i *ulPageSize) < limit; i++)
    {    
        ch = *(pBuffer + i * ulPageSize);
    }

    return HXR_OK;
}

--- NEW FILE: mmapbuf.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: mmapbuf.h,v 1.1 2005/06/08 18:01:08 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */


#ifndef _MMAPBUF_H_
#define _MMAPBUF_H_

class AsyncFSMMapBuffer : public IHXBuffer
{
public:
    AsyncFSMMapBuffer(void* pBuffer, size_t length);
    ~AsyncFSMMapBuffer();

    // IUnknown methods
    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)  (THIS);
    STDMETHOD_(ULONG32,Release) (THIS);

    /*
     *  IHXBuffer methods
     */
    STDMETHOD(Get)             (THIS_ REF(UCHAR*) pData, REF(ULONG32) ulLength);
    STDMETHOD(Set)              (THIS_ const UCHAR* pData, ULONG32 ulLength);
    STDMETHOD(SetSize)          (THIS_ ULONG32 ulLength);
    STDMETHOD_(ULONG32,GetSize) (THIS);
    STDMETHOD_(UCHAR*,GetBuffer)(THIS);

private:
    INT32  m_lRefCount;
    void*  m_pBuffer;
    size_t m_ulLength;
};

extern HX_RESULT LoadMemoryNow(char* pBuffer, size_t ulCount, size_t ulPageSize);

#endif // _MMAPBUF_H_

--- NEW FILE: LICENSE.txt ---
 Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.  
        
 The contents of this directory, and (except where otherwise
 indicated) the directories included within this directory, are
 subject to the current version of the RealNetworks Public Source
 License (the "RPSL") available at RPSL.txt in this directory, unless
 you have licensed the directory under the current version of the
 RealNetworks Community Source License (the "RCSL") available at
 RCSL.txt in this directory, in which case the RCSL will apply. You
 may also obtain the license terms directly from RealNetworks.  You
 may not use the files in this directory except in compliance with the
 RPSL or, if you have a valid RCSL with RealNetworks applicable to
 this directory, the RCSL.  Please see the applicable RPSL or RCSL for
 the rights, obligations and limitations governing use of the contents
 of the directory.
 
 This directory is part of the Helix DNA Technology. RealNetworks is
 the developer of the Original Code and owns the copyrights in the
 portions it created.
   
 This directory, and the directories included with this directory, are
 distributed and made available on an 'AS IS' basis, WITHOUT WARRANTY
 OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY
 DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY
 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
 QUIET ENJOYMENT OR NON-INFRINGEMENT.
  
 Technology Compatibility Kit Test Suite(s) Location:  
    http://www.helixcommunity.org/content/tck  


--- NEW FILE: RCSL.txt ---
The RCSL is made up of a base agreement and a few Attachments.

For Research and Development use, you agree to the terms of the
RCSL R&D License (base RCSL and Attachments A, B, and C) 

For Commercial Use (either distribution or internal commercial
deployment) of the Helix DNA with or without support for RealNetworks'
RealAudio and RealVideo Add-on Technology, you agree to the
terms of the same RCSL R&D license
and execute one or more additional Commercial Use License attachments
.

------------------------------------------------------------------------


    REALNETWORKS COMMUNITY SOURCE LICENSE

Version 1.2 (Rev. Date: January 22, 2003).


  RECITALS

Original Contributor has developed Specifications, Source Code
implementations and Executables of certain Technology; and

Original Contributor desires to license the Technology to a large
community to facilitate research, innovation and product development
while maintaining compatibility of such products with the Technology as
delivered by Original Contributor; and

Original Contributor desires to license certain Trademarks for the
purpose of branding products that are compatible with the relevant
Technology delivered by Original Contributor; and

You desire to license the Technology and possibly certain Trademarks
from Original Contributor on the terms and conditions specified in this
License.

In consideration for the mutual covenants contained herein, You and
Original Contributor agree as follows:


  AGREEMENT

*1. Introduction.*

The RealNetworks Community Source License ("RCSL") and effective
attachments ("License") may include five distinct licenses:

i) Research Use license -- License plus Attachments A, B and C only.

ii) Commercial Use and Trademark License, which may be for Internal
Deployment Use or external distribution, or both -- License plus
Attachments A, B, C, and D.

iii) Technology Compatibility Kit (TCK) license -- Attachment C.

iv) Add-On Technology License (Executable) Commercial Use License
-Attachment F.

v) Add-On Technology Source Code Porting and Optimization
License-Attachment G.

The Research Use license is effective when You click and accept this
License. The TCK is effective when You click and accept this License,
unless otherwise specified in the TCK attachments. The Commercial Use
and Trademark, Add-On Technology License, and the Add-On Technology
Source Code Porting and Optimization licenses must each be signed by You
and Original Contributor to become effective. Once effective, these
licenses and the associated requirements and responsibilities are
cumulative. Capitalized terms used in this License are defined in the
Glossary.

*2. License Grants.*

2.1 Original Contributor Grant.

Subject to Your compliance with Sections 3, 8.10 and Attachment A of
this License, Original Contributor grants to You a worldwide,
royalty-free, non-exclusive license, to the extent of Original
Contributor's Intellectual Property Rights covering the Original Code,
Upgraded Code and Specifications, to do the following:

(a) Research Use License:

(i) use, reproduce and modify the Original Code, Upgraded Code and
Specifications to create Modifications and Reformatted Specifications
for Research Use by You;

(ii) publish and display Original Code, Upgraded Code and Specifications
with, or as part of Modifications, as permitted under Section 3.1(b) below;

(iii) reproduce and distribute copies of Original Code and Upgraded Code
to Licensees and students for Research Use by You;

(iv) compile, reproduce and distribute Original Code and Upgraded Code
in Executable form, and Reformatted Specifications to anyone for
Research Use by You.

(b) Other than the licenses expressly granted in this License, Original
Contributor retains all right, title, and interest in Original Code and
Upgraded Code and Specifications.

2.2 Your Grants.

(a) To Other Licensees. You hereby grant to each Licensee a license to
Your Error Corrections and Shared Modifications, of the same scope and
extent as Original Contributor's licenses under Section 2.1 a) above
relative to Research Use and Attachment D relative to Commercial Use.

(b) To Original Contributor. You hereby grant to Original Contributor a
worldwide, royalty-free, non-exclusive, perpetual and irrevocable
license, to the extent of Your Intellectual Property Rights covering
Your Error Corrections, Shared Modifications and Reformatted
Specifications, to use, reproduce, modify, display and distribute Your
Error Corrections, Shared Modifications and Reformatted Specifications,
in any form, including the right to sublicense such rights through
multiple tiers of distribution.

(c) Other than the licenses expressly granted in Sections 2.2(a) and (b)
above, and the restrictions set forth in Section 3.1(d)(iv) below, You
retain all right, title, and interest in Your Error Corrections, Shared
Modifications and Reformatted Specifications.

2.3 Contributor Modifications.

You may use, reproduce, modify, display and distribute Contributor Error
Corrections, Shared Modifications and Reformatted Specifications,
obtained by You under this License, to the same scope and extent as with
Original Code, Upgraded Code and Specifications.

2.4 Subcontracting.

You may deliver the Source Code of Covered Code to other Licensees
having at least a Research Use license, for the sole purpose of
furnishing development services to You in connection with Your rights
granted in this License. All such Licensees must execute appropriate
documents with respect to such work consistent with the terms of this
License, and acknowledging their work-made-for-hire status or assigning
exclusive right to the work product and associated Intellectual Property
Rights to You.

*3. Requirements and Responsibilities*.

3.1 Research Use License.

As a condition of exercising the rights granted under Section 2.1(a)
above, You agree to comply with the following:

(a) Your Contribution to the Community. All Error Corrections and Shared
Modifications which You create or contribute to are automatically
subject to the licenses granted under Section 2.2 above. You are
encouraged to license all of Your other Modifications under Section 2.2
as Shared Modifications, but are not required to do so. You agree to
notify Original Contributor of any errors in the Specification.

(b) Source Code Availability. You agree to provide all Your Error
Corrections to Original Contributor as soon as reasonably practicable
and, in any event, prior to Internal Deployment Use or Commercial Use,
if applicable. Original Contributor may, at its discretion, post Source
Code for Your Error Corrections and Shared Modifications on the
Community Webserver. You may also post Error Corrections and Shared
Modifications on a web-server of Your choice; provided, that You must
take reasonable precautions to ensure that only Licensees have access to
such Error Corrections and Shared Modifications. Such precautions shall
include, without limitation, a password protection scheme limited to
Licensees and a click-on, download certification of Licensee status
required of those attempting to download from the server. An example of
an acceptable certification is attached as Attachment A-2.

(c) Notices. All Error Corrections and Shared Modifications You create
or contribute to must include a file documenting the additions and
changes You made and the date of such additions and changes. You must
also include the notice set forth in Attachment A-1 in the file header.
If it is not possible to put the notice in a particular Source Code file
due to its structure, then You must include the notice in a location
(such as a relevant directory file), where a recipient would be most
likely to look for such a notice.

(d) Redistribution.

(i) Source. Covered Code may be distributed in Source Code form only to
another Licensee (except for students as provided below). You may not
offer or impose any terms on any Covered Code that alter the rights,
requirements, or responsibilities of such Licensee. You may distribute
Covered Code to students for use in connection with their course work
and research projects undertaken at accredited educational institutions.
Such students need not be Licensees, but must be given a copy of the
notice set forth in Attachment A-3 and such notice must also be included
in a file header or prominent location in the Source Code made available
to such students.

(ii) Executable. You may distribute Executable version(s) of Covered
Code to Licensees and other third parties only for the purpose of
evaluation and comment in connection with Research Use by You and under
a license of Your choice, but which limits use of such Executable
version(s) of Covered Code only to that purpose.

(iii) Modified Class, Interface and Package Naming. In connection with
Research Use by You only, You may use Original Contributor's class,
Interface and package names only to accurately reference or invoke the
Source Code files You modify. Original Contributor grants to You a
limited license to the extent necessary for such purposes.

(iv) You expressly agree that any distribution, in whole or in part, of
Modifications developed by You shall only be done pursuant to the terms
and conditions of this License.

(e) Extensions.

(i) Covered Code. You may not include any Source Code of Community Code
in any Extensions. You may include the compiled Header Files of
Community Code in an Extension provided that Your use of the Covered
Code, including Heading Files, complies with the Commercial Use License,
the TCK and all other terms of this License.

(ii) Publication. No later than the date on which You first distribute
such Extension for Commercial Use, You must publish to the industry, on
a non-confidential basis and free of all copyright restrictions with
respect to reproduction and use, an accurate and current specification
for any Extension. In addition, You must make available an appropriate
test suite, pursuant to the same rights as the specification,
sufficiently detailed to allow any third party reasonably skilled in the
technology to produce implementations of the Extension compatible with
the specification. Such test suites must be made available as soon as
reasonably practicable but, in no event, later than ninety (90) days
after Your first Commercial Use of the Extension. You must use
reasonable efforts to promptly clarify and correct the specification and
the test suite upon written request by Original Contributor.

(iii) Open. You agree to refrain from enforcing any Intellectual
Property Rights You may have covering any interface(s) of Your
Extension, which would prevent the implementation of such interface(s)
by Original Contributor or any Licensee. This obligation does not
prevent You from enforcing any Intellectual Property Right You have that
would otherwise be infringed by an implementation of Your Extension.

(iv) Interface Modifications and Naming. You may not modify or add to
the GUID space * * "xxxxxxxx-0901-11d1-8B06-00A024406D59" or any other
GUID space designated by Original Contributor. You may not modify any
Interface prefix provided with the Covered Code or any other prefix
designated by Original Contributor.* *

* *

(f) You agree that any Specifications provided to You by Original
Contributor are confidential and proprietary information of Original
Contributor. You must maintain the confidentiality of the Specifications
and may not disclose them to any third party without Original
Contributor's prior written consent. You may only use the Specifications
under the terms of this License and only for the purpose of implementing
the terms of this License with respect to Covered Code. You agree not
use, copy or distribute any such Specifications except as provided in
writing by Original Contributor.

3.2 Commercial Use License.

You may not make Commercial Use of any Covered Code unless You and
Original Contributor have executed a copy of the Commercial Use and
Trademark License attached as Attachment D.

*4. Versions of the License.*

4.1 License Versions.

Original Contributor may publish revised versions of the License from
time to time. Each version will be given a distinguishing version number.

4.2 Effect.

Once a particular version of Covered Code has been provided under a
version of the License, You may always continue to use such Covered Code
under the terms of that version of the License. You may also choose to
use such Covered Code under the terms of any subsequent version of the
License. No one other than Original Contributor has the right to
promulgate License versions.

4.3 Multiple-Licensed Code.

Original Contributor may designate portions of the Covered Code as
"Multiple-Licensed." "Multiple-Licensed" means that the Original
Contributor permits You to utilize those designated portions of the
Covered Code under Your choice of this License or the alternative
license(s), if any, specified by the Original Contributor in an
Attachment to this License.

*5. Disclaimer of Warranty.*

5.1 COVERED CODE PROVIDED AS IS.

COVERED CODE IS PROVIDED UNDER THIS LICENSE "AS IS," WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT
FOR A PARTICULAR PURPOSE OR NON-INFRINGING. YOU AGREE TO BEAR THE ENTIRE
RISK IN CONNECTION WITH YOUR USE AND DISTRIBUTION OF COVERED CODE UNDER
THIS LICENSE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART
OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER
EXCEPT SUBJECT TO THIS DISCLAIMER.

5.2 Not Designed for High Risk Activities.

You acknowledge that Original Code, Upgraded Code and Specifications are
not designed or intended for use in high risk activities including, but
not limited to: (i) on-line control of aircraft, air traffic, aircraft
navigation or aircraft communications; or (ii) in the design,
construction, operation or maintenance of any nuclear facility. Original
Contributor disclaims any express or implied warranty of fitness for
such uses.

*6. Termination.*

6.1 By You.

You may terminate this Research Use license at anytime by providing
written notice to Original Contributor.

6.2 By Original Contributor.

This License and the rights granted hereunder will terminate:

(i) automatically if You fail to comply with the terms of this License
and fail to cure such breach within 30 days of receipt of written notice
of the breach;

(ii) immediately in the event of circumstances specified in Sections 7.1
and 8.4; or

(iii) at Original Contributor's discretion upon any action initiated by
You (including by cross-claim or counter claim) alleging that use or
distribution by Original Contributor or any Licensee, of Original Code,
Upgraded Code, Error Corrections, Shared Modifications or Specifications
infringe a patent owned or controlled by You.

6.3 Effective of Termination.

Upon termination, You agree to discontinue use of and destroy all copies
of Covered Code in Your possession. All sublicenses to the Covered Code
which You have properly granted shall survive any termination of this
License. Provisions that, by their nature, should remain in effect
beyond the termination of this License shall survive including, without
limitation, Sections 2.2, 3, 5, 7 and 8.

6.4 No Compensation.

Each party waives and releases the other from any claim to compensation
or indemnity for permitted or lawful termination of the business
relationship established by this License.

*7. Liability.*

7.1 Infringement. Should any of the Original Code, Upgraded Code, TCK or
Specifications ("Materials") become the subject of a claim of
infringement, Original Contributor may, at its sole option, (i) attempt
to procure the rights necessary for You to continue using the Materials,
(ii) modify the Materials so that they are no longer infringing, or
(iii) terminate Your right to use the Materials, immediately upon
written notice, and refund to You the amount, if any, having then
actually been paid by You to Original Contributor for the Original Code,
Upgraded Code and TCK, depreciated on a straight line, five year basis.

7.2 LIMITATION OF LIABILITY. TO THE FULL EXTENT ALLOWED BY APPLICABLE
LAW, ORIGINAL CONTRIBUTOR'S LIABILITY TO YOU FOR CLAIMS RELATING TO THIS
LICENSE, WHETHER FOR BREACH OR IN TORT, SHALL BE LIMITED TO ONE HUNDRED
PERCENT (100%) OF THE AMOUNT HAVING THEN ACTUALLY BEEN PAID BY YOU TO
ORIGINAL CONTRIBUTOR FOR ALL COPIES LICENSED HEREUNDER OF THE PARTICULAR
ITEMS GIVING RISE TO SUCH CLAIM, IF ANY, DURING THE TWELVE MONTHS
PRECEDING THE CLAIMED BREACH. IN NO EVENT WILL YOU (RELATIVE TO YOUR
SHARED MODIFICATIONS OR ERROR CORRECTIONS) OR ORIGINAL CONTRIBUTOR BE
LIABLE FOR ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES IN CONNECTION WITH OR RISING OUT OF THIS LICENSE (INCLUDING,
WITHOUT LIMITATION, LOSS OF PROFITS, USE, DATA, OR OTHER ECONOMIC
ADVANTAGE), HOWEVER IT ARISES AND ON ANY THEORY OF LIABILITY, WHETHER IN
AN ACTION FOR CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE)
OR OTHERWISE, WHETHER OR NOT YOU OR ORIGINAL CONTRIBUTOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE AND NOTWITHSTANDING THE
FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY.

*8. Miscellaneous.*

8.1 Trademark.

You shall not use any Trademark unless You and Original Contributor
execute a copy of the Commercial Use and Trademark License Agreement
attached hereto as Attachment D. Except as expressly provided in the
License, You are granted no right, title or license to, or interest in,
any Trademarks. Whether or not You and Original Contributor enter into
the Trademark License, You agree not to (i) challenge Original
Contributor's ownership or use of Trademarks; (ii) attempt to register
any Trademarks, or any mark or logo substantially similar thereto; or
(iii) incorporate any Trademarks into Your own trademarks, product
names, service marks, company names, or domain names.

8.2 Integration.

This License represents the complete agreement concerning the subject
matter hereof.

8.3 Assignment.

Original Contributor may assign this License, and its rights and
obligations hereunder, in its sole discretion. You may assign the
Research Use portions of this License and the TCK license to a third
party upon prior written notice to Original Contributor (which may be
provided electronically via the Community Web-Server). You may not
assign the Commercial Use and Trademark license, the Add-On Technology
License, or the Add-On Technology Source Code Porting License, including
by way of merger (regardless of whether You are the surviving entity) or
acquisition, without Original Contributor's prior written consent.

8.4 Severability.

If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it
enforceable. Notwithstanding the foregoing, if You are prohibited by law
from fully and specifically complying with Sections 2.2 or 3, this
License will immediately terminate and You must immediately discontinue
any use of Covered Code.

8.5 Governing Law.

This License shall be governed by the laws of the United States and the
State of Washington, as applied to contracts entered into and to be
performed in Washington between Washington residents. The application of
the United Nations Convention on Contracts for the International Sale of
Goods is expressly excluded. You agree that the state and federal courts
located in Seattle, Washington have exclusive jurisdiction over any
claim relating to the License, including contract and tort claims.

8.6 Dispute Resolution.

a) Arbitration. Any dispute arising out of or relating to this License
shall be finally settled by arbitration as set out herein, except that
either party may bring any action, in a court of competent jurisdiction
(which jurisdiction shall be exclusive), with respect to any dispute
relating to such party's Intellectual Property Rights or with respect to
Your compliance with the TCK license. Arbitration shall be administered:
(i) by the American Arbitration Association (AAA), (ii) in accordance
with the rules of the United Nations Commission on International Trade
Law (UNCITRAL) (the "Rules") in effect at the time of arbitration as
modified herein; and (iii) the arbitrator will apply the substantive
laws of Washington and the United States. Judgment upon the award
rendered by the arbitrator may be entered in any court having
jurisdiction to enforce such award.

b) Arbitration language, venue and damages. All arbitration proceedings
shall be conducted in English by a single arbitrator selected in
accordance with the Rules, who must be fluent in English and be either a
retired judge or practicing attorney having at least ten (10) years
litigation experience and be reasonably familiar with the technology
matters relative to the dispute. Unless otherwise agreed, arbitration
venue shall be in Seattle, Washington. The arbitrator may award monetary
damages only and nothing shall preclude either party from seeking
provisional or emergency relief from a court of competent jurisdiction.
The arbitrator shall have no authority to award damages in excess of
those permitted in this License and any such award in excess is void.
All awards will be payable in U.S. dollars and may include, for the
prevailing party (i) pre-judgment award interest, (ii) reasonable
attorneys' fees incurred in connection with the arbitration, and (iii)
reasonable costs and expenses incurred in enforcing the award. The
arbitrator will order each party to produce identified documents and
respond to no more than twenty-five single question interrogatories.

8.7 Construction.

Any law or regulation, which provides that the language of a contract
shall be construed against the drafter, shall not apply to this License.

8.8 U.S. Government End Users.

The Covered Code is a "commercial item," as that term is defined in 48
C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software"
and "commercial computer software documentation," as such terms are used
in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and
48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government
End Users acquire Covered Code with only those rights set forth herein.
You agree to pass this notice to our licensees.

8.9 Marketing Activities.

Licensee hereby grants Original Contributor a non-exclusive,
non-transferable, limited license to use the Licensee's company name and
logo ("Licensee Marks") in any presentations, press releases, or
marketing materials solely for the purpose of identifying Licensee as a
member of the Helix Community. Licensee shall provide samples of
Licensee Marks to Original Contributor upon request by Original
Contributor. Original Contributor acknowledges that the Licensee Marks
are the trademarks of Licensee. Original Contributor shall not use the
Licensee Marks in a way that may imply that Original Contributor is an
agency or branch of Licensee. Original Contributor understands and
agrees that the use of any Licensee Marks in connection with this
Agreement shall not create any right, title or interest, in, or to the
Licensee Marks or any Licensee trademarks and that all such use and
goodwill associated with any such trademarks will inure to the benefit
of Licensee. Further the Original Contributor will stop usage of the
Licensee Marks upon Licensee's request.

8.10 Press Announcements.

You may make press announcements or other public statements regarding
this License without the prior written consent of the Original
Contributor, if Your statement is limited to announcing the licensing of
the Covered Code or the availability of Your Product and its
compatibility with the Covered Code. All other public announcements
regarding this license require the prior written consent of the Original
Contributor. Consent requests are welcome at press@helixcommunity.org.

8.11 International Use.

a) Export/Import laws. Covered Code is subject to U.S. export control
laws and may be subject to export or import regulations in other
countries. Each party agrees to comply strictly with all such laws and
regulations and acknowledges their responsibility to obtain such
licenses to export, re-export, or import as may be required. You agree
to pass these obligations to Your licensees.

b) Intellectual Property Protection. Due to limited intellectual
property protection and enforcement in certain countries, You agree not
to redistribute the Original Code, Upgraded Code, TCK and Specifications
to any country on the list of restricted countries on the Community Web
Server.

8.12 Language.

This License is in the English language only, which language shall be
controlling in all respects, and all versions of this License in any
other language shall be for accommodation only and shall not be binding
on the parties to this License. All communications and notices made or
given pursuant to this License, and all documentation and support to be
provided, unless otherwise noted, shall be in the English language.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH REALNETWORKS, INC. IF YOU ARE AGREEING
TO THIS LICENSE ON BEHALF OF A COMPANY, YOU REPRESENT THAT YOU ARE
AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE. WHETHER YOU ARE ACTING
ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY, YOU MUST BE OF MAJORITY
AGE AND BE OTHERWISE COMPETENT TO ENTER INTO CONTRACTS. IF YOU DO NOT
MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY OF THE TERMS AND
CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON TO EXIT.


    GLOSSARY

1. *"Added Value"* means code which:

(i) has a principal purpose which is substantially different from that
of the stand-alone Technology;

(ii) represents a significant functional and value enhancement to the
Technology;

(iii) operates in conjunction with the Technology; and

(iv) is not marketed as a technology which replaces or substitutes for
the Technology

2. "*Applicable Patent Rights*" mean: (a) in the case where Original
Contributor is the grantor of rights, claims of patents that (i) are now
or hereafter acquired, owned by or assigned to Original Contributor and
(ii) are necessarily infringed by using or making the Original Code or
Upgraded Code, including Modifications provided by Original Contributor,
alone and not in combination with other software or hardware; and (b) in
the case where Licensee is the grantor of rights, claims of patents that
(i) are now or hereafter acquired, owned by or assigned to Licensee and
(ii) are infringed (directly or indirectly) by using or making
Licensee's Modifications or Error Corrections, taken alone or in
combination with Covered Code.

3. "*Application Programming Interfaces (APIs)"* means the interfaces,
associated header files, service provider interfaces, and protocols that
enable a device, application, Operating System, or other program to
obtain services from or make requests of (or provide services in
response to requests from) other programs, and to use, benefit from, or
rely on the resources, facilities, and capabilities of the relevant
programs using the APIs. APIs includes the technical documentation
describing the APIs, the Source Code constituting the API, and any
Header Files used with the APIs.

4. "*Commercial Use*" means any use (internal or external), copying,
sublicensing or distribution (internal or external), directly or
indirectly of Covered Code by You other than Your Research Use of
Covered Code within Your business or organization or in conjunction with
other Licensees with equivalent Research Use rights. Commercial Use
includes any use of the Covered Code for direct or indirect commercial
or strategic gain, advantage or other business purpose. Any Commercial
Use requires execution of Attachment D by You and Original Contributor.

5. "*Community Code*" means the Original Code, Upgraded Code, Error
Corrections, Shared Modifications, or any combination thereof.

6. "*Community Webserver(s)"* means the webservers designated by
Original Contributor for access to the Original Code, Upgraded Code, TCK
and Specifications and for posting Error Corrections and Shared
Modifications.

7. "*Compliant Covered Code*" means Covered Code that complies with the
requirements of the TCK.

8. "*Contributor*" means each Licensee that creates or contributes to
the creation of any Error Correction or Shared Modification.

9. "*Covered Code*" means the Original Code, Upgraded Code,
Modifications, or any combination thereof.

10. "*Error Correction*" means any change made to Community Code which
conforms to the Specification and corrects the adverse effect of a
failure of Community Code to perform any function set forth in or
required by the Specifications.

11. "*Executable*" means Covered Code that has been converted from
Source Code to the preferred form for execution by a computer or digital
processor (e.g. binary form).

12. "*Extension(s)"* means any additional Interfaces developed by or for
You which: (i) are designed for use with the Technology; (ii) constitute
an API for a library of computing functions or services; and (iii) are
disclosed or otherwise made available to third party software developers
for the purpose of developing software which invokes such additional
Interfaces. The foregoing shall not apply to software developed by Your
subcontractors to be exclusively used by You.

13. "*Header File(s)"* means that portion of the Source Code that
provides the names and types of member functions, data members, class
definitions, and interface definitions necessary to implement the APIs
for the Covered Code. Header Files include, files specifically
designated by Original Contributor as Header Files. Header Files do not
include the code necessary to implement the functionality underlying the
Interface.

14. *"Helix DNA Server Technology"* means the program(s) that implement
the Helix Universal Server streaming engine for the Technology as
defined in the Specification.

15. *"Helix DNA Client Technology"* means the Covered Code that
implements the RealOne Player engine as defined in the Specification.

16. *"Helix DNA Producer Technology"* means the Covered Code that
implements the Helix Producer engine as defined in the Specification.

17. *"Helix DNA Technology"* means the Helix DNA Server Technology, the
Helix DNA Client Technology, the Helix DNA Producer Technology and other
Helix technologies designated by Original Contributor.

18. "*Intellectual Property Rights*" means worldwide statutory and
common law rights associated solely with (i) Applicable Patent Rights;
(ii) works of authorship including copyrights, copyright applications,
copyright registrations and "moral rights"; (iii) the protection of
trade and industrial secrets and confidential information; and (iv)
divisions, continuations, renewals, and re-issuances of the foregoing
now existing or acquired in the future.

19. *"Interface*" means interfaces, functions, properties, class
definitions, APIs, Header Files, GUIDs, V-Tables, and/or protocols
allowing one piece of software, firmware or hardware to communicate or
interoperate with another piece of software, firmware or hardware.

20. "*Internal Deployment Use*" means use of Compliant Covered Code
(excluding Research Use) within Your business or organization only by
Your employees and/or agents on behalf of Your business or organization,
but not to provide services, including content distribution, to third
parties, subject to execution of Attachment D by You and Original
Contributor, if required.

21. "*Licensee*" means any party that has entered into and has in effect
a version of this License with Original Contributor.

22. "*MIME type*" means a description of what type of media or other
content is in a file, including by way of example but not limited to
'audio/x-pn-realaudio-plugin.'

23. "*Modification(s)"* means (i) any addition to, deletion from and/or
change to the substance and/or structure of the Covered Code, including
Interfaces; (ii) the combination of any Covered Code and any previous
Modifications; (iii) any new file or other representation of computer
program statements that contains any portion of Covered Code; and/or
(iv) any new Source Code implementing any portion of the Specifications.

24. "*MP3 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Picture Experts Group known as MPEG-1 Audio Layer-3 or MP3,
including but not limited to all past and future versions, profiles,
extensions, parts and amendments relating to the MP3 specification.

25. "*MPEG-4 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Pictures Experts Group known as MPEG-4, including but not
limited to all past and future versions, profiles, extensions, parts and
amendments relating to the MPEG-4 specification.

26. "*Original Code*" means the initial Source Code for the Technology
as described on the Community Web Server.

27. "*Original Contributor*" means RealNetworks, Inc., its affiliates
and its successors and assigns.

28. "*Original Contributor MIME Type*" means the MIME registry, browser
preferences, or local file/protocol associations invoking any Helix DNA
Client-based application, including the RealOne Player, for playback of
RealAudio, RealVideo, other RealMedia MIME types or datatypes (e.g.,
.ram, .rnx, .rpm, .ra, .rm, .rp, .rt, .rf, .prx, .mpe, .rmp, .rmj, .rav,
.rjs, .rmx, .rjt, .rms), and any other Original Contributor-specific or
proprietary MIME types that Original Contributor may introduce in the
future.

29. "*Personal Use*" means use of Covered Code by an individual solely
for his or her personal, private and non-commercial purposes. An
individual's use of Covered Code in his or her capacity as an officer,
employee, member, independent contractor or agent of a corporation,
business or organization (commercial or non-commercial) does not qualify
as Personal Use.

30. "*RealMedia File Format*" means the file format designed and
developed by RealNetworks for storing multimedia data and used to store
RealAudio and RealVideo encoded streams. Valid RealMedia File Format
extensions include: .rm, .rmj, .rmc, .rmvb, .rms.

31. "*RCSL Webpage*" means the RealNetworks Community Source License
webpage located at https://www.helixcommunity.org/content/rcsl or such
other URL that Original Contributor may designate from time to time.

32. "*Reformatted Specifications*" means any revision to the
Specifications which translates or reformats the Specifications (as for
example in connection with Your documentation) but which does not alter,
subset or superset * *the functional or operational aspects of the
Specifications.

33. "*Research Use*" means use and distribution of Covered Code only for
Your Personal Use, research or development use and expressly excludes
Internal Deployment Use and Commercial Use. Research Use also includes
use of Covered Code to teach individuals how to use Covered Code.

34. "*Shared Modifications*" means Modifications that You distribute or
use for a Commercial Use, in addition to any Modifications provided by
You, at Your option, pursuant to Section 2.2, or received by You from a
Contributor pursuant to Section 2.3.

35. "*Source Code*" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus any
associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.

36. "*Specifications*" means the specifications for the Technology and
other documentation, as designated on the Community Web Server, as may
be revised by Original Contributor from time to time.

37. "*Trademarks*" means Original Contributor's trademarks and logos,
including, but not limited to, RealNetworks, RealAudio, RealVideo,
RealOne, RealSystem, SureStream, Helix, Helix DNA and other trademarks
whether now used or adopted in the future.

38. "*Technology*" means the technology described in Attachment B, and
Upgrades.

39. "*Technology Compatibility Kit"* or *"TCK*" means the test programs,
procedures, acceptance criteria and/or other requirements, designated by
Original Contributor for use in verifying compliance of Covered Code
with the Specifications, in conjunction with the Original Code and
Upgraded Code. Original Contributor may, in its sole discretion and from
time to time, revise a TCK to correct errors and/or omissions and in
connection with Upgrades.

40. "*Upgrade(s)"* means new versions of Technology designated
exclusively by Original Contributor as an "Upgrade" and released by
Original Contributor from time to time under the terms of the License.

41. "*Upgraded Code*" means the Source Code and/or Executables for
Upgrades, possibly including Modifications made by Contributors.

42. *"User's Guide"* means the users guide for the TCK which Original
Contributor makes available to You to provide direction in how to run
the TCK and properly interpret the results, as may be revised by
Original Contributor from time to time.

43. "*You(r)*" means an individual, or a legal entity acting by and
through an individual or individuals, exercising rights either under
this License or under a future version of this License issued pursuant
to Section 4.1. For legal entities, "You(r)" includes any entity that by
majority voting interest controls, is controlled by, or is under common
control with You.

44. "*Your Products*" means any (i) hardware products You distribute
integrating the Covered Code; (ii) any software products You distribute
with the Covered Code that utilize the APIs of the Covered Code; or
(iii) any services You provide using the Covered Code.


  ATTACHMENT A

REQUIRED NOTICES


    ATTACHMENT A-1

REQUIRED IN ALL CASES

Notice to be included in header file of all Error Corrections and Shared
Modifications:

Portions Copyright 1994-2003 © RealNetworks, Inc. All rights reserved.

The contents of this file, and the files included with this file, are
subject to the current version of RealNetworks Community Source License
Version 1.1 (the "License"). You may not use this file except in
compliance with the License executed by both You and RealNetworks. You
may obtain a copy of the License at *
https://www.helixcommunity.org/content/rcsl.* You may also obtain a copy
of the License by contacting RealNetworks directly. Please see the
License for the rights, obligations and limitations governing use of the
contents of the file.

This file is part of the Helix DNA technology. RealNetworks, Inc., is
the developer of the Original code and owns the copyrights in the
portions it created.

This file, and the files included with this file, are distributed on an
'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.

Contributor(s):

_______________________________________________

Technology Compatibility Kit Test Suite(s) Location:

________________________________


    ATTACHMENT A-2

SAMPLE LICENSEE CERTIFICATION

"By clicking the `Agree' button below, You certify that You are a
Licensee in good standing under the RealNetworks Community Source
License, ("License") and that Your access, use and distribution of code
and information You may obtain at this site is subject to the License.
If You are not a Licensee under the RealNetworks Community Source
License You agree not to download, copy or use the Helix DNA technology.


    ATTACHMENT A-3

REQUIRED STUDENT NOTIFICATION

"This software and related documentation has been obtained by Your
educational institution subject to the RealNetworks Community Source
License. You have been provided access to the software and related
documentation for use only in connection with your course work and
research activities as a matriculated student of Your educational
institution. Any other use is expressly prohibited.

THIS SOFTWARE AND RELATED DOCUMENTATION CONTAINS PROPRIETARY MATERIAL OF
REALNETWORKS, INC, WHICH ARE PROTECTED BY VARIOUS INTELLECTUAL PROPERTY
RIGHTS.

You may not use this file except in compliance with the License. You may
obtain a copy of the License on the web at
https://www.helixcommunity.org/content/rcsl.

*
*


  ATTACHMENT B

Description of Technology

Helix DNA, which consists of Helix DNA Client, Helix DNA Server and
Helix DNA Producer.

Description of "Technology"

Helix DNA Technology v1.0 as described on the Community Web Server.


  ATTACHMENT C

TECHNOLOGY COMPATIBILITY KIT LICENSE

The following license is effective for the *Helix DNA* Technology
Compatibility Kit - as described on the Community Web Server. The
Technology Compatibility Kit(s) for the Technology specified in
Attachment B may be accessed at the Community Web Server.

1. TCK License.

1.1 Grants to use TCK

Subject to the terms and restrictions set forth below and the
RealNetworks Community Source License, and the Research Use license,
Original Contributor grants to You a worldwide, non-exclusive,
non-transferable license, to the extent of Original Contributor's
Intellectual Property Rights in the TCK (without the right to
sublicense), to use the TCK to develop and test Covered Code.

1.2 TCK Use Restrictions.

You are not authorized to create derivative works of the TCK or use the
TCK to test any implementation of the Specification that is not Covered
Code. You may not publish Your test results or make claims of
comparative compatibility with respect to other implementations of the
Specification. In consideration for the license grant in Section 1.1
above You agree not to develop Your own tests that are intended to
validate conformation with the Specification.

2. Test Results.

You agree to provide to Original Contributor or the third party test
facility if applicable, Your test results that demonstrate that Covered
Code is Compliant Covered Code and that Original Contributor may publish
or otherwise distribute such test results.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH THE ORIGINAL CONTRIBUTOR, REALNETWORKS,
INC. IF YOU ARE AGREEING TO THIS LICENSE ON BEHALF OF A COMPANY, YOU
REPRESENT THAT YOU ARE AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE.
WHETHER YOU ARE ACTING ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY,
YOU MUST BE OF MAJORITY AGE AND BE OTHERWISE COMPETENT TO ENTER INTO
CONTRACTS. IF YOU DO NOT MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY
OF THE TERMS AND CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON
TO EXIT.

*ACCEPT / REJECT
*

*
*

*To agree to the R&D/academic terms of this license, please register
 on the site --
you will then be given a chance to agree to the clickwrap RCSL

R&D License

and gain access to the RCSL-licensed source code.  To build or deploy
commercial applications based on the RCSL, you will need to agree to the
Commercial Use license attachments
*





From rishimathew at helixcommunity.org  Wed Jun  8 11:01:10 2005
From: rishimathew at helixcommunity.org (rishimathew@helixcommunity.org)
Date: Wed Jun  8 13:57:52 2005
Subject: [Server-cvs] fs/asncfs LICENSE.txt, NONE, 1.1 RCSL.txt, NONE,
	1.1 RPSL.txt, NONE, 1.1 Umakefil, NONE, 1.1 asncbuf.cpp, NONE,
	1.1 asncbuf.h, NONE, 1.1 asncfobj.cpp, NONE, 1.1 asncfobj.h,
	NONE, 1.1 asncfsys.cpp, NONE, 1.1 asncfsys.h, NONE,
	1.1 asncfsys.ver, NONE, 1.1 asncwrkr.cpp, NONE, 1.1 asncwrkr.h,
	NONE, 1.1 linux-2.2-libc6-i386.pcf, NONE, 1.1 qcheck.cpp, NONE,
	1.1 qcheck.h, NONE, 1.1 unix.pcf, NONE, 1.1 win.pcf, NONE,
	1.1 win32.pcf, NONE, 1.1 wrkrrqst.h, NONE, 1.1
Message-ID: 

Update of /cvsroot/server/fs/asncfs
In directory cvs:/tmp/cvs-serv1322

Added Files:
	LICENSE.txt RCSL.txt RPSL.txt Umakefil asncbuf.cpp asncbuf.h 
	asncfobj.cpp asncfobj.h asncfsys.cpp asncfsys.h asncfsys.ver 
	asncwrkr.cpp asncwrkr.h linux-2.2-libc6-i386.pcf qcheck.cpp 
	qcheck.h unix.pcf win.pcf win32.pcf wrkrrqst.h 
Log Message:
Moving Asynchronous file system from server_rn/fs/asncfs to server/fs/asncfs


--- NEW FILE: linux-2.2-libc6-i386.pcf ---
# ***** BEGIN LICENSE BLOCK *****  
# Source last modified: $Id: linux-2.2-libc6-i386.pcf,v 1.1 2005/06/08 18:01:06 rishimathew Exp $ 
#   
# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
#       
# The contents of this file, and the files included with this file, 
# are subject to the current version of the RealNetworks Public 
# Source License (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the current version of the RealNetworks Community 
# Source License (the "RCSL") available at 
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL 
# will apply. You may also obtain the license terms directly from 
# RealNetworks.  You may not use this file except in compliance with 
# the RPSL or, if you have a valid RCSL with RealNetworks applicable 
# to this file, the RCSL.  Please see the applicable RPSL or RCSL for 
# the rights, obligations and limitations governing use of the 
# contents of the file. 
#   
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the 
# portions it created. 
#   
# This file, and the files included with this file, is distributed 
# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY 
# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS 
# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES 
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET 
# ENJOYMENT OR NON-INFRINGEMENT. 
#  
# Technology Compatibility Kit Test Suite(s) Location:  
#    http://www.helixcommunity.org/content/tck  
#  
# Contributor(s):  
#   
# ***** END LICENSE BLOCK ***** 
project.AddDefines("_XOPEN_SOURCE=500")



--- NEW FILE: asncwrkr.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: asncwrkr.cpp,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#include "hxcom.h"
#include "hxtypes.h"
#include "platform_config.h"

//#include 

#include "hxengin.h"
#include "hxerror.h"
#include "servlist.h"
#include "hxfiles.h"
#include "hxdataf.h"
#include "hxplugn.h"
#include "hxcomm.h"
#include "hxspriv.h"
#include "intrpm.h"
#include "debug.h"
#include 
#include 
#include 

#include "asncfsys.h"
#include "asncfobj.h"
#include "asncwrkr.h"
#include "wrkrrqst.h"
#include "ihxpckts.h"
#include "microsleep.h"
#include "hxtime.h"

#ifdef _UNIX
#include 
#include 
#endif /* _UNIX */

#ifdef _WIN32
#  include  // for _getpid
#  define getpid _getpid
#endif // _WIN32

#include 

extern IMalloc* pAsncFSysIMalloc;

#ifdef _UNIX
static sigjmp_buf g_env;
#endif /* _UNIX */

#ifdef _WIN32
#    include 
#endif /* _WIN32 */


/////////////////////////////////////////////////////
// classes only used in this file
/////////////////////////////////////////////////////
class AsyncFSysWorkerEntryPoint : public IHXProcessEntryPoint
{
public:
    AsyncFSysWorkerEntryPoint(AsyncFileSystem* pFileSystem,
                              AsyncFSysWorker* pWorker);
    virtual ~AsyncFSysWorkerEntryPoint();
    
    STDMETHOD(QueryInterface)	(THIS_
				REFIID riid,
                                void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)	(THIS);
    STDMETHOD_(ULONG32,Release)	(THIS);

    /*
     *  IHXProcessEntryPoint methods
     */
    STDMETHOD(Func)		(THIS_ IUnknown* pContext);

private:
    int              m_readFD;
    INT32            m_lRefCount;
    AsyncFileSystem* m_pFileSystem;
    AsyncFSysWorker* m_pWorker;
    AsyncFileObject* m_pCurrentFObj;
};

//////////////////////////////////////////////////////
// external classes
//////////////////////////////////////////////////////

/*
 * AsyncFSysWorker::AsyncFSysWorker
 *
 * Description: constructor
 * Parameters:
 *      [in] IUnknown* pContext
 *      [in] const char* pProcessName
 */
AsyncFSysWorker::AsyncFSysWorker(IUnknown* pContext,
                                 AsyncFileSystem* pFileSystem,
                                 const char* pProcessName,
                                 BOOL bEnableIOTiming) 
{
    m_pProcess = NULL;
    m_pContext = pContext;
    m_pContext->AddRef();
    m_pFileSystem = pFileSystem;
    m_pFileSystem->AddRef();
    m_pProcessName = pProcessName;
    m_pClassFactory = NULL;
    m_ulIterations = 0;
    m_lPid = -1;
    m_bEnableIOTiming = bEnableIOTiming;

#ifdef _WIN32
    m_hCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, 0);
    
#else
    m_pRequestQMutex = NULL;
    m_pRequestQ = new HXList();

#  ifdef PTHREADS_SUPPORTED
    if (pipe(m_pQPipe) < 0)
        perror("asncwrkr failed to create queue pipe");
#  endif // PTHREADS_SUPPORTED

#endif /*_WIN32 */
}

/*
 * AsyncFsysWorker::~AsyncFSysWorker
 *
 * Description: destructor
 */
AsyncFSysWorker::~AsyncFSysWorker() 
{
    HX_RELEASE(m_pContext);
    HX_RELEASE(m_pProcess);
    HX_RELEASE(m_pFileSystem);
    HX_RELEASE(m_pClassFactory);

#ifndef _WIN32
    HX_RELEASE(m_pRequestQMutex);
    delete m_pRequestQ;
#endif /* _WIN32 */
}

/*
 * AsyncFSysWorker::GetQueueSize
 *
 * Description: returns number of elements in the request queue
 *              Note that this function is basically a no-op on windows
 *              but for current use that's ok since we'll never need to
 *              dynamically adjust the number of workers on that platform.
 */
UINT32
AsyncFSysWorker::GetQueueSize()
{
#ifndef _WIN32
    if (m_pRequestQ)
        return m_pRequestQ->size;
#endif // !_WIN32

    return 0;
}

/*
 * AsyncFsysWorker::Start
 *
 * Description: Starts a worker
 *
 * Returns: HXR_OK on success, errors otherwise
 *
 * Implementation: do QIs and start the process
 */
STDMETHODIMP
AsyncFSysWorker::Start() 
{
    if (m_pContext->QueryInterface(
            IID_IHXErrorMessages, (void**) &m_pErrorMessages) != HXR_OK)
    {
        return HXR_UNEXPECTED;
    }

    if (m_pContext->QueryInterface(
            IID_IHXCommonClassFactory, (void**)&m_pClassFactory) != HXR_OK)
    {
        m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK,
                                 "could not get IHXCommonClassFactory", NULL);
        return HXR_FAIL;
    }

#ifndef _WIN32
    if (m_pClassFactory->CreateInstance(
            CLSID_IHXMutex, (void**)&m_pRequestQMutex) != HXR_OK)
    {
        m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK,
                                 "could not get IHXMutex", NULL);
        return HXR_UNEXPECTED;
    }
#endif // _WIN32

    if (m_pContext->QueryInterface(IID_IHXProcess, (void**)&m_pProcess)
        != HXR_OK)
    {
        m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK, 
                                 "could not get IHXProcess", NULL);
        return HXR_UNEXPECTED;
    }
    
    IHXProcessEntryPoint* pEntryPoint = new AsyncFSysWorkerEntryPoint(
        m_pFileSystem, this);
    m_pProcess->Start(m_pProcessName, pEntryPoint);

    return HXR_OK;
}

/*
 * AsyncFSysWorker::GetRequest
 *
 * Description: gets a request off the worker queue
 * Parameters:
 *
 * Returns: WorkerRequest* if there's a queue, NULL if the queue's been
 * DESTROYED!
 *
 * Implementation: On unix lock the mutex, dequeue, unlock mutex, if nothing
 * was there then yield.
 *
 * On windows we check the IOCompletion Queue
 * for new worker requests and actual i/o completions.  If we
 * get a worker request we dispatch it, if we get a completion we call
 * the callback.
 *
 */
WorkerRequest*
AsyncFSysWorker::GetRequest() 
{
#ifdef _WIN32

    while (1)
    {
        LPOVERLAPPED pData;
        DWORD dwNumBytes;
        DWORD dwKey;
        if (GetQueuedCompletionStatus(m_hCompletionPort, &dwNumBytes, &dwKey,
                                      &pData, INFINITE))
        {
            if (!dwKey)
            {
                // this was a worker request not an io completion
                return (WorkerRequest*)pData;
            }
            else
            {
                // the key is really a pointer to an AsyncFileObject
                // so we grab it and run the callback that needs to be run
                //
                AsyncFileObject* pFObj = (AsyncFileObject*)dwKey;
                pFObj->m_pThisMutex->Lock();
                if (!pFObj->m_bReadCancelled)
                    pFObj->m_ulPos += dwNumBytes;

                MessengerCallback* pCallback = pFObj->m_pMsgrReadCB;
		if (!pFObj->m_bClosed)
		{
                    pCallback->Run(HXR_OK, m_pMessenger,
                                   pFObj->m_ulReadBufferOffset + dwNumBytes);
                    pFObj->m_pThisMutex->Unlock();
		}
		else
		{
		    pFObj->m_pThisMutex->Unlock();
		    pCallback->Delete(m_pMessenger);
		}
            }
        }
    }

#else

    if (!m_pRequestQ || !m_pRequestQMutex)
    {
        return NULL;
    }

    while (1)
    {
        m_pRequestQMutex->Lock();

        WorkerRequest* pRequest = (WorkerRequest*)m_pRequestQ->remove_head();
        if (pRequest != NULL)
        {
            m_pRequestQMutex->Unlock();
            return pRequest;
        }
        m_pRequestQMutex->Unlock();

#ifdef _AIX
        microsleep(10000);
#elif defined PTHREADS_SUPPORTED
        char dummy;
        read(m_pQPipe[0], &dummy, 1);
#else
        //XXXDC this may be too aggressive:
        microsleep(1000);
#endif
    }

#endif /* _WIN32 */
}

/*
 * AsyncFSysWorker::AddRequest
 *
 * Description: Adds a request to the worker request queue
 * Parameters:
 *      [in]  WorkerRequest*
 *
 * Implementation: lock mutex, enqueue, unlock mutex
 */
STDMETHODIMP
AsyncFSysWorker::AddRequest(WorkerRequest* pRequest) 
{
#ifdef _WIN32
    if (!PostQueuedCompletionStatus(
        m_hCompletionPort, 0, 0, (LPOVERLAPPED)pRequest))
    {
        m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK,
                                 "failed to PostIOCompletionStatus", NULL);
        return HXR_FAIL;
    }

#else

    m_pRequestQMutex->Lock();
    m_pRequestQ->insert(pRequest);

#  ifdef PTHREADS_SUPPORTED
    // need to signal the consumer that something is available
    if (m_pRequestQ->size == 1)
    {
        char dummy = '0';
        write(m_pQPipe[1], &dummy, 1);
    }
#  endif // PTHREADS_SUPPORTED

    m_pRequestQMutex->Unlock();

#endif /* _WIN32 */

    return HXR_OK;
}

/*
 * AsyncFSysWorkerEntryPoint::AsyncFSysWorkerEntryPoint
 *
 * Description: constructor
 * Parameters:
 *      [in] int pipeToWorker[2] : pipe that the worker reads from
 *
 */
AsyncFSysWorkerEntryPoint::AsyncFSysWorkerEntryPoint(AsyncFileSystem* pFSys,
                                                     AsyncFSysWorker* pWorker)
{
    m_pFileSystem = pFSys;
    m_pFileSystem->AddRef();
    m_pWorker = pWorker;
    m_pCurrentFObj = NULL;
}

AsyncFSysWorkerEntryPoint::~AsyncFSysWorkerEntryPoint()
{
    HX_RELEASE(m_pFileSystem);
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::QueryInterface
//  Purpose:
//	Implement this to export the interfaces supported by your 
//	object.
//
STDMETHODIMP
AsyncFSysWorkerEntryPoint::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
	AddRef();
	*ppvObj = this;
	return HXR_OK;
    }

    if (IsEqualIID(riid, IID_IHXProcessEntryPoint))
    {
	AddRef();
	*ppvObj = this;
	return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::AddRef
//  Purpose:
//	Everyone usually implements this the same... feel free to use
//	this implementation.
//
STDMETHODIMP_(ULONG32)
AsyncFSysWorkerEntryPoint::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::Release
//  Purpose:
//	Everyone usually implements this the same... feel free to use
//	this implementation.
//
STDMETHODIMP_(ULONG32)
AsyncFSysWorkerEntryPoint::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}

/*
 * AsyncFsysWorker::SetMessenger
 *
 * Description:
 * Parameters:
 *      [in]
 *      [out]
 *      [in/out]
 *
 * Returns:
 *
 * Implementation:
 */
STDMETHODIMP
AsyncFSysWorker::SetMessenger(IHXInterPluginMessenger2* pMessenger) 
{
    m_pMessenger = pMessenger;
    return HXR_OK;
}


/*
 * AsyncFSysWorker::Func
 *
 * Description: Entry point for process
 *
 * Returns: HXR_OK
 *
 * Implementation: Loop around waiting for requests for FD io and execute it
 * calling the passed callback when complete.
 */
STDMETHODIMP
AsyncFSysWorkerEntryPoint::Func(IUnknown* pContext) 
{
    IHXErrorMessages*       pErrorMessages;
    IHXInterPluginMessenger2* pMessenger;

    pContext->AddRef();

    FILE* pTimingFile = 0;

    if (m_pWorker->m_bEnableIOTiming)
    {
        char filename[64];
        sprintf(filename, "timing-%u.txt", getpid());
        pTimingFile = fopen(filename, "w");
    }

    // if we are recovering from a CA and we were holding a
    // file object's mutex, release it now.
    if (m_pCurrentFObj && m_pCurrentFObj->m_pThisMutex)
    {
        m_pCurrentFObj->m_pThisMutex->Unlock();
    }

    //
    // on platforms where we fork static data needs reinitialization
    //
    if (pAsncFSysIMalloc == 0)
    {
        pContext->QueryInterface(IID_IMalloc, (void**)&pAsncFSysIMalloc);
    }

    if (pContext->QueryInterface(IID_IHXErrorMessages,
        (void**)&pErrorMessages) != HXR_OK)
    {
        printf("E: failed to get IHXErrorMessages\n");
        printf("worker exiting\n");
        fflush(stdout);
        return HXR_OK;
    }

    if (pContext->QueryInterface(IID_IHXInterPluginMessenger2,
        (void**)&pMessenger) != HXR_OK)
    {
        pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK,
                               "failed to get InterPluginMessenger2", NULL);
        printf("worker exiting\n");
        fflush(stdout);
        return HXR_OK;
    }

    m_pWorker->SetMessenger(pMessenger);

    while (1)
    {
        m_pWorker->m_ulIterations++;
        WorkerRequest* pRequest = m_pWorker->GetRequest();
        if (pRequest == NULL)
        {
            break;
        }

        // we record the fileobject we're processing so we
        // can unlock it's mutex on a CA if necessary
        m_pCurrentFObj = pRequest->GetFileObject();

        pRequest->Execute(pMessenger, pTimingFile);
    }

    printf("worker exiting\n");
    fflush(stdout);
    return HXR_OK;
}

WorkerRequest::WorkerRequest(AsyncFileObject* pFObj, MessengerCallback* pCallback)
{
    m_pFObj = pFObj;
    if (m_pFObj) pFObj->AddRef();
    m_pCallback = pCallback;
    if (m_pCallback) m_pCallback->AddRef();
}

WorkerRequest::~WorkerRequest()
{
    HX_RELEASE(m_pFObj);
    HX_RELEASE(m_pCallback);
}

AsyncFileObject*
WorkerRequest::GetFileObject()
{
    return m_pFObj;
}

WorkerInitRequest::WorkerInitRequest(AsyncFileObject* pFObj,
                                     ULONG32 ulFlags,
                                     MessengerCallback* pCallback)
    : WorkerRequest(pFObj, pCallback)
{
    m_ulFlags = ulFlags;
}

WorkerInitRequest::~WorkerInitRequest()
{
}

STDMETHODIMP
WorkerInitRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
    return m_pFObj->_Init(m_ulFlags, m_pCallback, pMessenger, this);
}

WorkerCloseRequest::WorkerCloseRequest(FD_TYPE nFd, IHXBuffer* pName)
    : WorkerRequest(NULL, NULL)
{
    m_nFd = nFd;
    m_pName = pName;
    if (pName)
        pName->AddRef();
}

WorkerCloseRequest::~WorkerCloseRequest()
{
    HX_RELEASE(m_pName);
}

STDMETHODIMP
WorkerCloseRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
#ifdef _WIN32
    CloseHandle(m_nFd);
#else
    HXTime start, end;
    if (pTimingFile && gettimeofday(&start, 0) < 0)
        perror("gettimeofday start failed");

    close(m_nFd);

    if (pTimingFile && gettimeofday(&end, 0) < 0)
        perror("gettimeofday end failed");

    if (pTimingFile)
    {
        fprintf(pTimingFile, "C %lf %s %d %u %u %u %lf\n",
                (double)start.tv_sec * 1000 + (double)start.tv_usec / 1000,
                (char*)m_pName->GetBuffer(), m_nFd, 0, 0, 0,
                ((double)end.tv_sec - (double)start.tv_sec +
                ((double)end.tv_usec - (double)start.tv_usec) / 1000000) * 1000);
        fflush(pTimingFile);
    }
#endif // _WIN32

    // this is the only request that should delete itself
    delete this;
    return HXR_OK;
}

WorkerReadRequest::WorkerReadRequest(AsyncFileObject* pFObj,
                                     MessengerCallback* pCallback,
                                     ULONG32 ulCount,
                                     ULONG32 ulOffset)
    : WorkerRequest(pFObj, pCallback)
{
    m_ulCount = ulCount;
    m_ulOffset = ulOffset;
}

STDMETHODIMP
WorkerReadRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
    return m_pFObj->_Read(
        m_ulCount, pMessenger, m_pCallback, m_ulOffset, pTimingFile);
}

WorkerWriteRequest::WorkerWriteRequest(AsyncFileObject* pFObj,
                                       IHXBuffer* pBuffer)
    : WorkerRequest(pFObj, NULL)
{
    m_pBuffer = pBuffer;
    m_pBuffer->AddRef();
}

WorkerReadRequest::~WorkerReadRequest()
{
}

WorkerWriteRequest::~WorkerWriteRequest()
{
    HX_RELEASE(m_pBuffer);
}

STDMETHODIMP
WorkerWriteRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
    return m_pFObj->_Write(m_pBuffer, pMessenger, this);
}

WorkerSeekRequest::WorkerSeekRequest(AsyncFileObject* pFObj,
                                     ULONG32 ulOffset,
                                     BOOL bRelative)
    : WorkerRequest(pFObj, NULL)
{
    m_ulOffset = ulOffset;
    m_bRelative = bRelative;
}

STDMETHODIMP
WorkerSeekRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
    return m_pFObj->_Seek(m_ulOffset, m_bRelative, pMessenger);
}

STDMETHODIMP
WorkerMakeDirRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
    return m_pFObj->_MakeDir(pMessenger, m_pCallback);
}

STDMETHODIMP
WorkerReadDirRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
    return m_pFObj->_ReadDir(pMessenger, m_pCallback);
}

STDMETHODIMP
WorkerCloseDirRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
    return m_pFObj->_CloseDir(pMessenger, m_pCallback);
}

WorkerStatRequest::WorkerStatRequest(AsyncFileObject* pFObj,
                                     MessengerCallback* pCallback)
    : WorkerRequest(pFObj, pCallback)
{
}

WorkerStatRequest::~WorkerStatRequest()
{
}

STDMETHODIMP
WorkerStatRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
    return m_pFObj->_Stat(m_pCallback, pMessenger, pTimingFile);
}

WorkerDoesExistRequest::WorkerDoesExistRequest(AsyncFileObject* pFObj,
                                               IHXBuffer* pPath,
                                               MessengerCallback* pCallback)
    : WorkerRequest(pFObj, pCallback)
{
    m_pPath = pPath; // Don't Addref or Release here!!!
}

WorkerDoesExistRequest::~WorkerDoesExistRequest()
{
}

STDMETHODIMP
WorkerDoesExistRequest::Execute(IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile)
{
    return m_pFObj->_DoesExist(m_pPath, m_pCallback, pMessenger, pTimingFile);
}

--- NEW FILE: asncfobj.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: asncfobj.h,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef _ASNCFOBJ_H_
#define _ASNCFOBJ_H_

#include 

#include "hxengin.h"  // defines IHXCallback

class AsyncFileSystem;
class CFindFile;
_INTERFACE IHXDataFile;
_INTERFACE IHXFastAlloc;
class AsyncFileObject;
class WorkerRequest;

#define USE_FAST_NEW
#if defined USE_FAST_NEW
#    define fast_new(t, c) (new (m_pFMalloc->FastAlloc(sizeof(t))) c)
#    define fast_delete(p, t) {p->~t(); m_pFMalloc->FastFree(p);}
#else
#    define fast_new(t, c) (new (pAsncFSysIMalloc->Alloc(sizeof(t))) c)
#    define fast_delete(p, t) {p->~t(); pAsncFSysIMalloc->Free(p);}
#endif /* def USE_FAST_NEW */

#ifdef _WIN32
typedef HANDLE FD_TYPE;
#else
typedef int FD_TYPE;
#endif /* _WIN32 */

class StatData : public IUnknown
{
public:
    StatData(struct stat* pStatBuf);
    ~StatData();

    STDMETHOD(QueryInterface)	(THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)	(THIS);
    STDMETHOD_(ULONG32,Release)	(THIS);

    struct stat* m_pStatBuf;
    INT32 m_lRefCount;
};

class MessengerCallback : public IHXCallback
{
public:
    typedef enum
    {
        CT_INIT, CT_CLOSE, CT_READ, CT_WRITE, CT_SEEK, CT_EXISTS, CT_STAT,
        CT_POOL, CT_INIT_DIR, CT_CLOSE_DIR, CT_MAKE_DIR, CT_READ_DIR
    } CALLBACK_TYPE;

    MessengerCallback(IUnknown* pResponse,
                      AsyncFileObject* pFObj,
                      CALLBACK_TYPE callbackType,
                      IHXFastAlloc* pFMalloc,
                      IHXInterPluginMessenger2* pMessenger);

    STDMETHOD(Run) (THIS_
                    HX_RESULT result,
                    IHXInterPluginMessenger2* pMessenger,
                    ULONG32 ulBufLen = 0);

    STDMETHOD(Delete) (THIS_
                       IHXInterPluginMessenger2* pMessenger);

    ~MessengerCallback();

    STDMETHOD(QueryInterface)	(THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)	(THIS);
    STDMETHOD_(ULONG32,Release)	(THIS);
    STDMETHOD(Func)		(THIS);

private:

    friend class AsyncFSysWorker;
    friend class AsyncFileObject;

    INT32         m_lRefCount;
    IUnknown*     m_pResponse;
    HX_RESULT     m_result;
    CALLBACK_TYPE m_CallbackType;
    AsyncFileObject* m_pFObj;
    WorkerRequest* m_pRequest;
    IHXFastAlloc* m_pFMalloc;
    UINT32        m_ulBufLen;
    UINT32        m_ulOffset;
    void*         m_pIPMHandle;
    IHXInterPluginMessenger2* m_pMessenger;
};

class WorkerRequestDeleteCallback : public IHXCallback
{
public:
    WorkerRequestDeleteCallback(WorkerRequest* pRequest,
                                void* ptr,
                                IHXFastAlloc* pFMalloc);
    WorkerRequestDeleteCallback(WorkerRequest* pRequest,
                                void* ptr,
                                MessengerCallback* pCallback,
                                IHXFastAlloc* pFMalloc);
    WorkerRequestDeleteCallback(WorkerRequest* pRequest,
                                IHXFastAlloc* pFMalloc);
    
    ~WorkerRequestDeleteCallback();

    STDMETHOD(QueryInterface)	(THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)	(THIS);
    STDMETHOD_(ULONG32,Release)	(THIS);
    STDMETHOD(Func)		(THIS);

private:
    WorkerRequest* m_pRequest;
    IHXFastAlloc* m_pFMalloc;
    void*      m_ptr;
    MessengerCallback* m_pCallback;
    INT32 m_lRefCount;
};

class AsyncFileObject : public IHXFileObject, 
                        public IHXDirHandler,
                        public IHXFileObjectExt,
                        public IHXFileStat,
                        public IHXFileExists,
                        public IHXGetFileFromSamePool,
                        public IHXRequestHandler,
			public IHXThreadSafeMethods,
                        public IHXFilePlacementRead
{
public:
    AsyncFileObject(IHXBuffer* pBasePath,
                    IHXBuffer* pFullFileName,
                    AsyncFileSystem* pFS, 
                    IUnknown* pContext,
                    UINT32 ulMaxRecursionLevel,
                    AsyncFSysWorker* pWorker,
                    IHXFastAlloc*   pFMalloc,
                    IHXRequest*     pRequest,
                    BOOL             bAlignReads,
                    BOOL             bDisableMMapIO,
                    BOOL             bCheckVersionOnRead);
    ~AsyncFileObject();

    void             AddPluginRef();
    void             RemovePluginRef();
    AsyncFileSystem* GetFileSystem() { return m_pFileSystem; }

    /*
     *	IUnknown methods
     */
    STDMETHOD(QueryInterface)	(THIS_
    	    	    	    	REFIID riid,
    	    	    	    	void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)	(THIS);
    STDMETHOD_(ULONG32,Release)	(THIS);

    /*
     *	IHXFileObject methods
     */

    /************************************************************************
     *	Method:
     *	    IHXFileObject::Init
     *	Purpose:
     *	    Associates a file object with the file response object it should
     *	    notify of operation completness. This method should also check
     *	    for validity of the object (for example by opening it if it is
     *	    a local file).
     */
    STDMETHOD(Init)		(THIS_
				ULONG32		    /*IN*/	ulFlags,
				IHXFileResponse*   /*IN*/	pFileResponse);

    /************************************************************************
     *  Method:
     *      IHXFileObject::GetFilename
     *  Purpose:
     *      Returns the filename (without any path information) associated
     *      with a file object.
     */
    STDMETHOD(GetFilename)      (THIS_
				REF(const char*)    /*OUT*/  pFilename);

    /************************************************************************
     *	Method:
     *	    IHXFileObject::Close
     *	Purpose:
     *	    Closes the file resource and releases all resources associated
     *	    with the object.
     */
    STDMETHOD(Close)	    	(THIS);

    /************************************************************************
     *	Method:
     *	    IHXFileObject::Read
     *	Purpose:
     *	    Reads a buffer of data of the specified length from the file
     *	    and asynchronously returns it to the caller via the 
     *	    IHXFileResponse interface passed in to Init.
     */
    STDMETHOD(Read)		(THIS_
    	    	    	    	ULONG32	    	    ulCount);

    /************************************************************************
     *	Method:
     *	    IHXFileObject::Write
     *	Purpose:
     *	    Writes a buffer of data to the file and asynchronously notifies
     *	    the caller via the IHXFileResponse interface passed in to Init,
     *	    of the completeness of the operation.
     */
    STDMETHOD(Write)	    	(THIS_
    	    	    	    	IHXBuffer*	    pBuffer);

    /************************************************************************
     *	Method:
     *	    IHXFileObject::Seek
     *	Purpose:
     *	    Seeks to an offset in the file and asynchronously notifies
     *	    the caller via the IHXFileResponse interface passed in to Init,
     *	    of the completeness of the operation.
     */
    STDMETHOD(Seek)		(THIS_
    	    	    	    	 ULONG32	    ulOffset,
				 BOOL               bRelative);

    /************************************************************************
     *	Method:
     *	    IHXFileObject::Advise
     *	Purpose:
     *      To pass information to the File Object
     */
    STDMETHOD(Advise)	(THIS_
			ULONG32 ulInfo);

    /*
     * IHXFileStat methods
     */

    /************************************************************************
     *	Method:
     *	    IHXFileObject::Stat
     *	Purpose:
     *	    Collects information about the file that is returned to the
     *      caller in an IHXStat object
     */
    STDMETHOD(Stat)		(THIS_
				IHXFileStatResponse* pFileStatResponse);

    /*
     * IHXFileObjectExt methods
     */

    /************************************************************************
     *  Method:
     *      IHXFileObjectExt::GetFullFilename
     *  Purpose:
     *      Returns the filename, with path information, associated
     *      with a file object.
     */
    STDMETHOD(GetFullFilename)      (THIS_
                               REF(IHXBuffer*)  /*OUT*/  pFullFilename);

    /*
     * IHXGetFileFromSamePool methods
     */

    /************************************************************************
     *	Method:
     *	    IHXGetFileFromSamePool::GetFileObjectFromPool
     *	Purpose:
     *      To get another FileObject from the same pool. 
     */
    STDMETHOD(GetFileObjectFromPool)	(THIS_
					 IHXGetFileFromSamePoolResponse*);


    /*
     * IHXFileExists interface
     */

    /************************************************************************
     *	Method:
     *	    IHXFileExists::DoesExist
     *	Purpose:
     */
    STDMETHOD(DoesExist) (THIS_
			const char*		/*IN*/  pPath, 
			IHXFileExistsResponse* /*IN*/  pFileResponse);


    /*
     * IHXDirHandler interface
     */

    /************************************************************************
     *  Method:
     *      IHXDirHandler::InitDirHandler
     *  Purpose:
     *      Associates a directory handler with the directory handler
     *      response, it should notify of operation completeness.
     */
    STDMETHOD(InitDirHandler)   (THIS_
                IHXDirHandlerResponse*    /*IN*/  pDirResponse);

    /************************************************************************
     *  Method:
     *      IHXDirHandler::CloseDirHandler
     *  Purpose:
     *      Closes the directory handler resource and releases all resources
     *      associated with the object.
     */
    STDMETHOD(CloseDirHandler)  (THIS);

    /************************************************************************
     *  Method:
     *      IHXDirHandler::MakeDir
     *  Purpose:
     *      Create the directory
     */
    STDMETHOD(MakeDir)  (THIS);

    /************************************************************************
     *  Method:
     *      IHXDirHandler::ReadDir
     *  Purpose:
     *      Get a dump of the directory
     */
    STDMETHOD(ReadDir)  (THIS);


    /*
     * IHXRequestHandler methods
     */

    /************************************************************************
     *	Method:
     *	    IHXRequestHandler::SetRequest
     *	Purpose:
     *	    Associates an IHXRequest with an object
     */
    STDMETHOD(SetRequest)   	(THIS_
			    	IHXRequest*        /*IN*/  pRequest);

    /************************************************************************
     *	Method:
     *	    IHXRequestHandler::GetRequest
     *	Purpose:
     *	    Gets the IHXRequest object associated with an object
     */
    STDMETHOD(GetRequest)   	(THIS_
			    	REF(IHXRequest*)  /*OUT*/  pRequest);

    /************************************************************************
     *	Method:
     *	    IHXFilePlacementRead::Read
     *	Purpose:
     *	    Reads data into the passed buffer
     */
    STDMETHOD(Read)		(THIS_
                                ULONG32 ulAmount,
                                ULONG32 ulOffset,
                                char*   pBuffer,
                                BOOL    bOffsetBuffer);

    /************************************************************************
     *	Method:
     *	    IHXFilePlacementRead::AlignmentBoundary
     *	Purpose:
     *	    Returns necessary block alignment for reads
     */
    STDMETHOD_(ULONG32, AlignmentBoundary) (THIS);

    STDMETHOD(_OpenFile) (THIS_ ULONG32 ulFlags, FILE* pTimingFile);
    STDMETHOD(_Seek)     (THIS_
                          ULONG32 ulOffset,
                          BOOL bRelative,
                          IHXInterPluginMessenger2* pMessenger);
    STDMETHOD(_Write)    (THIS_
                          IHXBuffer* pBuffer,
                          IHXInterPluginMessenger2* pMessenger,
                          WorkerRequest* pRequest);
    STDMETHOD(_Read)     (THIS_
                          ULONG32 ulCount,
                          IHXInterPluginMessenger2* pMessenger,
                          MessengerCallback* pCallback,
                          ULONG32 ulOffset,
                          FILE* pTimingFile);
    STDMETHOD(_Init)     (THIS_
                          ULONG32 ulFlags,
                          MessengerCallback* pCallback,
                          IHXInterPluginMessenger2* pMessenger,
                          WorkerRequest *pRequest);
    STDMETHOD(_Stat)     (THIS_
                          MessengerCallback* pCallback,
                          IHXInterPluginMessenger2* pMessenger,
                          FILE* pTimingFile);
    STDMETHOD(_DoesExist)(THIS_
                          IHXBuffer* pPath,
                          MessengerCallback* pCallback,
                          IHXInterPluginMessenger2* pMessenger,
                          FILE* pTimingFile);
    STDMETHOD(_MakeDir)(THIS_
                          IHXInterPluginMessenger2* pMessenger,
                          MessengerCallback* pCallback);
    STDMETHOD(_ReadDir)(THIS_
                          IHXInterPluginMessenger2* pMessenger,
                          MessengerCallback* pCallback);
    STDMETHOD(_CloseDir)(THIS_
                          IHXInterPluginMessenger2* pMessenger,
                          MessengerCallback* pCallback);

    /*
     * IHXThreadSafeMethods methods
     */
    STDMETHOD_(UINT32,IsThreadSafe)(THIS);

private:
    friend class MessengerCallback;
    friend class AsyncFSysWorker;
    friend class AsyncFSysWorkerEntryPoint;

    STDMETHOD_(MessengerCallback*, CreateCallback) (THIS_
                                                    IUnknown* pResponse,
                                                    MessengerCallback::CALLBACK_TYPE cType);

    HX_RESULT UpdateFileNameMember();
    IHXBuffer* CalculateFullPathname(const char* pPath);
    static HX_RESULT CopyPathString(char* dest, char* src, size_t ulSrcLen);

    // stat data
    struct stat             m_statdata;

    UINT32		    m_ulPos;
    BOOL		    m_bCanBeReOpened;
    LONG32		    m_lRefCount;
    UINT32	    	    m_ulFlags;
    UINT32		    m_ulMaxIterationLevel;

    IUnknown*		    m_pContext;
    IHXCommonClassFactory* m_pCommonClassFactory;
    IHXFileResponse*	    m_pFileResponse;
    IHXFileStatResponse*   m_pStatResponse;
    IHXFileExistsResponse* m_pDoesExistResponse;
    IHXMutex*              m_pThisMutex;
    AsyncFileSystem*	    m_pFileSystem;
    IHXFastAlloc*          m_pFMalloc;
    IHXRequest*	    m_pRequest;
    IHXErrorMessages*      m_pErrorMessages;
    IHXBuffer*             m_pFullFilename;
    FD_TYPE		    m_nFd;
    IHXBuffer*             m_pBasePath;
    HXPluginContextID      m_ContextID;
    BOOL		    m_bReadPending;
    BOOL                    m_bStatPending;
    BOOL                    m_bDoesExistPending;
    BOOL                    m_bClosed;
    IUnknown*		    m_pUnknownUserContext;
    AsyncFSysWorker*        m_pWorker;
    IHXInterPluginMessenger2* m_pMessenger;
    BOOL		    m_bReadCancelled;
    BOOL                    m_bSeekPending;
    UINT32                  m_ulReadBufferOffset;
    UINT32                  m_ulReadBytesRequested;
    BOOL                    m_bAlignReads;
    BOOL                    m_bDisableMMapIO;
    BOOL                    m_bCheckVersionOnRead;
    char*                   m_pBuffer;
    MessengerCallback*      m_pMsgrReadCB;
    IHXDirHandlerResponse*	m_pDirResponse;
    CFindFile*              m_pDirList;
    BOOL                    m_bReadDirPending;
    BOOL                    m_bDirHandlerClosed;

#ifdef _WIN32
    OVERLAPPED              m_Overlapped;
#endif /* _WIN32 */
};

#endif /* _ASNCFOBJ_H_ */

--- NEW FILE: qcheck.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: qcheck.h,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef _QCHECK_H_
#define _QCHECK_H_

class CheckQueueLengthCB : public IHXCallback
{
public:
    CheckQueueLengthCB(AsyncFSysWorker** pWorkers,
                       UINT32 ulMaxWorkers,
                       UINT32 ulMaxQueueLength,
                       UINT32 ulFailureLevel,
                       UINT32 ulCheckInterval,
                       UINT32* pWorkerCount,
                       BOOL    bEnableIOTiming,
                       IHXThreadSafeScheduler* pScheduler,
                       IHXErrorMessages* pErrorMessages,
                       IUnknown* pContext,
                       AsyncFileSystem* pFS);
    virtual ~CheckQueueLengthCB();

    STDMETHOD(QueryInterface)   (THIS_
                                REFIID riid,
                                void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)  (THIS);
    STDMETHOD_(ULONG32,Release) (THIS);

    STDMETHOD(Func)(THIS);

private:
    AsyncFSysWorker** m_pWorkers;
    UINT32            m_ulMinWorkers;
    UINT32            m_ulMaxWorkers;
    UINT32            m_ulMaxQueueLength;
    UINT32            m_ulFailureLevel;
    UINT32            m_ulCheckInterval;
    UINT32            m_ulCurrentFails;
    IHXThreadSafeScheduler* m_pScheduler;
    IHXErrorMessages* m_pErrorMessages;
    IUnknown*         m_pContext;
    UINT32*           m_pWorkerCount;
    INT32             m_lRefCount;
    BOOL              m_bEnableIOTiming;
    AsyncFileSystem*  m_pFS;
    BOOL              m_bReEnter;
};

#endif // _QCHECK_H_

--- NEW FILE: qcheck.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: qcheck.cpp,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#include "hxcom.h"
#include "hxtypes.h"
#include "asncfsys.ver"

#include 

#include "hxfiles.h"
#include "hxplugn.h"
#include "hxprefs.h"
#include "hxmon.h"
#include "hxengin.h"
#include "debug.h"
#include "hxspriv.h"
#include "ihxpckts.h"

#include "hxerror.h"
#include "intrpm.h"

#include "asncfsys.h"
#include "asncwrkr.h"
#include "qcheck.h"

CheckQueueLengthCB::CheckQueueLengthCB(AsyncFSysWorker** pWorkers,
                                       UINT32 ulMaxWorkers,
                                       UINT32 ulMaxQueueLength,
                                       UINT32 ulFailureLevel,
                                       UINT32 ulCheckInterval,
                                       UINT32* pWorkerCount,
                                       BOOL bEnableIOTiming,
                                       IHXThreadSafeScheduler* pScheduler,
                                       IHXErrorMessages* pErrorMessages,
                                       IUnknown* pContext,
                                       AsyncFileSystem* pFS)
{
    m_ulMaxWorkers = ulMaxWorkers;
    m_ulMaxQueueLength = ulMaxQueueLength;
    m_ulFailureLevel = ulFailureLevel;
    m_ulCheckInterval = ulCheckInterval;
    m_ulCurrentFails = 0;
    m_pScheduler = pScheduler;
    pScheduler->AddRef();
    m_pErrorMessages = pErrorMessages;
    pErrorMessages->AddRef();
    m_pContext = pContext;
    pContext->AddRef();
    m_pWorkers = pWorkers;
    m_pWorkerCount = pWorkerCount;
    m_lRefCount = 0;
    m_bEnableIOTiming = bEnableIOTiming;
    m_pFS = pFS;
    pFS->AddRef();
    m_bReEnter = TRUE;
}

CheckQueueLengthCB::~CheckQueueLengthCB()
{
    HX_RELEASE(m_pScheduler);
    HX_RELEASE(m_pErrorMessages);
    HX_RELEASE(m_pFS);
}

STDMETHODIMP
CheckQueueLengthCB::Func()
{
    if (m_bReEnter)
        m_pScheduler->RelativeEnter(this, m_ulCheckInterval * 1000);

    //
    // grab the queue size from every worker, average them and see whether
    // we need to create more workers
    //
    UINT32 sum = 0;
    for (size_t i = 0; i < *m_pWorkerCount; i++)
    {
        sum += m_pWorkers[i]->GetQueueSize();
    }
    float average = (float)sum / (float)*m_pWorkerCount;
#ifdef QCHECK_DEBUG
    printf("sum = %u average = %f max = %u fails = %u\n",
           sum, average, m_ulMaxQueueLength, m_ulCurrentFails);
    fflush(stdout);
#endif // QCHECK_DEBUG

    // increment fails if we're over the limit otherwise decrement by 1
    if (average > (float) m_ulMaxQueueLength)
        m_ulCurrentFails++;
    else if (m_ulCurrentFails > 0)
        m_ulCurrentFails--;

    if (m_ulCurrentFails >= m_ulFailureLevel)
    {
        if (*m_pWorkerCount == m_ulMaxWorkers)
        {
            m_pErrorMessages->Report(HXLOG_WARNING, HXR_OK, HXR_OK,
                                     "pn-network wanted to create more workers "
                                     "but was already at maximum", NULL);
            m_bReEnter = FALSE;
            return HXR_OK;
        }

        m_ulCurrentFails = 0;
        //
        // we determine the number of workers to add by dividing the average
        // by the target queue length and multiply that number by the current
        // number of workers.
        //
        UINT32 ulWorkersToAdd = (UINT32)((average / m_ulMaxQueueLength) *
                                *m_pWorkerCount) + 1;
        size_t ulLastWorker;
        if (*m_pWorkerCount + ulWorkersToAdd > m_ulMaxWorkers)
            ulLastWorker = m_ulMaxWorkers;
        else
            ulLastWorker = *m_pWorkerCount + ulWorkersToAdd;

        for (size_t j = (*m_pWorkerCount); j < ulLastWorker; j++)
        {
            m_pWorkers[j] = new AsyncFSysWorker(m_pContext, m_pFS,
                                                "Async Filesystem Worker",
                                                 m_bEnableIOTiming);
            m_pWorkers[j]->Start();
        }

        *m_pWorkerCount = ulLastWorker;
    }

    return HXR_OK;
}

STDMETHODIMP
CheckQueueLengthCB::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IHXCallback))
    {
        AddRef();
        *ppvObj = this;
        return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

STDMETHODIMP_(ULONG32)
CheckQueueLengthCB::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

STDMETHODIMP_(ULONG32)
CheckQueueLengthCB::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}

--- NEW FILE: LICENSE.txt ---
 Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.  
        
 The contents of this directory, and (except where otherwise
 indicated) the directories included within this directory, are
 subject to the current version of the RealNetworks Public Source
 License (the "RPSL") available at RPSL.txt in this directory, unless
 you have licensed the directory under the current version of the
 RealNetworks Community Source License (the "RCSL") available at
 RCSL.txt in this directory, in which case the RCSL will apply. You
 may also obtain the license terms directly from RealNetworks.  You
 may not use the files in this directory except in compliance with the
 RPSL or, if you have a valid RCSL with RealNetworks applicable to
 this directory, the RCSL.  Please see the applicable RPSL or RCSL for
 the rights, obligations and limitations governing use of the contents
 of the directory.
 
 This directory is part of the Helix DNA Technology. RealNetworks is
 the developer of the Original Code and owns the copyrights in the
 portions it created.
   
 This directory, and the directories included with this directory, are
 distributed and made available on an 'AS IS' basis, WITHOUT WARRANTY
 OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY
 DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY
 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
 QUIET ENJOYMENT OR NON-INFRINGEMENT.
  
 Technology Compatibility Kit Test Suite(s) Location:  
    http://www.helixcommunity.org/content/tck  


--- NEW FILE: RPSL.txt ---
RealNetworks Public Source License Version 1.0
(Rev. Date October 28, 2002)

1. General Definitions. This License applies to any program or other work which
RealNetworks, Inc., or any other entity that elects to use this license,
("Licensor") makes publicly available and which contains a notice placed by
Licensor identifying such program or work as "Original Code" and stating that it
is subject to the terms of this RealNetworks Public Source License version 1.0
(or subsequent version thereof) ("License"). You are not required to accept this
License. However, nothing else grants You permission to use, copy, modify or
distribute the software or its derivative works. These actions are prohibited by
law if You do not accept this License. Therefore, by modifying, copying or
distributing the software (or any work based on the software), You indicate your
acceptance of this License to do so, and all its terms and conditions. In
addition, you agree to the terms of this License by clicking the Accept button
or downloading the software. As used in this License:

1.1 "Applicable Patent Rights" mean: (a) in the case where Licensor is the
grantor of rights, claims of patents that (i) are now or hereafter acquired,
owned by or assigned to Licensor and (ii) are necessarily infringed by using or
making the Original Code alone and not in combination with other software or
hardware; and (b) in the case where You are the grantor of rights, claims of
patents that (i) are now or hereafter acquired, owned by or assigned to You and
(ii) are infringed (directly or indirectly) by using or making Your
Modifications, taken alone or in combination with Original Code.

1.2 "Compatible Source License" means any one of the licenses listed on Exhibit
B or at https://www.helixcommunity.org/content/complicense or other licenses
specifically identified by Licensor in writing. Notwithstanding any term to the
contrary in any Compatible Source License, any code covered by any Compatible
Source License that is used with Covered Code must be made readily available in
Source Code format for royalty-free use under the terms of the Compatible Source
License or this License.

1.3 "Contributor" means any person or entity that creates or contributes to the
creation of Modifications.

1.4 "Covered Code" means the Original Code, Modifications, the combination of
Original Code and any Modifications, and/or any respective portions thereof.

1.5 "Deploy" means to use, sublicense or distribute Covered Code other than for
Your internal research and development (R&D) and/or Personal Use, and includes
without limitation, any and all internal use or distribution of Covered Code
within Your business or organization except for R&D use and/or Personal Use, as
well as direct or indirect sublicensing or distribution of Covered Code by You
to any third party in any form or manner.

1.6 "Derivative Work" means either the Covered Code or any derivative work under
United States copyright law, and including any work containing or including any
portion of the Covered Code or Modifications, either verbatim or with
modifications and/or translated into another language. Derivative Work also
includes any work which combines any portion of Covered Code or Modifications
with code not otherwise governed by the terms of this License.

1.7 "Externally Deploy" means to Deploy the Covered Code in any way that may be
accessed or used by anyone other than You, used to provide any services to
anyone other than You, or used in any way to deliver any content to anyone other
than You, whether the Covered Code is distributed to those parties, made
available as an application intended for use over a computer network, or used to
provide services or otherwise deliver content to anyone other than You.

1.8. "Interface" means interfaces, functions, properties, class definitions,
APIs, header files, GUIDs, V-Tables, and/or protocols allowing one piece of
software, firmware or hardware to communicate or interoperate with another piece
of software, firmware or hardware.

1.9 "Modifications" mean any addition to, deletion from, and/or change to, the
substance and/or structure of the Original Code, any previous Modifications, the
combination of Original Code and any previous Modifications, and/or any
respective portions thereof. When code is released as a series of files, a
Modification is: (a) any addition to or deletion from the contents of a file
containing Covered Code; and/or (b) any new file or other representation of
computer program statements that contains any part of Covered Code.

1.10 "Original Code" means (a) the Source Code of a program or other work as
originally made available by Licensor under this License, including the Source
Code of any updates or upgrades to such programs or works made available by
Licensor under this License, and that has been expressly identified by Licensor
as such in the header file(s) of such work; and (b) the object code compiled
from such Source Code and originally made available by Licensor under this
License.

1.11 "Personal Use" means use of Covered Code by an individual solely for his or
her personal, private and non-commercial purposes. An individual's use of
Covered Code in his or her capacity as an officer, employee, member, independent
contractor or agent of a corporation, business or organization (commercial or
non-commercial) does not qualify as Personal Use.

1.12 "Source Code" means the human readable form of a program or other work that
is suitable for making modifications to it, including all modules it contains,
plus any associated interface definition files, scripts used to control
compilation and installation of an executable (object code).

1.13 "You" or "Your" means an individual or a legal entity exercising rights
under this License. For legal entities, "You" or "Your" includes any entity
which controls, is controlled by, or is under common control with, You, where
"control" means (a) the power, direct or indirect, to cause the direction or
management of such entity, whether by contract or otherwise, or (b) ownership of
fifty percent (50%) or more of the outstanding shares or beneficial ownership of
such entity.

2. Permitted Uses; Conditions & Restrictions. Subject to the terms and
conditions of this License, Licensor hereby grants You, effective on the date
You accept this License (via downloading or using Covered Code or otherwise
indicating your acceptance of this License), a worldwide, royalty-free,
non-exclusive copyright license, to the extent of Licensor's copyrights cover
the Original Code, to do the following:

2.1 You may reproduce, display, perform, modify and Deploy Covered Code,
provided that in each instance:

(a) You must retain and reproduce in all copies of Original Code the copyright
and other proprietary notices and disclaimers of Licensor as they appear in the
Original Code, and keep intact all notices in the Original Code that refer to
this License;

(b) You must include a copy of this License with every copy of Source Code of
Covered Code and documentation You distribute, and You may not offer or impose
any terms on such Source Code that alter or restrict this License or the
recipients' rights hereunder, except as permitted under Section 6;

(c) You must duplicate, to the extent it does not already exist, the notice in
Exhibit A in each file of the Source Code of all Your Modifications, and cause
the modified files to carry prominent notices stating that You changed the files
and the date of any change;

(d) You must make Source Code of all Your Externally Deployed Modifications
publicly available under the terms of this License, including the license grants
set forth in Section 3 below, for as long as you Deploy the Covered Code or
twelve (12) months from the date of initial Deployment, whichever is longer. You
should preferably distribute the Source Code of Your Deployed Modifications
electronically (e.g. download from a web site); and

(e) if You Deploy Covered Code in object code, executable form only, You must
include a prominent notice, in the code itself as well as in related
documentation, stating that Source Code of the Covered Code is available under
the terms of this License with information on how and where to obtain such
Source Code. You must also include the Object Code Notice set forth in Exhibit A
in the "about" box or other appropriate place where other copyright notices are
placed, including any packaging materials.

2.2 You expressly acknowledge and agree that although Licensor and each
Contributor grants the licenses to their respective portions of the Covered Code
set forth herein, no assurances are provided by Licensor or any Contributor that
the Covered Code does not infringe the patent or other intellectual property
rights of any other entity. Licensor and each Contributor disclaim any liability
to You for claims brought by any other entity based on infringement of
intellectual property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, You hereby assume sole responsibility to
secure any other intellectual property rights needed, if any. For example, if a
third party patent license is required to allow You to make, use, sell, import
or offer for sale the Covered Code, it is Your responsibility to acquire such
license(s).

2.3 Subject to the terms and conditions of this License, Licensor hereby grants
You, effective on the date You accept this License (via downloading or using
Covered Code or otherwise indicating your acceptance of this License), a
worldwide, royalty-free, perpetual, non-exclusive patent license under
Licensor's Applicable Patent Rights to make, use, sell, offer for sale and
import the Covered Code, provided that in each instance you comply with the
terms of this License.

3. Your Grants. In consideration of, and as a condition to, the licenses granted
to You under this License:

(a) You grant to Licensor and all third parties a non-exclusive, perpetual,
irrevocable, royalty free license under Your Applicable Patent Rights and other
intellectual property rights owned or controlled by You, to make, sell, offer
for sale, use, import, reproduce, display, perform, modify, distribute and
Deploy Your Modifications of the same scope and extent as Licensor's licenses
under Sections 2.1 and 2.2; and

(b) You grant to Licensor and its subsidiaries a non-exclusive, worldwide,
royalty-free, perpetual and irrevocable license, under Your Applicable Patent
Rights and other intellectual property rights owned or controlled by You, to
make, use, sell, offer for sale, import, reproduce, display, perform,
distribute, modify or have modified (for Licensor and/or its subsidiaries),
sublicense and distribute Your Modifications, in any form and for any purpose,
through multiple tiers of distribution.

(c) You agree not use any information derived from Your use and review of the
Covered Code, including but not limited to any algorithms or inventions that may
be contained in the Covered Code, for the purpose of asserting any of Your
patent rights, or assisting a third party to assert any of its patent rights,
against Licensor or any Contributor.

4. Derivative Works. You may create a Derivative Work by combining Covered Code
with other code not otherwise governed by the terms of this License and
distribute the Derivative Work as an integrated product. In each such instance,
You must make sure the requirements of this License are fulfilled for the
Covered Code or any portion thereof, including all Modifications.

4.1 You must cause any Derivative Work that you distribute, publish or
Externally Deploy, that in whole or in part contains or is derived from the
Covered Code or any part thereof, to be licensed as a whole at no charge to all
third parties under the terms of this License and no other license except as
provided in Section 4.2. You also must make Source Code available for the
Derivative Work under the same terms as Modifications, described in Sections 2
and 3, above.

4.2 Compatible Source Licenses. Software modules that have been independently
developed without any use of Covered Code and which contain no portion of the
Covered Code, Modifications or other Derivative Works, but are used or combined
in any way wtih the Covered Code or any Derivative Work to form a larger
Derivative Work, are exempt from the conditions described in Section 4.1 but
only to the extent that: the software module, including any software that is
linked to, integrated with, or part of the same applications as, the software
module by any method must be wholly subject to one of the Compatible Source
Licenses. Notwithstanding the foregoing, all Covered Code must be subject to the
terms of this License. Thus, the entire Derivative Work must be licensed under a
combination of the RPSL (for Covered Code) and a Compatible Source License for
any independently developed software modules within the Derivative Work. The
foregoing requirement applies even if the Compatible Source License would
ordinarily allow the software module to link with, or form larger works with,
other software that is not subject to the Compatible Source License. For
example, although the Mozilla Public License v1.1 allows Mozilla code to be
combined with proprietary software that is not subject to the MPL, if
MPL-licensed code is used with Covered Code the MPL-licensed code could not be
combined or linked with any code not governed by the MPL. The general intent of
this section 4.2 is to enable use of Covered Code with applications that are
wholly subject to an acceptable open source license. You are responsible for
determining whether your use of software with Covered Code is allowed under Your
license to such software.

4.3 Mere aggregation of another work not based on the Covered Code with the
Covered Code (or with a work based on the Covered Code) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License. If You deliver the Covered Code for combination and/or integration with
an application previously provided by You (for example, via automatic updating
technology), such combination and/or integration constitutes a Derivative Work
subject to the terms of this License.

5. Exclusions From License Grant. Nothing in this License shall be deemed to
grant any rights to trademarks, copyrights, patents, trade secrets or any other
intellectual property of Licensor or any Contributor except as expressly stated
herein. No right is granted to the trademarks of Licensor or any Contributor
even if such marks are included in the Covered Code. Nothing in this License
shall be interpreted to prohibit Licensor from licensing under different terms
from this License any code that Licensor otherwise would have a right to
license. Modifications, Derivative Works and/or any use or combination of
Covered Code with other technology provided by Licensor or third parties may
require additional patent licenses from Licensor which Licensor may grant in its
sole discretion. No patent license is granted separate from the Original Code or
combinations of the Original Code with other software or hardware.

5.1. Trademarks. This License does not grant any rights to use the trademarks or
trade names owned by Licensor ("Licensor Marks" defined in Exhibit C) or to any
trademark or trade name belonging to any Contributor. No Licensor Marks may be
used to endorse or promote products derived from the Original Code other than as
permitted by the Licensor Trademark Policy defined in Exhibit C.

6. Additional Terms. You may choose to offer, and to charge a fee for, warranty,
support, indemnity or liability obligations and/or other rights consistent with
the scope of the license granted herein ("Additional Terms") to one or more
recipients of Covered Code. However, You may do so only on Your own behalf and
as Your sole responsibility, and not on behalf of Licensor or any Contributor.
You must obtain the recipient's agreement that any such Additional Terms are
offered by You alone, and You hereby agree to indemnify, defend and hold
Licensor and every Contributor harmless for any liability incurred by or claims
asserted against Licensor or such Contributor by reason of any such Additional
Terms.

7. Versions of the License. Licensor may publish revised and/or new versions of
this License from time to time. Each version will be given a distinguishing
version number. Once Original Code has been published under a particular version
of this License, You may continue to use it under the terms of that version. You
may also choose to use such Original Code under the terms of any subsequent
version of this License published by Licensor. No one other than Licensor has
the right to modify the terms applicable to Covered Code created under this
License.

8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part
pre-release, untested, or not fully tested works. The Covered Code may contain
errors that could cause failures or loss of data, and may be incomplete or
contain inaccuracies. You expressly acknowledge and agree that use of the
Covered Code, or any portion thereof, is at Your sole and entire risk. THE
COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF
ANY KIND AND LICENSOR AND LICENSOR'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS
"LICENSOR" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY
DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF
SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET
ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. LICENSOR AND EACH
CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE
COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR
REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR
ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR
WRITTEN DOCUMENTATION, INFORMATION OR ADVICE GIVEN BY LICENSOR, A LICENSOR
AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You
acknowledge that the Covered Code is not intended for use in high risk
activities, including, but not limited to, the design, construction, operation
or maintenance of nuclear facilities, aircraft navigation, aircraft
communication systems, or air traffic control machines in which case the failure
of the Covered Code could lead to death, personal injury, or severe physical or
environmental damage. Licensor disclaims any express or implied warranty of
fitness for such uses.

9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT
SHALL LICENSOR OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR
YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER
UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE OR STRICT
LIABILITY), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF LICENSOR OR SUCH
CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND
NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME
JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR
CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event
shall Licensor's total liability to You for all damages (other than as may be
required by applicable law) under this License exceed the amount of ten dollars
($10.00).

10. Ownership. Subject to the licenses granted under this License, each
Contributor retains all rights, title and interest in and to any Modifications
made by such Contributor. Licensor retains all rights, title and interest in and
to the Original Code and any Modifications made by or on behalf of Licensor
("Licensor Modifications"), and such Licensor Modifications will not be
automatically subject to this License. Licensor may, at its sole discretion,
choose to license such Licensor Modifications under this License, or on
different terms from those contained in this License or may choose not to
license them at all.

11. Termination. 

11.1 Term and Termination. The term of this License is perpetual unless
terminated as provided below. This License and the rights granted hereunder will
terminate:

(a) automatically without notice from Licensor if You fail to comply with any
term(s) of this License and fail to cure such breach within 30 days of becoming
aware of such breach;

(b) immediately in the event of the circumstances described in Section 12.5(b);
or

(c) automatically without notice from Licensor if You, at any time during the
term of this License, commence an action for patent infringement against
Licensor (including by cross-claim or counter claim in a lawsuit);

(d) upon written notice from Licensor if You, at any time during the term of
this License, commence an action for patent infringement against any third party
alleging that the Covered Code itself (excluding combinations with other
software or hardware) infringes any patent (including by cross-claim or counter
claim in a lawsuit).

11.2 Effect of Termination. Upon termination, You agree to immediately stop any
further use, reproduction, modification, sublicensing and distribution of the
Covered Code and to destroy all copies of the Covered Code that are in your
possession or control. All sublicenses to the Covered Code which have been
properly granted prior to termination shall survive any termination of this
License. Provisions which, by their nature, should remain in effect beyond the
termination of this License shall survive, including but not limited to Sections
3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for
compensation, indemnity or damages of any sort solely as a result of terminating
this License in accordance with its terms, and termination of this License will
be without prejudice to any other right or remedy of any party.

12. Miscellaneous.

12.1 Government End Users. The Covered Code is a "commercial item" as defined in
FAR 2.101. Government software and technical data rights in the Covered Code
include only those rights customarily provided to the public as defined in this
License. This customary commercial license in technical data and software is
provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer
Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical
Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software
or Computer Software Documentation). Accordingly, all U.S. Government End Users
acquire Covered Code with only those rights set forth herein.

12.2 Relationship of Parties. This License will not be construed as creating an
agency, partnership, joint venture or any other form of legal association
between or among You, Licensor or any Contributor, and You will not represent to
the contrary, whether expressly, by implication, appearance or otherwise.

12.3 Independent Development. Nothing in this License will impair Licensor's
right to acquire, license, develop, have others develop for it, market and/or
distribute technology or products that perform the same or similar functions as,
or otherwise compete with, Modifications, Derivative Works, technology or
products that You may develop, produce, market or distribute.

12.4 Waiver; Construction. Failure by Licensor or any Contributor to enforce any
provision of this License will not be deemed a waiver of future enforcement of
that or any other provision. Any law or regulation which provides that the
language of a contract shall be construed against the drafter will not apply to
this License.

12.5 Severability. (a) If for any reason a court of competent jurisdiction finds
any provision of this License, or portion thereof, to be unenforceable, that
provision of the License will be enforced to the maximum extent permissible so
as to effect the economic benefits and intent of the parties, and the remainder
of this License will continue in full force and effect. (b) Notwithstanding the
foregoing, if applicable law prohibits or restricts You from fully and/or
specifically complying with Sections 2 and/or 3 or prevents the enforceability
of either of those Sections, this License will immediately terminate and You
must immediately discontinue any use of the Covered Code and destroy all copies
of it that are in your possession or control.

12.6 Dispute Resolution. Any litigation or other dispute resolution between You
and Licensor relating to this License shall take place in the Seattle,
Washington, and You and Licensor hereby consent to the personal jurisdiction of,
and venue in, the state and federal courts within that District with respect to
this License. The application of the United Nations Convention on Contracts for
the International Sale of Goods is expressly excluded.

12.7 Export/Import Laws. This software is subject to all export and import laws
and restrictions and regulations of the country in which you receive the Covered
Code and You are solely responsible for ensuring that You do not export,
re-export or import the Covered Code or any direct product thereof in violation
of any such restrictions, laws or regulations, or without all necessary
authorizations.

12.8 Entire Agreement; Governing Law. This License constitutes the entire
agreement between the parties with respect to the subject matter hereof. This
License shall be governed by the laws of the United States and the State of
Washington.

Where You are located in the province of Quebec, Canada, the following clause
applies: The parties hereby confirm that they have requested that this License
and all related documents be drafted in English. Les parties ont exigé
que le présent contrat et tous les documents connexes soient
rédigés en anglais.

								EXHIBIT A.  

"Copyright © 1995-2002
RealNetworks, Inc. and/or its licensors. All Rights Reserved.

The contents of this file, and the files included with this file, are subject to
the current version of the RealNetworks Public Source License Version 1.0 (the
"RPSL") available at https://www.helixcommunity.org/content/rpsl unless you have
licensed the file under the RealNetworks Community Source License Version 1.0
(the "RCSL") available at https://www.helixcommunity.org/content/rcsl, in which
case the RCSL will apply. You may also obtain the license terms directly from
RealNetworks. You may not use this file except in compliance with the RPSL or,
if you have a valid RCSL with RealNetworks applicable to this file, the RCSL.
Please see the applicable RPSL or RCSL for the rights, obligations and
limitations governing use of the contents of the file.

This file is part of the Helix DNA Technology. RealNetworks is the developer of
the Original code and owns the copyrights in the portions it created.

This file, and the files included with this file, is distributed and made
available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING
WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.

Contributor(s): ____________________________________ 

Technology Compatibility Kit Test
Suite(s) Location (if licensed under the RCSL): ______________________________ 

Object Code Notice: Helix DNA Client technology included. Copyright (c)
RealNetworks, Inc., 1995-2002. All rights reserved.


								EXHIBIT B 

Compatible Source Licenses for the RealNetworks Public Source License. The
following list applies to the most recent version of the license as of October
25, 2002, unless otherwise indicated.

* Academic Free License
* Apache Software License
* Apple Public Source License
* Artistic license
* Attribution Assurance Licenses
* BSD license
* Common Public License (1)
* Eiffel Forum License
* GNU General Public License (GPL) (1)
* GNU Library or "Lesser" General Public License (LGPL) (1)
* IBM Public License
* Intel Open Source License
* Jabber Open Source License
* MIT license
* MITRE Collaborative Virtual Workspace License (CVW License)
* Motosoto License
* Mozilla Public License 1.0 (MPL)
* Mozilla Public License 1.1 (MPL)
* Nokia Open Source License
* Open Group Test Suite License
* Python Software Foundation License
* Ricoh Source Code Public License
* Sun Industry Standards Source License (SISSL)
* Sun Public License
* University of Illinois/NCSA Open Source License
* Vovida Software License v. 1.0
* W3C License
* X.Net License
* Zope Public License
* zlib/libpng license

(1) Note: because this license contains certain reciprocal licensing terms that
purport to extend to independently developed code, You may be prohibited under
the terms of this otherwise compatible license from using code licensed under
its terms with Covered Code because Covered Code may only be licensed under the
RealNetworks Public Source License. Any attempt to apply non RPSL license terms,
including without limitation the GPL, to Covered Code is expressly forbidden.
You are responsible for ensuring that Your use of Compatible Source Licensed
code does not violate either the RPSL or the Compatible Source License.

The latest version of this list can be found at:
https://www.helixcommunity.org/content/complicense

								EXHIBIT C 

RealNetworks' Trademark policy.  

RealNetworks defines the following trademarks collectively as "Licensor
Trademarks": "RealNetworks", "RealPlayer", "RealJukebox", "RealSystem",
"RealAudio", "RealVideo", "RealOne Player", "RealMedia", "Helix" or any other
trademarks or trade names belonging to RealNetworks.

RealNetworks "Licensor Trademark Policy" forbids any use of Licensor Trademarks
except as permitted by and in strict compliance at all times with RealNetworks'
third party trademark usage guidelines which are posted at
http://www.realnetworks.com/info/helixlogo.html.


--- NEW FILE: asncfsys.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: asncfsys.h,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */


#ifndef _ASNCFSYS_H_
#define _ASNCFSYS_H_

// same for all the platforms...may need to tweak it, if necessary
#define MAX_ITERATION_COUNT    200

class AsyncFSysWorker;
class WorkerRequest;
_INTERFACE IHXFastFileFactory2;
_INTERFACE IHXFastAlloc;
_INTERFACE IHXThreadSafeScheduler;
_INTERFACE IHXCommonClassFactory;

/****************************************************************************
 * 
 *  Function:
 * 
 *	HXCreateInstance()
 * 
 *  Purpose:
 * 
 *	Function implemented by all plugin DLL's to create an instance of 
 *	any of the objects supported by the DLL. This method is similar to 
 *	Window's CoCreateInstance() in its purpose, except that it only 
 *	creates objects from this plugin DLL.
 *
 *	NOTE: Aggregation is never used. Therefore an outer unknown is
 *	not passed to this function, and you do not need to code for this
 *	situation.
 * 
 */
STDAPI HXCreateInstance(IUnknown**  /*OUT*/	ppIUnknown);

extern void* operator new(size_t size, void* ptr);
#if 0
extern void* operator new(size_t size);
extern void operator delete(void* ptr);
#endif // 0

/****************************************************************************
 * 
 *  Function:
 * 
 *	HXShutdown()
 * 
 *  Purpose:
 * 
 *	Function implemented by all plugin DLL's to free any *global* 
 *	resources. This method is called just before the DLL is unloaded.
 *
 */
STDAPI HXShutdown(void);

class AsyncFileSystem : public IHXPlugin, 
                        public IHXFileSystemObject
{
public:

    AsyncFileSystem();
    ~AsyncFileSystem();

    void           AddPluginRef();
    void           RemovePluginRef();
    static INT32   PluginRefCount(void);

    // *** IUnknown methods ***
    STDMETHOD(QueryInterface)	(THIS_
    	    	    	    	REFIID riid,
    	    	    	    	void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)	(THIS);
    STDMETHOD_(ULONG32,Release)	(THIS);

    // *** IHXPlugin methods ***

    /************************************************************************
     *	Method:
     *	    IHXPlugin::GetPluginInfo
     *	Purpose:
     *	    Returns the basic information about this plugin.
     */
    STDMETHOD(GetPluginInfo)	(THIS_
				REF(BOOL)        /*OUT*/ bLoadMultiple,
				REF(const char*) /*OUT*/ pDescription,
				REF(const char*) /*OUT*/ pCopyright,
				REF(const char*) /*OUT*/ pMoreInfoURL,
                                REF(ULONG32)	 /*OUT*/ ulVersionNumber);

    /************************************************************************
     *	Method:
     *	    IHXPlugin::InitPlugin
     *	Purpose:
     *	    Initializes the plugin for use. This interface must always be
     *	    called before any other method is called. This is primarily needed 
     *	    so that the plugin can have access to the context for creation of
     *	    IHXBuffers and IMalloc.
     */
    STDMETHOD(InitPlugin)   (THIS_
			    IUnknown*   /*IN*/  pContext);

    // *** IHXFileSystemObject methods ***
    STDMETHOD(GetFileSystemInfo)    (THIS_
				    REF(const char*) /*OUT*/ pShortName,
				    REF(const char*) /*OUT*/ pProtocol);

    STDMETHOD(InitFileSystem) (THIS_ IHXValues* options);

    STDMETHOD(CreateFile)	(THIS_
				IUnknown**    /*OUT*/	ppFileObject);

    STDMETHOD(CreateDir)        (THIS_
                                IUnknown**     /*OUT*/  ppDirObject);
    AsyncFSysWorker* GetWorker();

private:
    LONG32			m_lRefCount;
    IHXBuffer*                 m_pBasePath;
    IUnknown*			m_pContext;
    IHXCommonClassFactory*     m_pClassFactory;
    IHXFastFileFactory2*	m_pFastFileFactory;
    IHXErrorMessages*          m_pErrorMessages;
    IHXValues*                 m_pOptions;
    AsyncFSysWorker**           m_pWorkers;
    UINT32			m_ulMaxIterationLevel;
    BOOL			m_bDisableMemoryMappedIO;
    BOOL			m_bEnableFileLocking;
    BOOL			m_bEnableFastFile;
    BOOL                        m_bAlignReads;
    UINT32			m_ulFastFileBlockSize;
    UINT32			m_ulFastFileMaxBlockSize;
    UINT32                      m_ulWorkerCount;
    UINT32                      m_ulWorkers;
    UINT32                      m_ulMaxWorkers;
    UINT32                      m_ulMaxQueueLength;
    UINT32                      m_ulFailureLevel;
    UINT32                      m_ulCheckInterval;
    IHXFastAlloc*              m_pFMalloc;
    BOOL                        m_bCheckVersionOnRead;
    ULONG32                     m_ulSectorAlignment;
    BOOL                        m_bEnableIOTiming;
    IHXThreadSafeScheduler*    m_pScheduler;

#ifdef _UNIX
    size_t                      m_ulPageSize;
#endif // _UNIX

    friend class AsyncFileObject;

    static const IID            zm_myIID;
    static const char*          zm_pDescription;
    static const char*          zm_pCopyright;
    static const char*          zm_pMoreInfoURL;
    static const char*		zm_pShortName;
    static const char*		zm_pProtocol;
    static INT32                m_nPluginRefCount;
};

#endif // ndef _ASNCFSYS_H_


--- NEW FILE: asncwrkr.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: asncwrkr.h,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef _ASNCWRKR_H_
#define _ASNCWRKR_H_

#include "platform_config.h"

_INTERFACE IHXProcess;
_INTERFACE IHXErrorMessages;
_INTERFACE IUnknown;
_INTERFACE IHXMutex;
_INTERFACE IHXCommonClassFactory;
class WorkerRequest;
class HXList;
class AsyncFileObject;
class AsyncFileSystem;

class AsyncFSysWorker
{
public:
    AsyncFSysWorker(IUnknown* pContext,
                    AsyncFileSystem* pFileSystem,
                    const char* pProcessName,
                    BOOL bEnableIOTiming);
    STDMETHOD(AddRequest) (THIS_ WorkerRequest* pRequest);

    virtual ~AsyncFSysWorker();

    STDMETHOD(Start) (THIS);
    STDMETHOD(SetMessenger) (THIS_ IHXInterPluginMessenger2* pMessenger);
    UINT32 GetQueueSize();

private:
    WorkerRequest* GetRequest();

    friend class AsyncFSysWorkerEntryPoint;
    friend class StatisticsCB;
    friend class AsyncFileObject;

    IHXProcess*              m_pProcess;
    IUnknown*                 m_pContext;
    IHXErrorMessages*        m_pErrorMessages;
    const char*               m_pProcessName;
    AsyncFileSystem*          m_pFileSystem;

#ifdef _WIN32
    HANDLE                    m_hCompletionPort;
#else
    IHXMutex*                m_pRequestQMutex;
    HXList*                   m_pRequestQ;
#  ifdef PTHREADS_SUPPORTED
    int                       m_pQPipe[2];
#  endif // PTHREADS_SUPPORTED
#endif /* _WIN32 */

    IHXCommonClassFactory*   m_pClassFactory;
    UINT32                    m_ulIterations;
    INT32                     m_lPid;
    IHXInterPluginMessenger2* m_pMessenger;
    BOOL                      m_bEnableIOTiming;
};

#endif /* _ASNCWRKR_H_ */

--- NEW FILE: asncbuf.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: asncbuf.cpp,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */


#include "hxtypes.h"
#include "hxcom.h"

#include "hxassert.h"
#include "ihxpckts.h"

#include "asncbuf.h"

extern IMalloc* pAsncFSysIMalloc;

AsyncFSysBuffer::AsyncFSysBuffer(void* pBuffer, size_t length, UINT32 ulOffset)
{
    m_pBuffer = pBuffer;
    m_lRefCount = 0;
    m_pData = (char*)m_pBuffer + ulOffset;
    m_ulDataLength = length - ulOffset;
}

AsyncFSysBuffer::~AsyncFSysBuffer()
{
    if (m_pBuffer)
        pAsncFSysIMalloc->Free(m_pBuffer);
    m_pBuffer = 0;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//      IUnknown::QueryInterface
//  Purpose:
//      Implement this to export the interfaces supported by your
//      object.
//
STDMETHODIMP
AsyncFSysBuffer::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
        AddRef();
        *ppvObj = this;
        return HXR_OK;
    }

    if (IsEqualIID(riid, IID_IHXBuffer))
    {
        AddRef();
        *ppvObj = (IHXBuffer*)this;
        return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//      IUnknown::AddRef
//  Purpose:
//      Everyone usually implements this the same... feel free to use
//      this implementation.
//
STDMETHODIMP_(ULONG32)
AsyncFSysBuffer::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//      IUnknown::Release
//  Purpose:
//      Everyone usually implements this the same... feel free to use
//      this implementation.
//
STDMETHODIMP_(ULONG32)
AsyncFSysBuffer::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}

STDMETHODIMP
AsyncFSysBuffer::Get(REF(UCHAR*) pData, REF(ULONG32) ulLength)
{
    pData = (UCHAR*)m_pData;
    ulLength = (ULONG32)m_ulDataLength;

    return HXR_OK;
}

STDMETHODIMP
AsyncFSysBuffer::Set(const UCHAR* pData, ULONG32 ulLength)
{
    HX_ASSERT(0);
    return HXR_FAIL;
}

STDMETHODIMP
AsyncFSysBuffer::SetSize(ULONG32 ulLength)
{
    HX_ASSERT(0);
    return HXR_FAIL;
}

STDMETHODIMP_(ULONG32)
AsyncFSysBuffer::GetSize()
{
    return m_ulDataLength;
}

STDMETHODIMP_(UCHAR*)
AsyncFSysBuffer::GetBuffer()
{
    return (UCHAR*)m_pData;
}

--- NEW FILE: win32.pcf ---
# ***** BEGIN LICENSE BLOCK *****  
# Source last modified: $Id: win32.pcf,v 1.1 2005/06/08 18:01:06 rishimathew Exp $ 
#   
# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
#       
# The contents of this file, and the files included with this file, 
# are subject to the current version of the RealNetworks Public 
# Source License (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the current version of the RealNetworks Community 
# Source License (the "RCSL") available at 
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL 
# will apply. You may also obtain the license terms directly from 
# RealNetworks.  You may not use this file except in compliance with 
# the RPSL or, if you have a valid RCSL with RealNetworks applicable 
# to this file, the RCSL.  Please see the applicable RPSL or RCSL for 
# the rights, obligations and limitations governing use of the 
# contents of the file. 
#   
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the 
# portions it created. 
#   
# This file, and the files included with this file, is distributed 
# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY 
# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS 
# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES 
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET 
# ENJOYMENT OR NON-INFRINGEMENT. 
#  
# Technology Compatibility Kit Test Suite(s) Location:  
#    http://www.helixcommunity.org/content/tck  
#  
# Contributor(s):  
#   
# ***** END LICENSE BLOCK ***** 
project.sys_libraries[-1:-1] = [
    'version.lib',
    'wsock32.lib',
    'kernel32.lib',
    'user32.lib',
    'advapi32.lib',
    'vfw32.lib'
    ]

--- NEW FILE: RCSL.txt ---
The RCSL is made up of a base agreement and a few Attachments.

For Research and Development use, you agree to the terms of the
RCSL R&D License (base RCSL and Attachments A, B, and C) 

For Commercial Use (either distribution or internal commercial
deployment) of the Helix DNA with or without support for RealNetworks'
RealAudio and RealVideo Add-on Technology, you agree to the
terms of the same RCSL R&D license
and execute one or more additional Commercial Use License attachments
.

------------------------------------------------------------------------


    REALNETWORKS COMMUNITY SOURCE LICENSE

Version 1.2 (Rev. Date: January 22, 2003).


  RECITALS

Original Contributor has developed Specifications, Source Code
implementations and Executables of certain Technology; and

Original Contributor desires to license the Technology to a large
community to facilitate research, innovation and product development
while maintaining compatibility of such products with the Technology as
delivered by Original Contributor; and

Original Contributor desires to license certain Trademarks for the
purpose of branding products that are compatible with the relevant
Technology delivered by Original Contributor; and

You desire to license the Technology and possibly certain Trademarks
from Original Contributor on the terms and conditions specified in this
License.

In consideration for the mutual covenants contained herein, You and
Original Contributor agree as follows:


  AGREEMENT

*1. Introduction.*

The RealNetworks Community Source License ("RCSL") and effective
attachments ("License") may include five distinct licenses:

i) Research Use license -- License plus Attachments A, B and C only.

ii) Commercial Use and Trademark License, which may be for Internal
Deployment Use or external distribution, or both -- License plus
Attachments A, B, C, and D.

iii) Technology Compatibility Kit (TCK) license -- Attachment C.

iv) Add-On Technology License (Executable) Commercial Use License
-Attachment F.

v) Add-On Technology Source Code Porting and Optimization
License-Attachment G.

The Research Use license is effective when You click and accept this
License. The TCK is effective when You click and accept this License,
unless otherwise specified in the TCK attachments. The Commercial Use
and Trademark, Add-On Technology License, and the Add-On Technology
Source Code Porting and Optimization licenses must each be signed by You
and Original Contributor to become effective. Once effective, these
licenses and the associated requirements and responsibilities are
cumulative. Capitalized terms used in this License are defined in the
Glossary.

*2. License Grants.*

2.1 Original Contributor Grant.

Subject to Your compliance with Sections 3, 8.10 and Attachment A of
this License, Original Contributor grants to You a worldwide,
royalty-free, non-exclusive license, to the extent of Original
Contributor's Intellectual Property Rights covering the Original Code,
Upgraded Code and Specifications, to do the following:

(a) Research Use License:

(i) use, reproduce and modify the Original Code, Upgraded Code and
Specifications to create Modifications and Reformatted Specifications
for Research Use by You;

(ii) publish and display Original Code, Upgraded Code and Specifications
with, or as part of Modifications, as permitted under Section 3.1(b) below;

(iii) reproduce and distribute copies of Original Code and Upgraded Code
to Licensees and students for Research Use by You;

(iv) compile, reproduce and distribute Original Code and Upgraded Code
in Executable form, and Reformatted Specifications to anyone for
Research Use by You.

(b) Other than the licenses expressly granted in this License, Original
Contributor retains all right, title, and interest in Original Code and
Upgraded Code and Specifications.

2.2 Your Grants.

(a) To Other Licensees. You hereby grant to each Licensee a license to
Your Error Corrections and Shared Modifications, of the same scope and
extent as Original Contributor's licenses under Section 2.1 a) above
relative to Research Use and Attachment D relative to Commercial Use.

(b) To Original Contributor. You hereby grant to Original Contributor a
worldwide, royalty-free, non-exclusive, perpetual and irrevocable
license, to the extent of Your Intellectual Property Rights covering
Your Error Corrections, Shared Modifications and Reformatted
Specifications, to use, reproduce, modify, display and distribute Your
Error Corrections, Shared Modifications and Reformatted Specifications,
in any form, including the right to sublicense such rights through
multiple tiers of distribution.

(c) Other than the licenses expressly granted in Sections 2.2(a) and (b)
above, and the restrictions set forth in Section 3.1(d)(iv) below, You
retain all right, title, and interest in Your Error Corrections, Shared
Modifications and Reformatted Specifications.

2.3 Contributor Modifications.

You may use, reproduce, modify, display and distribute Contributor Error
Corrections, Shared Modifications and Reformatted Specifications,
obtained by You under this License, to the same scope and extent as with
Original Code, Upgraded Code and Specifications.

2.4 Subcontracting.

You may deliver the Source Code of Covered Code to other Licensees
having at least a Research Use license, for the sole purpose of
furnishing development services to You in connection with Your rights
granted in this License. All such Licensees must execute appropriate
documents with respect to such work consistent with the terms of this
License, and acknowledging their work-made-for-hire status or assigning
exclusive right to the work product and associated Intellectual Property
Rights to You.

*3. Requirements and Responsibilities*.

3.1 Research Use License.

As a condition of exercising the rights granted under Section 2.1(a)
above, You agree to comply with the following:

(a) Your Contribution to the Community. All Error Corrections and Shared
Modifications which You create or contribute to are automatically
subject to the licenses granted under Section 2.2 above. You are
encouraged to license all of Your other Modifications under Section 2.2
as Shared Modifications, but are not required to do so. You agree to
notify Original Contributor of any errors in the Specification.

(b) Source Code Availability. You agree to provide all Your Error
Corrections to Original Contributor as soon as reasonably practicable
and, in any event, prior to Internal Deployment Use or Commercial Use,
if applicable. Original Contributor may, at its discretion, post Source
Code for Your Error Corrections and Shared Modifications on the
Community Webserver. You may also post Error Corrections and Shared
Modifications on a web-server of Your choice; provided, that You must
take reasonable precautions to ensure that only Licensees have access to
such Error Corrections and Shared Modifications. Such precautions shall
include, without limitation, a password protection scheme limited to
Licensees and a click-on, download certification of Licensee status
required of those attempting to download from the server. An example of
an acceptable certification is attached as Attachment A-2.

(c) Notices. All Error Corrections and Shared Modifications You create
or contribute to must include a file documenting the additions and
changes You made and the date of such additions and changes. You must
also include the notice set forth in Attachment A-1 in the file header.
If it is not possible to put the notice in a particular Source Code file
due to its structure, then You must include the notice in a location
(such as a relevant directory file), where a recipient would be most
likely to look for such a notice.

(d) Redistribution.

(i) Source. Covered Code may be distributed in Source Code form only to
another Licensee (except for students as provided below). You may not
offer or impose any terms on any Covered Code that alter the rights,
requirements, or responsibilities of such Licensee. You may distribute
Covered Code to students for use in connection with their course work
and research projects undertaken at accredited educational institutions.
Such students need not be Licensees, but must be given a copy of the
notice set forth in Attachment A-3 and such notice must also be included
in a file header or prominent location in the Source Code made available
to such students.

(ii) Executable. You may distribute Executable version(s) of Covered
Code to Licensees and other third parties only for the purpose of
evaluation and comment in connection with Research Use by You and under
a license of Your choice, but which limits use of such Executable
version(s) of Covered Code only to that purpose.

(iii) Modified Class, Interface and Package Naming. In connection with
Research Use by You only, You may use Original Contributor's class,
Interface and package names only to accurately reference or invoke the
Source Code files You modify. Original Contributor grants to You a
limited license to the extent necessary for such purposes.

(iv) You expressly agree that any distribution, in whole or in part, of
Modifications developed by You shall only be done pursuant to the terms
and conditions of this License.

(e) Extensions.

(i) Covered Code. You may not include any Source Code of Community Code
in any Extensions. You may include the compiled Header Files of
Community Code in an Extension provided that Your use of the Covered
Code, including Heading Files, complies with the Commercial Use License,
the TCK and all other terms of this License.

(ii) Publication. No later than the date on which You first distribute
such Extension for Commercial Use, You must publish to the industry, on
a non-confidential basis and free of all copyright restrictions with
respect to reproduction and use, an accurate and current specification
for any Extension. In addition, You must make available an appropriate
test suite, pursuant to the same rights as the specification,
sufficiently detailed to allow any third party reasonably skilled in the
technology to produce implementations of the Extension compatible with
the specification. Such test suites must be made available as soon as
reasonably practicable but, in no event, later than ninety (90) days
after Your first Commercial Use of the Extension. You must use
reasonable efforts to promptly clarify and correct the specification and
the test suite upon written request by Original Contributor.

(iii) Open. You agree to refrain from enforcing any Intellectual
Property Rights You may have covering any interface(s) of Your
Extension, which would prevent the implementation of such interface(s)
by Original Contributor or any Licensee. This obligation does not
prevent You from enforcing any Intellectual Property Right You have that
would otherwise be infringed by an implementation of Your Extension.

(iv) Interface Modifications and Naming. You may not modify or add to
the GUID space * * "xxxxxxxx-0901-11d1-8B06-00A024406D59" or any other
GUID space designated by Original Contributor. You may not modify any
Interface prefix provided with the Covered Code or any other prefix
designated by Original Contributor.* *

* *

(f) You agree that any Specifications provided to You by Original
Contributor are confidential and proprietary information of Original
Contributor. You must maintain the confidentiality of the Specifications
and may not disclose them to any third party without Original
Contributor's prior written consent. You may only use the Specifications
under the terms of this License and only for the purpose of implementing
the terms of this License with respect to Covered Code. You agree not
use, copy or distribute any such Specifications except as provided in
writing by Original Contributor.

3.2 Commercial Use License.

You may not make Commercial Use of any Covered Code unless You and
Original Contributor have executed a copy of the Commercial Use and
Trademark License attached as Attachment D.

*4. Versions of the License.*

4.1 License Versions.

Original Contributor may publish revised versions of the License from
time to time. Each version will be given a distinguishing version number.

4.2 Effect.

Once a particular version of Covered Code has been provided under a
version of the License, You may always continue to use such Covered Code
under the terms of that version of the License. You may also choose to
use such Covered Code under the terms of any subsequent version of the
License. No one other than Original Contributor has the right to
promulgate License versions.

4.3 Multiple-Licensed Code.

Original Contributor may designate portions of the Covered Code as
"Multiple-Licensed." "Multiple-Licensed" means that the Original
Contributor permits You to utilize those designated portions of the
Covered Code under Your choice of this License or the alternative
license(s), if any, specified by the Original Contributor in an
Attachment to this License.

*5. Disclaimer of Warranty.*

5.1 COVERED CODE PROVIDED AS IS.

COVERED CODE IS PROVIDED UNDER THIS LICENSE "AS IS," WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT
FOR A PARTICULAR PURPOSE OR NON-INFRINGING. YOU AGREE TO BEAR THE ENTIRE
RISK IN CONNECTION WITH YOUR USE AND DISTRIBUTION OF COVERED CODE UNDER
THIS LICENSE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART
OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER
EXCEPT SUBJECT TO THIS DISCLAIMER.

5.2 Not Designed for High Risk Activities.

You acknowledge that Original Code, Upgraded Code and Specifications are
not designed or intended for use in high risk activities including, but
not limited to: (i) on-line control of aircraft, air traffic, aircraft
navigation or aircraft communications; or (ii) in the design,
construction, operation or maintenance of any nuclear facility. Original
Contributor disclaims any express or implied warranty of fitness for
such uses.

*6. Termination.*

6.1 By You.

You may terminate this Research Use license at anytime by providing
written notice to Original Contributor.

6.2 By Original Contributor.

This License and the rights granted hereunder will terminate:

(i) automatically if You fail to comply with the terms of this License
and fail to cure such breach within 30 days of receipt of written notice
of the breach;

(ii) immediately in the event of circumstances specified in Sections 7.1
and 8.4; or

(iii) at Original Contributor's discretion upon any action initiated by
You (including by cross-claim or counter claim) alleging that use or
distribution by Original Contributor or any Licensee, of Original Code,
Upgraded Code, Error Corrections, Shared Modifications or Specifications
infringe a patent owned or controlled by You.

6.3 Effective of Termination.

Upon termination, You agree to discontinue use of and destroy all copies
of Covered Code in Your possession. All sublicenses to the Covered Code
which You have properly granted shall survive any termination of this
License. Provisions that, by their nature, should remain in effect
beyond the termination of this License shall survive including, without
limitation, Sections 2.2, 3, 5, 7 and 8.

6.4 No Compensation.

Each party waives and releases the other from any claim to compensation
or indemnity for permitted or lawful termination of the business
relationship established by this License.

*7. Liability.*

7.1 Infringement. Should any of the Original Code, Upgraded Code, TCK or
Specifications ("Materials") become the subject of a claim of
infringement, Original Contributor may, at its sole option, (i) attempt
to procure the rights necessary for You to continue using the Materials,
(ii) modify the Materials so that they are no longer infringing, or
(iii) terminate Your right to use the Materials, immediately upon
written notice, and refund to You the amount, if any, having then
actually been paid by You to Original Contributor for the Original Code,
Upgraded Code and TCK, depreciated on a straight line, five year basis.

7.2 LIMITATION OF LIABILITY. TO THE FULL EXTENT ALLOWED BY APPLICABLE
LAW, ORIGINAL CONTRIBUTOR'S LIABILITY TO YOU FOR CLAIMS RELATING TO THIS
LICENSE, WHETHER FOR BREACH OR IN TORT, SHALL BE LIMITED TO ONE HUNDRED
PERCENT (100%) OF THE AMOUNT HAVING THEN ACTUALLY BEEN PAID BY YOU TO
ORIGINAL CONTRIBUTOR FOR ALL COPIES LICENSED HEREUNDER OF THE PARTICULAR
ITEMS GIVING RISE TO SUCH CLAIM, IF ANY, DURING THE TWELVE MONTHS
PRECEDING THE CLAIMED BREACH. IN NO EVENT WILL YOU (RELATIVE TO YOUR
SHARED MODIFICATIONS OR ERROR CORRECTIONS) OR ORIGINAL CONTRIBUTOR BE
LIABLE FOR ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
DAMAGES IN CONNECTION WITH OR RISING OUT OF THIS LICENSE (INCLUDING,
WITHOUT LIMITATION, LOSS OF PROFITS, USE, DATA, OR OTHER ECONOMIC
ADVANTAGE), HOWEVER IT ARISES AND ON ANY THEORY OF LIABILITY, WHETHER IN
AN ACTION FOR CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE)
OR OTHERWISE, WHETHER OR NOT YOU OR ORIGINAL CONTRIBUTOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE AND NOTWITHSTANDING THE
FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY.

*8. Miscellaneous.*

8.1 Trademark.

You shall not use any Trademark unless You and Original Contributor
execute a copy of the Commercial Use and Trademark License Agreement
attached hereto as Attachment D. Except as expressly provided in the
License, You are granted no right, title or license to, or interest in,
any Trademarks. Whether or not You and Original Contributor enter into
the Trademark License, You agree not to (i) challenge Original
Contributor's ownership or use of Trademarks; (ii) attempt to register
any Trademarks, or any mark or logo substantially similar thereto; or
(iii) incorporate any Trademarks into Your own trademarks, product
names, service marks, company names, or domain names.

8.2 Integration.

This License represents the complete agreement concerning the subject
matter hereof.

8.3 Assignment.

Original Contributor may assign this License, and its rights and
obligations hereunder, in its sole discretion. You may assign the
Research Use portions of this License and the TCK license to a third
party upon prior written notice to Original Contributor (which may be
provided electronically via the Community Web-Server). You may not
assign the Commercial Use and Trademark license, the Add-On Technology
License, or the Add-On Technology Source Code Porting License, including
by way of merger (regardless of whether You are the surviving entity) or
acquisition, without Original Contributor's prior written consent.

8.4 Severability.

If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it
enforceable. Notwithstanding the foregoing, if You are prohibited by law
from fully and specifically complying with Sections 2.2 or 3, this
License will immediately terminate and You must immediately discontinue
any use of Covered Code.

8.5 Governing Law.

This License shall be governed by the laws of the United States and the
State of Washington, as applied to contracts entered into and to be
performed in Washington between Washington residents. The application of
the United Nations Convention on Contracts for the International Sale of
Goods is expressly excluded. You agree that the state and federal courts
located in Seattle, Washington have exclusive jurisdiction over any
claim relating to the License, including contract and tort claims.

8.6 Dispute Resolution.

a) Arbitration. Any dispute arising out of or relating to this License
shall be finally settled by arbitration as set out herein, except that
either party may bring any action, in a court of competent jurisdiction
(which jurisdiction shall be exclusive), with respect to any dispute
relating to such party's Intellectual Property Rights or with respect to
Your compliance with the TCK license. Arbitration shall be administered:
(i) by the American Arbitration Association (AAA), (ii) in accordance
with the rules of the United Nations Commission on International Trade
Law (UNCITRAL) (the "Rules") in effect at the time of arbitration as
modified herein; and (iii) the arbitrator will apply the substantive
laws of Washington and the United States. Judgment upon the award
rendered by the arbitrator may be entered in any court having
jurisdiction to enforce such award.

b) Arbitration language, venue and damages. All arbitration proceedings
shall be conducted in English by a single arbitrator selected in
accordance with the Rules, who must be fluent in English and be either a
retired judge or practicing attorney having at least ten (10) years
litigation experience and be reasonably familiar with the technology
matters relative to the dispute. Unless otherwise agreed, arbitration
venue shall be in Seattle, Washington. The arbitrator may award monetary
damages only and nothing shall preclude either party from seeking
provisional or emergency relief from a court of competent jurisdiction.
The arbitrator shall have no authority to award damages in excess of
those permitted in this License and any such award in excess is void.
All awards will be payable in U.S. dollars and may include, for the
prevailing party (i) pre-judgment award interest, (ii) reasonable
attorneys' fees incurred in connection with the arbitration, and (iii)
reasonable costs and expenses incurred in enforcing the award. The
arbitrator will order each party to produce identified documents and
respond to no more than twenty-five single question interrogatories.

8.7 Construction.

Any law or regulation, which provides that the language of a contract
shall be construed against the drafter, shall not apply to this License.

8.8 U.S. Government End Users.

The Covered Code is a "commercial item," as that term is defined in 48
C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software"
and "commercial computer software documentation," as such terms are used
in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and
48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government
End Users acquire Covered Code with only those rights set forth herein.
You agree to pass this notice to our licensees.

8.9 Marketing Activities.

Licensee hereby grants Original Contributor a non-exclusive,
non-transferable, limited license to use the Licensee's company name and
logo ("Licensee Marks") in any presentations, press releases, or
marketing materials solely for the purpose of identifying Licensee as a
member of the Helix Community. Licensee shall provide samples of
Licensee Marks to Original Contributor upon request by Original
Contributor. Original Contributor acknowledges that the Licensee Marks
are the trademarks of Licensee. Original Contributor shall not use the
Licensee Marks in a way that may imply that Original Contributor is an
agency or branch of Licensee. Original Contributor understands and
agrees that the use of any Licensee Marks in connection with this
Agreement shall not create any right, title or interest, in, or to the
Licensee Marks or any Licensee trademarks and that all such use and
goodwill associated with any such trademarks will inure to the benefit
of Licensee. Further the Original Contributor will stop usage of the
Licensee Marks upon Licensee's request.

8.10 Press Announcements.

You may make press announcements or other public statements regarding
this License without the prior written consent of the Original
Contributor, if Your statement is limited to announcing the licensing of
the Covered Code or the availability of Your Product and its
compatibility with the Covered Code. All other public announcements
regarding this license require the prior written consent of the Original
Contributor. Consent requests are welcome at press@helixcommunity.org.

8.11 International Use.

a) Export/Import laws. Covered Code is subject to U.S. export control
laws and may be subject to export or import regulations in other
countries. Each party agrees to comply strictly with all such laws and
regulations and acknowledges their responsibility to obtain such
licenses to export, re-export, or import as may be required. You agree
to pass these obligations to Your licensees.

b) Intellectual Property Protection. Due to limited intellectual
property protection and enforcement in certain countries, You agree not
to redistribute the Original Code, Upgraded Code, TCK and Specifications
to any country on the list of restricted countries on the Community Web
Server.

8.12 Language.

This License is in the English language only, which language shall be
controlling in all respects, and all versions of this License in any
other language shall be for accommodation only and shall not be binding
on the parties to this License. All communications and notices made or
given pursuant to this License, and all documentation and support to be
provided, unless otherwise noted, shall be in the English language.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH REALNETWORKS, INC. IF YOU ARE AGREEING
TO THIS LICENSE ON BEHALF OF A COMPANY, YOU REPRESENT THAT YOU ARE
AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE. WHETHER YOU ARE ACTING
ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY, YOU MUST BE OF MAJORITY
AGE AND BE OTHERWISE COMPETENT TO ENTER INTO CONTRACTS. IF YOU DO NOT
MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY OF THE TERMS AND
CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON TO EXIT.


    GLOSSARY

1. *"Added Value"* means code which:

(i) has a principal purpose which is substantially different from that
of the stand-alone Technology;

(ii) represents a significant functional and value enhancement to the
Technology;

(iii) operates in conjunction with the Technology; and

(iv) is not marketed as a technology which replaces or substitutes for
the Technology

2. "*Applicable Patent Rights*" mean: (a) in the case where Original
Contributor is the grantor of rights, claims of patents that (i) are now
or hereafter acquired, owned by or assigned to Original Contributor and
(ii) are necessarily infringed by using or making the Original Code or
Upgraded Code, including Modifications provided by Original Contributor,
alone and not in combination with other software or hardware; and (b) in
the case where Licensee is the grantor of rights, claims of patents that
(i) are now or hereafter acquired, owned by or assigned to Licensee and
(ii) are infringed (directly or indirectly) by using or making
Licensee's Modifications or Error Corrections, taken alone or in
combination with Covered Code.

3. "*Application Programming Interfaces (APIs)"* means the interfaces,
associated header files, service provider interfaces, and protocols that
enable a device, application, Operating System, or other program to
obtain services from or make requests of (or provide services in
response to requests from) other programs, and to use, benefit from, or
rely on the resources, facilities, and capabilities of the relevant
programs using the APIs. APIs includes the technical documentation
describing the APIs, the Source Code constituting the API, and any
Header Files used with the APIs.

4. "*Commercial Use*" means any use (internal or external), copying,
sublicensing or distribution (internal or external), directly or
indirectly of Covered Code by You other than Your Research Use of
Covered Code within Your business or organization or in conjunction with
other Licensees with equivalent Research Use rights. Commercial Use
includes any use of the Covered Code for direct or indirect commercial
or strategic gain, advantage or other business purpose. Any Commercial
Use requires execution of Attachment D by You and Original Contributor.

5. "*Community Code*" means the Original Code, Upgraded Code, Error
Corrections, Shared Modifications, or any combination thereof.

6. "*Community Webserver(s)"* means the webservers designated by
Original Contributor for access to the Original Code, Upgraded Code, TCK
and Specifications and for posting Error Corrections and Shared
Modifications.

7. "*Compliant Covered Code*" means Covered Code that complies with the
requirements of the TCK.

8. "*Contributor*" means each Licensee that creates or contributes to
the creation of any Error Correction or Shared Modification.

9. "*Covered Code*" means the Original Code, Upgraded Code,
Modifications, or any combination thereof.

10. "*Error Correction*" means any change made to Community Code which
conforms to the Specification and corrects the adverse effect of a
failure of Community Code to perform any function set forth in or
required by the Specifications.

11. "*Executable*" means Covered Code that has been converted from
Source Code to the preferred form for execution by a computer or digital
processor (e.g. binary form).

12. "*Extension(s)"* means any additional Interfaces developed by or for
You which: (i) are designed for use with the Technology; (ii) constitute
an API for a library of computing functions or services; and (iii) are
disclosed or otherwise made available to third party software developers
for the purpose of developing software which invokes such additional
Interfaces. The foregoing shall not apply to software developed by Your
subcontractors to be exclusively used by You.

13. "*Header File(s)"* means that portion of the Source Code that
provides the names and types of member functions, data members, class
definitions, and interface definitions necessary to implement the APIs
for the Covered Code. Header Files include, files specifically
designated by Original Contributor as Header Files. Header Files do not
include the code necessary to implement the functionality underlying the
Interface.

14. *"Helix DNA Server Technology"* means the program(s) that implement
the Helix Universal Server streaming engine for the Technology as
defined in the Specification.

15. *"Helix DNA Client Technology"* means the Covered Code that
implements the RealOne Player engine as defined in the Specification.

16. *"Helix DNA Producer Technology"* means the Covered Code that
implements the Helix Producer engine as defined in the Specification.

17. *"Helix DNA Technology"* means the Helix DNA Server Technology, the
Helix DNA Client Technology, the Helix DNA Producer Technology and other
Helix technologies designated by Original Contributor.

18. "*Intellectual Property Rights*" means worldwide statutory and
common law rights associated solely with (i) Applicable Patent Rights;
(ii) works of authorship including copyrights, copyright applications,
copyright registrations and "moral rights"; (iii) the protection of
trade and industrial secrets and confidential information; and (iv)
divisions, continuations, renewals, and re-issuances of the foregoing
now existing or acquired in the future.

19. *"Interface*" means interfaces, functions, properties, class
definitions, APIs, Header Files, GUIDs, V-Tables, and/or protocols
allowing one piece of software, firmware or hardware to communicate or
interoperate with another piece of software, firmware or hardware.

20. "*Internal Deployment Use*" means use of Compliant Covered Code
(excluding Research Use) within Your business or organization only by
Your employees and/or agents on behalf of Your business or organization,
but not to provide services, including content distribution, to third
parties, subject to execution of Attachment D by You and Original
Contributor, if required.

21. "*Licensee*" means any party that has entered into and has in effect
a version of this License with Original Contributor.

22. "*MIME type*" means a description of what type of media or other
content is in a file, including by way of example but not limited to
'audio/x-pn-realaudio-plugin.'

23. "*Modification(s)"* means (i) any addition to, deletion from and/or
change to the substance and/or structure of the Covered Code, including
Interfaces; (ii) the combination of any Covered Code and any previous
Modifications; (iii) any new file or other representation of computer
program statements that contains any portion of Covered Code; and/or
(iv) any new Source Code implementing any portion of the Specifications.

24. "*MP3 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Picture Experts Group known as MPEG-1 Audio Layer-3 or MP3,
including but not limited to all past and future versions, profiles,
extensions, parts and amendments relating to the MP3 specification.

25. "*MPEG-4 Patents*" means any patents necessary to make, use or sell
technology implementing any portion of the specification developed by
the Moving Pictures Experts Group known as MPEG-4, including but not
limited to all past and future versions, profiles, extensions, parts and
amendments relating to the MPEG-4 specification.

26. "*Original Code*" means the initial Source Code for the Technology
as described on the Community Web Server.

27. "*Original Contributor*" means RealNetworks, Inc., its affiliates
and its successors and assigns.

28. "*Original Contributor MIME Type*" means the MIME registry, browser
preferences, or local file/protocol associations invoking any Helix DNA
Client-based application, including the RealOne Player, for playback of
RealAudio, RealVideo, other RealMedia MIME types or datatypes (e.g.,
.ram, .rnx, .rpm, .ra, .rm, .rp, .rt, .rf, .prx, .mpe, .rmp, .rmj, .rav,
.rjs, .rmx, .rjt, .rms), and any other Original Contributor-specific or
proprietary MIME types that Original Contributor may introduce in the
future.

29. "*Personal Use*" means use of Covered Code by an individual solely
for his or her personal, private and non-commercial purposes. An
individual's use of Covered Code in his or her capacity as an officer,
employee, member, independent contractor or agent of a corporation,
business or organization (commercial or non-commercial) does not qualify
as Personal Use.

30. "*RealMedia File Format*" means the file format designed and
developed by RealNetworks for storing multimedia data and used to store
RealAudio and RealVideo encoded streams. Valid RealMedia File Format
extensions include: .rm, .rmj, .rmc, .rmvb, .rms.

31. "*RCSL Webpage*" means the RealNetworks Community Source License
webpage located at https://www.helixcommunity.org/content/rcsl or such
other URL that Original Contributor may designate from time to time.

32. "*Reformatted Specifications*" means any revision to the
Specifications which translates or reformats the Specifications (as for
example in connection with Your documentation) but which does not alter,
subset or superset * *the functional or operational aspects of the
Specifications.

33. "*Research Use*" means use and distribution of Covered Code only for
Your Personal Use, research or development use and expressly excludes
Internal Deployment Use and Commercial Use. Research Use also includes
use of Covered Code to teach individuals how to use Covered Code.

34. "*Shared Modifications*" means Modifications that You distribute or
use for a Commercial Use, in addition to any Modifications provided by
You, at Your option, pursuant to Section 2.2, or received by You from a
Contributor pursuant to Section 2.3.

35. "*Source Code*" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus any
associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.

36. "*Specifications*" means the specifications for the Technology and
other documentation, as designated on the Community Web Server, as may
be revised by Original Contributor from time to time.

37. "*Trademarks*" means Original Contributor's trademarks and logos,
including, but not limited to, RealNetworks, RealAudio, RealVideo,
RealOne, RealSystem, SureStream, Helix, Helix DNA and other trademarks
whether now used or adopted in the future.

38. "*Technology*" means the technology described in Attachment B, and
Upgrades.

39. "*Technology Compatibility Kit"* or *"TCK*" means the test programs,
procedures, acceptance criteria and/or other requirements, designated by
Original Contributor for use in verifying compliance of Covered Code
with the Specifications, in conjunction with the Original Code and
Upgraded Code. Original Contributor may, in its sole discretion and from
time to time, revise a TCK to correct errors and/or omissions and in
connection with Upgrades.

40. "*Upgrade(s)"* means new versions of Technology designated
exclusively by Original Contributor as an "Upgrade" and released by
Original Contributor from time to time under the terms of the License.

41. "*Upgraded Code*" means the Source Code and/or Executables for
Upgrades, possibly including Modifications made by Contributors.

42. *"User's Guide"* means the users guide for the TCK which Original
Contributor makes available to You to provide direction in how to run
the TCK and properly interpret the results, as may be revised by
Original Contributor from time to time.

43. "*You(r)*" means an individual, or a legal entity acting by and
through an individual or individuals, exercising rights either under
this License or under a future version of this License issued pursuant
to Section 4.1. For legal entities, "You(r)" includes any entity that by
majority voting interest controls, is controlled by, or is under common
control with You.

44. "*Your Products*" means any (i) hardware products You distribute
integrating the Covered Code; (ii) any software products You distribute
with the Covered Code that utilize the APIs of the Covered Code; or
(iii) any services You provide using the Covered Code.


  ATTACHMENT A

REQUIRED NOTICES


    ATTACHMENT A-1

REQUIRED IN ALL CASES

Notice to be included in header file of all Error Corrections and Shared
Modifications:

Portions Copyright 1994-2003 © RealNetworks, Inc. All rights reserved.

The contents of this file, and the files included with this file, are
subject to the current version of RealNetworks Community Source License
Version 1.1 (the "License"). You may not use this file except in
compliance with the License executed by both You and RealNetworks. You
may obtain a copy of the License at *
https://www.helixcommunity.org/content/rcsl.* You may also obtain a copy
of the License by contacting RealNetworks directly. Please see the
License for the rights, obligations and limitations governing use of the
contents of the file.

This file is part of the Helix DNA technology. RealNetworks, Inc., is
the developer of the Original code and owns the copyrights in the
portions it created.

This file, and the files included with this file, are distributed on an
'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.

Contributor(s):

_______________________________________________

Technology Compatibility Kit Test Suite(s) Location:

________________________________


    ATTACHMENT A-2

SAMPLE LICENSEE CERTIFICATION

"By clicking the `Agree' button below, You certify that You are a
Licensee in good standing under the RealNetworks Community Source
License, ("License") and that Your access, use and distribution of code
and information You may obtain at this site is subject to the License.
If You are not a Licensee under the RealNetworks Community Source
License You agree not to download, copy or use the Helix DNA technology.


    ATTACHMENT A-3

REQUIRED STUDENT NOTIFICATION

"This software and related documentation has been obtained by Your
educational institution subject to the RealNetworks Community Source
License. You have been provided access to the software and related
documentation for use only in connection with your course work and
research activities as a matriculated student of Your educational
institution. Any other use is expressly prohibited.

THIS SOFTWARE AND RELATED DOCUMENTATION CONTAINS PROPRIETARY MATERIAL OF
REALNETWORKS, INC, WHICH ARE PROTECTED BY VARIOUS INTELLECTUAL PROPERTY
RIGHTS.

You may not use this file except in compliance with the License. You may
obtain a copy of the License on the web at
https://www.helixcommunity.org/content/rcsl.

*
*


  ATTACHMENT B

Description of Technology

Helix DNA, which consists of Helix DNA Client, Helix DNA Server and
Helix DNA Producer.

Description of "Technology"

Helix DNA Technology v1.0 as described on the Community Web Server.


  ATTACHMENT C

TECHNOLOGY COMPATIBILITY KIT LICENSE

The following license is effective for the *Helix DNA* Technology
Compatibility Kit - as described on the Community Web Server. The
Technology Compatibility Kit(s) for the Technology specified in
Attachment B may be accessed at the Community Web Server.

1. TCK License.

1.1 Grants to use TCK

Subject to the terms and restrictions set forth below and the
RealNetworks Community Source License, and the Research Use license,
Original Contributor grants to You a worldwide, non-exclusive,
non-transferable license, to the extent of Original Contributor's
Intellectual Property Rights in the TCK (without the right to
sublicense), to use the TCK to develop and test Covered Code.

1.2 TCK Use Restrictions.

You are not authorized to create derivative works of the TCK or use the
TCK to test any implementation of the Specification that is not Covered
Code. You may not publish Your test results or make claims of
comparative compatibility with respect to other implementations of the
Specification. In consideration for the license grant in Section 1.1
above You agree not to develop Your own tests that are intended to
validate conformation with the Specification.

2. Test Results.

You agree to provide to Original Contributor or the third party test
facility if applicable, Your test results that demonstrate that Covered
Code is Compliant Covered Code and that Original Contributor may publish
or otherwise distribute such test results.

PLEASE READ THE TERMS OF THIS LICENSE CAREFULLY. BY CLICKING ON THE
"ACCEPT" BUTTON BELOW YOU ARE ACCEPTING AND AGREEING TO THE TERMS AND
CONDITIONS OF THIS LICENSE WITH THE ORIGINAL CONTRIBUTOR, REALNETWORKS,
INC. IF YOU ARE AGREEING TO THIS LICENSE ON BEHALF OF A COMPANY, YOU
REPRESENT THAT YOU ARE AUTHORIZED TO BIND THE COMPANY TO SUCH A LICENSE.
WHETHER YOU ARE ACTING ON YOUR OWN BEHALF, OR REPRESENTING A COMPANY,
YOU MUST BE OF MAJORITY AGE AND BE OTHERWISE COMPETENT TO ENTER INTO
CONTRACTS. IF YOU DO NOT MEET THIS CRITERIA OR YOU DO NOT AGREE TO ANY
OF THE TERMS AND CONDITIONS OF THIS LICENSE, CLICK ON THE REJECT BUTTON
TO EXIT.

*ACCEPT / REJECT
*

*
*

*To agree to the R&D/academic terms of this license, please register
 on the site --
you will then be given a chance to agree to the clickwrap RCSL

R&D License

and gain access to the RCSL-licensed source code.  To build or deploy
commercial applications based on the RCSL, you will need to agree to the
Commercial Use license attachments
*




--- NEW FILE: unix.pcf ---
# ***** BEGIN LICENSE BLOCK *****  
# Source last modified: $Id: unix.pcf,v 1.1 2005/06/08 18:01:06 rishimathew Exp $ 
#   
# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
#       
# The contents of this file, and the files included with this file, 
# are subject to the current version of the RealNetworks Public 
# Source License (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the current version of the RealNetworks Community 
# Source License (the "RCSL") available at 
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL 
# will apply. You may also obtain the license terms directly from 
# RealNetworks.  You may not use this file except in compliance with 
# the RPSL or, if you have a valid RCSL with RealNetworks applicable 
# to this file, the RCSL.  Please see the applicable RPSL or RCSL for 
# the rights, obligations and limitations governing use of the 
# contents of the file. 
#   
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the 
# portions it created. 
#   
# This file, and the files included with this file, is distributed 
# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY 
# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS 
# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES 
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET 
# ENJOYMENT OR NON-INFRINGEMENT. 
#  
# Technology Compatibility Kit Test Suite(s) Location:  
#    http://www.helixcommunity.org/content/tck  
#  
# Contributor(s):  
#   
# ***** END LICENSE BLOCK ***** 

project.AddSources('unix/mmapbuf.cpp')


--- NEW FILE: win.pcf ---
# ***** BEGIN LICENSE BLOCK *****  
# Source last modified: $Id: win.pcf,v 1.1 2005/06/08 18:01:06 rishimathew Exp $ 
#   
# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
#       
# The contents of this file, and the files included with this file, 
# are subject to the current version of the RealNetworks Public 
# Source License (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the current version of the RealNetworks Community 
# Source License (the "RCSL") available at 
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL 
# will apply. You may also obtain the license terms directly from 
# RealNetworks.  You may not use this file except in compliance with 
# the RPSL or, if you have a valid RCSL with RealNetworks applicable 
# to this file, the RCSL.  Please see the applicable RPSL or RCSL for 
# the rights, obligations and limitations governing use of the 
# contents of the file. 
#   
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the 
# portions it created. 
#   
# This file, and the files included with this file, is distributed 
# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY 
# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS 
# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES 
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET 
# ENJOYMENT OR NON-INFRINGEMENT. 
#  
# Technology Compatibility Kit Test Suite(s) Location:  
#    http://www.helixcommunity.org/content/tck  
#  
# Contributor(s):  
#   
# ***** END LICENSE BLOCK ***** 
project.AddIncludes('../include/win')

--- NEW FILE: asncfobj.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: asncfobj.cpp,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
[...2333 lines suppressed...]
{
    size_t i = 0;
    while (i < ulSrcLen)
    {
        if (src[i] == WRONG_OS_SEPARATOR_CHAR)
            dest[i] = OS_SEPARATOR_CHAR;
        else
            dest[i] = src[i];
        i++;
    }
    dest[i] = 0;

    return HXR_OK;
}

STDMETHODIMP_(UINT32)
AsyncFileObject::IsThreadSafe()
{
    return HX_THREADSAFE_METHOD_FS_READ;
}

--- NEW FILE: asncfsys.cpp ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: asncfsys.cpp,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#define INITGUID    1

#ifdef _UNIX
#include 
#endif // _UNIX

#ifdef _LINUX
#  include 
#  if !defined(__USE_BSD)
#    define __USE_BSD
#  endif
#  include 
#endif // _LINUX

#if defined _SOLARIS || defined _LINUX
#  include  // for uname
#endif // _SOLARIS || _LINUX

#include "hxcom.h"
#include "hxtypes.h"
#include "asncfsys.ver"
#include "platform_config.h"

//#include 
#include 

#include "hxfiles.h"
#include "hxplugn.h"
#include "hxprefs.h"
#include "hxmon.h"
#include "hxengin.h"
#include "debug.h"
#include "hxspriv.h"
#include "datffact.h"
#include "hxauthn.h"
#include "ihxpckts.h"
#include "hxccf.h"
#include "hxcomm.h"
#include "microsleep.h"
#include "servlist.h"
#include "intrpm.h"

#undef INITGUID

#include "hxathsp.h"

#include "hxver.h"

#if defined (_WINDOWS ) || defined (_WIN32)
#    include 
#endif

#ifdef _WIN32
//#    include "winfile.h"
#endif

#ifdef _AIX
#include "hxtbuf.h"
#include "dllpath.h"
ENABLE_MULTILOAD_DLLACCESS_PATHS(Asncfsys);
#endif

#include "hxerror.h"

IMalloc*       pAsncFSysIMalloc = 0;

#include "asncfsys.h"
#include "asncwrkr.h"
#include "asncfobj.h"
#include "wrkrrqst.h"
#include "qcheck.h"

#ifdef _DEBUG
#    undef HX_THIS_FILE		
static char HX_THIS_FILE[] = __FILE__;
#endif

#include 

const char* AsyncFileSystem::zm_pDescription =
    "RealNetworks Network Optimized File System";
const char* AsyncFileSystem::zm_pCopyright   = HXVER_COPYRIGHT;
const char* AsyncFileSystem::zm_pMoreInfoURL = HXVER_MOREINFO;
const char* AsyncFileSystem::zm_pShortName   = "pn-network";
const char* AsyncFileSystem::zm_pProtocol    = "file";
INT32       AsyncFileSystem::m_nPluginRefCount  = 0;

#ifdef _WIN32
static const size_t THREAD_POOL_START_SIZE = 1;
#else
static const size_t THREAD_POOL_START_SIZE = 5;
#endif // _WIN32


#if defined(_SOLARIS) || (defined(__GNUC__) && __GNUC__>2)
//
// need to define placement new on some platforms for some reason
//
void*
operator new(size_t size, void* ptr)
{
    return ptr;
}
#endif // _SOLARIS || ...

#ifndef _STATICALLY_LINKED
#ifndef _SERVER_RUNTIME
void*
operator new(size_t size)
{
    return pAsncFSysIMalloc->Alloc(size);
}

void
operator delete(void* ptr)
{
    pAsncFSysIMalloc->Free(ptr);
}
#endif //_STATICALLY_LINKED
#endif

/////////////////////////////////////////////////////////////////////////////
// Main classes
/////////////////////////////////////////////////////////////////////////////

/****************************************************************************
 * 
 *  Function:
 * 
 *	HXCreateInstance()
 * 
 *  Purpose:
 * 
 *	Function implemented by all plugin DLL's to create an instance of 
 *	any of the objects supported by the DLL. This method is similar to 
 *	Window's CoCreateInstance() in its purpose, except that it only 
 *	creates objects from this plugin DLL.
 *
 *	NOTE: Aggregation is never used. Therefore and outer unknown is
 *	not passed to this function, and you do not need to code for this
 *	situation.
 * 
 */
STDAPI
ENTRYPOINT(HXCreateInstance)(IUnknown** ppIUnknown)
{
    // Do NOT check for expiration.  Needed for Auto Upgrade.
    
#ifndef _SERVER_RUNTIME

    //
    // XXXtbradley calling malloc/placement new here is a hack since we've
    // redefined regular new to use pAsncFSysIMalloc which isn't
    // usable until after InitPlugin is called
    //
    void* ptr = malloc(sizeof(AsyncFileSystem));
    *ppIUnknown = (IHXPlugin*) new (ptr) AsyncFileSystem;

#else

    *ppIUnknown = (IHXPlugin*)new AsyncFileSystem;

#endif // _SERVER_RUNTIME

    if (*ppIUnknown)
    {
	(*ppIUnknown)->AddRef();
	return HXR_OK;
    }
    return HXR_OUTOFMEMORY;
}

/****************************************************************************
 * 
 *  Function:
 * 
 *	CanUnload()
 * 
 *  Purpose:
 * 
 *	Function implemented by all plugin DLL's if it returns HXR_OK 
 *	then the pluginhandler can unload the DLL
 *
 */
STDAPI
ENTRYPOINT(CanUnload)(void)
{
#if 1
    return HXR_FAIL; // never unload
#else
    return AsyncFileSystem::PluginRefCount() ? HXR_FAIL : HXR_OK;
#endif
}

inline INT32
AsyncFileSystem::PluginRefCount(void)
{
    return AsyncFileSystem::m_nPluginRefCount;
}

/****************************************************************************
 * 
 *  Function:
 * 
 *	HXShutdown()
 * 
 *  Purpose:
 * 
 *	Function implemented by all plugin DLL's to free any *global* 
 *	resources. This method is called just before the DLL is unloaded.
 *
 */
STDAPI
ENTRYPOINT(HXShutdown)(void)
{
    return HXR_OK;
}

AsyncFileSystem::AsyncFileSystem()
    : m_lRefCount(0)
    , m_pContext(0)
    , m_pOptions(NULL)
    , m_ulMaxIterationLevel(MAX_ITERATION_COUNT)
    , m_bEnableFileLocking(FALSE)
    , m_pBasePath(0)
    , m_pErrorMessages(0)
    , m_ulWorkerCount(0)
    , m_pClassFactory(0)
    , m_pFastFileFactory(0)
    , m_bEnableFastFile(TRUE)
    , m_bCheckVersionOnRead(FALSE)
    , m_ulSectorAlignment(0)
    , m_bEnableIOTiming(0)
    , m_ulMaxWorkers(0)
    , m_ulWorkers(THREAD_POOL_START_SIZE)
    , m_ulMaxQueueLength(1)
    , m_ulFailureLevel(3)
    , m_ulCheckInterval(3)
    , m_pScheduler(0)
{
    // set read alignment option default value based on
    // the platform's support for DMA over nfs (this is all overridable in
    // the config file)
#if defined _WIN32

    m_bAlignReads = TRUE;
    m_bDisableMemoryMappedIO = TRUE;

#elif defined _SOLARIS

    // use uname to determine whether the os version is high enough to support
    // DMA over NFS
    struct utsname info;
    if (uname(&info) < 0)
    {
        perror("E: pn-network failed to get OS version.  "
               "Read alignment defaulting to disabled");
        m_bAlignReads = FALSE;
    }
    else
    {
        atof(info.release) >= 5.8 ? m_bAlignReads = TRUE : m_bAlignReads = FALSE;
    }

    m_bDisableMemoryMappedIO = TRUE;

#else

    m_bAlignReads = FALSE;
    m_bDisableMemoryMappedIO = TRUE;

#endif // _WIN32

    AddPluginRef();
}

AsyncFileSystem::~AsyncFileSystem()
{
    RemovePluginRef();
    HX_RELEASE(m_pContext);
    HX_RELEASE(m_pOptions);
    HX_RELEASE(m_pBasePath);
    HX_RELEASE(m_pClassFactory);
    HX_RELEASE(m_pFastFileFactory);
}

void
AsyncFileSystem::AddPluginRef()
{
    m_nPluginRefCount++;
}

void
AsyncFileSystem::RemovePluginRef()
{
    m_nPluginRefCount--;
}

/************************************************************************
 *  Method:
 *    IHXPlugin::InitPlugin
 *  Purpose:
 *    Initializes the plugin for use. This interface must always be
 *    called before any other method is called. This is primarily needed 
 *    so that the plugin can have access to the context for creation of
 *    IHXBuffers and IMalloc.
 */
STDMETHODIMP
AsyncFileSystem::InitPlugin(IUnknown* pContext)
{
    if (m_pContext)
    {
        return HXR_UNEXPECTED;
    }

    if (!pContext)
    {
        return HXR_INVALID_PARAMETER;
    }

    m_pContext = pContext;
    m_pContext->AddRef();

    if (m_pContext->QueryInterface(
            IID_IHXErrorMessages, (void**)&m_pErrorMessages) != HXR_OK)
    {
        return HXR_FAIL;
    }

    if (m_pContext->QueryInterface(
        IID_IMalloc, (void**)&pAsncFSysIMalloc) != HXR_OK)
    {
        m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK,
                                 "could not get IMalloc", NULL);
        return HXR_FAIL;
    }

    if (m_pContext->QueryInterface(
        IID_IHXFastAlloc, (void**)&m_pFMalloc) != HXR_OK)
    {
        m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK,
                                 "could not get IHXFastMalloc", NULL);
        return HXR_FAIL;
    }

    if (m_pContext->QueryInterface(
            IID_IHXCommonClassFactory, (void**)&m_pClassFactory) != HXR_OK)
    {
        m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK,
                                 "could not get IHXCommonClassFactory", NULL);
        return HXR_FAIL;
    }

    if (m_pClassFactory->CreateInstance(CLSID_IHXFastFileFactory2, 
					(void**)&m_pFastFileFactory) != HXR_OK)
    {
        m_pErrorMessages->Report(HXLOG_DEBUG, HXR_FAIL, HXR_OK,
                                 "could not get IHXFastFileFactory", NULL);
	// Not fatal, continue
    }

    IHXRegistry* pReg = NULL;
    if (m_pContext->QueryInterface(IID_IHXRegistry,
                                   (void**)&pReg) != HXR_OK)
    {
	m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK, 
                                 "could not get IHXRegistry", NULL);
        return HXR_UNEXPECTED;
    }

    pReg->Release();

    if (!m_pOptions ||
        m_pOptions->GetPropertyBuffer("BasePath", m_pBasePath) != HXR_OK)
    {
        IHXPreferences* prefs;
        if (pContext->QueryInterface(
                IID_IHXPreferences, (void**)&prefs) != HXR_OK)
        {
            m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK, 
                                     "could not get IHXPreferences", NULL);
            return HXR_UNEXPECTED;
        }            
        prefs->ReadPref("BasePath", m_pBasePath);
        prefs->Release();
    }

    IHXGetRecursionLevel* pGet;
    if (pContext->QueryInterface(
            IID_IHXGetRecursionLevel, (void**)&pGet) != HXR_OK)
    {
        m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK, 
                                 "could not get IHXPreferences", NULL);
        return HXR_UNEXPECTED;
    }

    if (pContext->QueryInterface(IID_IHXThreadSafeScheduler,
                                (void**)&m_pScheduler) != HXR_OK)
    {
        
        m_pErrorMessages->Report(HXLOG_ERR, HXR_FAIL, HXR_OK, 
                                 "could not get IHXThreadSafeScheduler", NULL);
    }

    m_ulMaxIterationLevel = pGet->GetRecursionLevel();
    pGet->Release();

    return HXR_OK;
}

/************************************************************************
 *  Method:
 *    IHXPlugin::GetPluginInfo
 *  Purpose:
 *    Returns the basic information about this plugin. Including:
 *
 *    unInterfaceCount	the number of standard RMA interfaces 
 *			supported by this plugin DLL.
 *    pIIDList		array of IID's for standard RMA interfaces
 *			supported by this plugin DLL.
 *    bLoadMultiple	whether or not this plugin DLL can be loaded
 *			multiple times. All File Formats must set
 *			this value to TRUE.
 *    pDescription	which is used in about UIs (can be NULL)
 *    pCopyright	which is used in about UIs (can be NULL)
 *    pMoreInfoURL	which is used in about UIs (can be NULL)
 */
STDMETHODIMP
AsyncFileSystem::GetPluginInfo(REF(BOOL)        bLoadMultiple,
                               REF(const char*) pDescription,
                               REF(const char*) pCopyright,
                               REF(const char*) pMoreInfoURL,
                               REF(ULONG32)     ulVersionNumber)
{
    bLoadMultiple = TRUE;

    pDescription    = zm_pDescription;
    pCopyright	    = zm_pCopyright;
    pMoreInfoURL    = zm_pMoreInfoURL;
    ulVersionNumber = TARVER_ULONG32_VERSION;

    return HXR_OK;
}


// *** IUnknown methods ***

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::QueryInterface
//  Purpose:
//	Implement this to export the interfaces supported by your 
//	object.
//
STDMETHODIMP
AsyncFileSystem::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
	AddRef();
	*ppvObj = this;
	return HXR_OK;
    }

    if (IsEqualIID(riid, IID_IHXPlugin))
    {
	AddRef();
	*ppvObj = (IHXPlugin*)this;
	return HXR_OK;
    }

    if (IsEqualIID(riid, IID_IHXFileSystemObject))
    {
	AddRef();
	*ppvObj = (IHXFileSystemObject*)this;
	return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::AddRef
//  Purpose:
//	Everyone usually implements this the same... feel free to use
//	this implementation.
//
STDMETHODIMP_(ULONG32)
AsyncFileSystem::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::Release
//  Purpose:
//	Everyone usually implements this the same... feel free to use
//	this implementation.
//
STDMETHODIMP_(ULONG32)
AsyncFileSystem::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

#ifndef _SERVER_RUNTIME

    // see HXCreateInstance
    this->~AsyncFileSystem();
    free(this);

#else

    delete this;

#endif // _SERVER_RUNTIME

    return 0;
}

STDMETHODIMP
AsyncFileSystem::GetFileSystemInfo(REF(const char*) pShortName,
                                   REF(const char*) pProtocol)
{
    pShortName	= zm_pShortName;
    pProtocol	= zm_pProtocol;

    return HXR_OK;
}

STDMETHODIMP
AsyncFileSystem::InitFileSystem(IHXValues* pOptions)
{
    m_pOptions = pOptions;
    if (!m_pOptions)
    {
        return HXR_OK;
    }
    m_pOptions->AddRef();

    if (m_pOptions->GetPropertyBuffer("BasePath", m_pBasePath) != HXR_OK)
    {
        // log an error
        return HXR_FAIL;
    }

    ULONG32 ulTemp = 0;
    m_pOptions->GetPropertyULONG32("LogOptionalParams",
                                  ulTemp);
    BOOL bLog = (BOOL)ulTemp;

#ifdef _UNIX
    m_ulPageSize = sysconf(_SC_PAGESIZE);
#endif // _UNIX

    ulTemp = 0;
    m_pOptions->GetPropertyULONG32("EnableFileLocking",
                                  ulTemp);
    m_bEnableFileLocking = (BOOL)ulTemp;

    ulTemp = 0;
    m_pOptions->GetPropertyULONG32("MaxIterationLevel", ulTemp);
    if (ulTemp)
    {
        m_ulMaxIterationLevel = ulTemp;
    }

    ulTemp = 0;
    if (m_pOptions->GetPropertyULONG32("AlignReads", ulTemp) == HXR_OK)
    {
        if (ulTemp)
        {
            m_bAlignReads = TRUE;
        }
        else
        {
            m_bAlignReads = FALSE;
            m_bDisableMemoryMappedIO = TRUE;
        }
    }

#if defined PTHREADS_SUPPORTED || defined _LINUX
    ulTemp = 0;
    if (m_pOptions->GetPropertyULONG32("DisableMemoryMappedIO", ulTemp)
        == HXR_OK)
    {
        m_bDisableMemoryMappedIO = (BOOL)ulTemp;
        if (!m_bDisableMemoryMappedIO)
            m_bAlignReads = TRUE;
    }
#endif // PTHREADS_SUPPORTED

    ulTemp = 0;
    if (m_pOptions->GetPropertyULONG32("EnableIOTiming", ulTemp) == HXR_OK)
    {
        m_bEnableIOTiming = (BOOL)ulTemp;
    }

    ulTemp = 0;
    if (m_pOptions->GetPropertyULONG32("InitialWorkers", ulTemp) == HXR_OK)
    {
        m_ulWorkers = (long)ulTemp;
    }

    ulTemp = 0;
    if (m_pOptions->GetPropertyULONG32("MaxWorkers", ulTemp) == HXR_OK)
    {
        m_ulMaxWorkers = ulTemp;
    }

    ulTemp = 0;
    if (m_pOptions->GetPropertyULONG32("MaxQueueLength", ulTemp) == HXR_OK)
    {
        m_ulMaxQueueLength = ulTemp;
    }

    ulTemp = 0;
    if (m_pOptions->GetPropertyULONG32("FailureLevel", ulTemp) == HXR_OK)
    {
        m_ulFailureLevel = ulTemp;
    }
    
    ulTemp = 0;
    if (m_pOptions->GetPropertyULONG32("CheckInterval", ulTemp) == HXR_OK)
    {
        m_ulCheckInterval = ulTemp;
    }

#if defined _WIN32 || defined _SOLARIS || defined PTHREADS_SUPPORTED || defined _LINUX
    // on windows we need to calculate the sector alignment
    // size if we're aligning reads, on solaris it's (supposedly) always 512
    // on linux 2.4 we use the fs reported block size
    if (m_bAlignReads)
    {
#ifdef PTHREADS_SUPPORTED
        m_ulSectorAlignment = m_ulPageSize;
#elif defined _SOLARIS
        m_ulSectorAlignment = 512;
#elif defined _LINUX
        struct statfs info;
        if (statfs((const char*)m_pBasePath->GetBuffer(), &info) < 0)
        {
            size_t len = m_pBasePath->GetSize() + 256;
            char* errmsg = new char[len];
            snprintf(errmsg, len,
                     "E: failed to get filesystem information for %s",
                     m_pBasePath->GetBuffer());
            perror(errmsg);
            delete[] errmsg;
            m_bAlignReads = FALSE;
            m_ulSectorAlignment = 0;
        }
        else
        {
            m_ulSectorAlignment = info.f_bsize;
        }
#else
        DWORD ulSectorsPerCluster, ulBytesPerSector, ulFreeClusters,
            ulNumClusters;

        char* rootDir = 0;
        char* slashIndex = strchr((const char*)m_pBasePath->GetBuffer(), '/');
        if (!slashIndex)
            slashIndex = strchr((const char*)m_pBasePath->GetBuffer(), '\\');

        // if we didn't find a separator char, NULL tells windows
        // to use the current directory
        if (slashIndex)
        {
            size_t length = slashIndex - (char*)m_pBasePath->GetBuffer() + 1;
            char temp[256];
            rootDir = temp;
            strncpy(rootDir, (const char*)m_pBasePath->GetBuffer(), length);
            rootDir[length] = '\0';
        }

        if (!GetDiskFreeSpace(rootDir, &ulSectorsPerCluster,
                              &ulBytesPerSector, &ulFreeClusters, &ulNumClusters))
        {
            printf("pn-network: unable to determine sector size alignment, "
                   "disabling AlignReads");
            fflush(stdout);
            m_bAlignReads = FALSE;
        }
        else
        {
            m_ulSectorAlignment = ulBytesPerSector;
        }
#endif // PTHREADS_SUPPORTED
    }
#endif // _WIN32 || _SOLARIS || PTHREADS_SUPPORTED

    ulTemp = 0;
    m_pOptions->GetPropertyULONG32("CheckVersionOnRead", ulTemp);
    if (ulTemp)
    {
        m_bCheckVersionOnRead = TRUE;
    }

    if (m_pOptions->GetPropertyULONG32("EnableFastFile", ulTemp) == HXR_OK)
    {
	m_bEnableFastFile = (BOOL)ulTemp;
    }
    if (!m_pFastFileFactory) m_bEnableFastFile = FALSE;

    if (m_pOptions->GetPropertyULONG32("FastFileBlockSize", ulTemp) == HXR_OK)
    {
        m_ulFastFileBlockSize = ulTemp;
    }
    else
    {
        m_ulFastFileBlockSize = 4 * 1024;
    }

    if (m_pOptions->GetPropertyULONG32("FastFileMaxBlockSize", ulTemp) == HXR_OK)
    {
        m_ulFastFileMaxBlockSize = ulTemp;
    }
    else
    {
        m_ulFastFileMaxBlockSize = 512 * 1024;
    }

    //
    // create the starting thread pool
    //
    if (!m_ulMaxWorkers)
        m_ulMaxWorkers = (m_ulWorkers < 25 ? 25 : m_ulWorkers);

    //
    // the server runs this function twice, once before the plugin is
    // initialized so we don't want to do the rest until this function
    // is run after it is initialized
    //
    if (!m_pContext)
        return HXR_OK;

    m_pWorkers = new AsyncFSysWorker*[m_ulMaxWorkers];
    for (size_t i = 0; i < (size_t)m_ulWorkers; i++)
    {
        m_pWorkers[i] = new AsyncFSysWorker(m_pContext, this,
                                            "Async Filesystem Worker",
                                             m_bEnableIOTiming);
        m_pWorkers[i]->Start();
    }

#ifndef _WIN32
    //
    // on windows this code isn't necessary as our callbacks use io completion
    // ports
    //

    //
    // create callback used to check queue lengths
    //
    IHXCallback* pQueueLengthCB = new CheckQueueLengthCB(m_pWorkers,
                                                          m_ulMaxWorkers,
                                                          m_ulMaxQueueLength,
                                                          m_ulFailureLevel,
                                                          m_ulCheckInterval,
                                                          &m_ulWorkers,
                                                          m_bEnableIOTiming,
                                                          m_pScheduler,
                                                          m_pErrorMessages,
                                                          m_pContext,
                                                          this);
    m_pScheduler->RelativeEnter(pQueueLengthCB, m_ulCheckInterval * 1000);
#endif // _WIN32

    if (!bLog)
    {
        return HXR_OK;
    }

    char pNumericMount[50];
    IHXBuffer* pBuffer = 0;
    const char* pMount;
    m_pOptions->GetPropertyCString("MountPoint", pBuffer);
    if (!pBuffer)
    {
        m_pOptions->GetPropertyBuffer("MountPoint", pBuffer);
        if (!pBuffer)
        {
            m_pOptions->GetPropertyULONG32("MountPount", ulTemp);
        }
    }
    if (pBuffer)
    {
        pMount = (const char*)pBuffer->GetBuffer();
    }
    else
    {
        pMount = pNumericMount;
        sprintf(pNumericMount, "%lu", ulTemp);
    }

    printf("Optional asncfsys (pn-network) parameters for"
           " MountPoint: %s\n", pMount);
    HX_RELEASE(pBuffer);
    ulTemp = 0;

    fflush(stdout);

    return HXR_OK;
}

/*
 * AsyncFileSystem::GetWorker
 *
 * Description: returns workers round robin
 *
 * Returns: AsyncFSysWorker*
 *
 * Implementation: mod the count with the pool size
 */
AsyncFSysWorker*
AsyncFileSystem::GetWorker()
{
    m_ulWorkerCount++;
    return m_pWorkers[(m_ulWorkerCount % m_ulWorkers)];
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IHXFileSystemObject::CreateFile
//  Purpose:
//	TBD
//
STDMETHODIMP
AsyncFileSystem::CreateFile(IUnknown** ppFileObject)
{
    *ppFileObject = (IHXFileObject*) new AsyncFileObject(
        m_pBasePath, NULL, this, m_pContext, m_ulMaxIterationLevel, GetWorker(),
        m_pFMalloc, NULL, m_bAlignReads, m_bDisableMemoryMappedIO,
        m_bCheckVersionOnRead);

    if (*ppFileObject)
    {
	// wrap the sucker

	if (m_bEnableFastFile)
	{
	    IUnknown* pWrapper;
	    m_pFastFileFactory->Wrap(pWrapper, *ppFileObject,
                m_ulFastFileBlockSize, m_bAlignReads, FALSE, m_ulFastFileMaxBlockSize);
	    *ppFileObject = pWrapper;
	}
	else
	{
	    (*ppFileObject)->AddRef();
	}

        return HXR_OK;
    }

    return HXR_OUTOFMEMORY;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	AsyncFileSystem::CreateDir
//  Purpose:
//	TBD
//
STDMETHODIMP
AsyncFileSystem::CreateDir(IUnknown** ppDirObject)
{
    return HXR_NOTIMPL;
}


--- NEW FILE: asncfsys.ver ---
/* THIS FILE IS GENERATED BY THE BUILD SYSTEM -- DO NOT EDIT
 * Copyright (C) 1997-2002 RealNetworks Corporation. All rights reserved.
 */
#ifdef _MACINTOSH
#define TARVER_ULONG32_VERSION ((11<<28)|(0<<20)|(99<<12)|0)
#else
#define TARVER_ULONG32_VERSION (UINT32)((11L<<28L)|(0L<<20L)|(99L<< 12L)|0L)
#endif
#define TARVER_LIST_VERSION 11,0,99,0
#define TARVER_MAJOR_VERSION 11
#define TARVER_MINOR_VERSION 0
#define TARVER_STRING_VERSION "11.0.99.0"
#define TARVER_STR_BUILD_NAME ""

--- NEW FILE: Umakefil ---
# ***** BEGIN LICENSE BLOCK *****  
# Source last modified: $Id: Umakefil,v 1.1 2005/06/08 18:01:06 rishimathew Exp $ 
#   
# Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.  
#       
# The contents of this file, and the files included with this file, 
# are subject to the current version of the RealNetworks Public 
# Source License (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the current version of the RealNetworks Community 
# Source License (the "RCSL") available at 
# http://www.helixcommunity.org/content/rcsl, in which case the RCSL 
# will apply. You may also obtain the license terms directly from 
# RealNetworks.  You may not use this file except in compliance with 
# the RPSL or, if you have a valid RCSL with RealNetworks applicable 
# to this file, the RCSL.  Please see the applicable RPSL or RCSL for 
# the rights, obligations and limitations governing use of the 
# contents of the file. 
#   
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the 
# portions it created. 
#   
# This file, and the files included with this file, is distributed 
# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY 
# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS 
# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES 
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET 
# ENJOYMENT OR NON-INFRINGEMENT. 
#  
# Technology Compatibility Kit Test Suite(s) Location:  
#    http://www.helixcommunity.org/content/tck  
#  
# Contributor(s):  
#   
# ***** END LICENSE BLOCK ***** 

UmakefileVersion(2,1)


CPPSuffixRule()

project.AddModuleIncludes('common/include',
                          'common/runtime/pub',
                          'common/container/pub',
                          'common/fileio/pub',
                          'common/system/pub',
                          'common/util/pub',
                          'common/dbgtool/pub',
                          'common/netio/pub',
                          'common/lang/xml/pub',
                          'server/common/struct/pub',
                          'server/common/util/pub',
                          'server/common/netio/pub',
                          'server/engine/core/pub',
                          'server/context/pub',
                          'server/include')

project.AddSources('asncfsys.cpp',
                   'asncfobj.cpp',
		   'asncwrkr.cpp',
                   'asncbuf.cpp',
                   'qcheck.cpp')

project.AddModuleLibraries("server/common/util[servutillib]",
                           "server/common/struct[servstructlib]",
                           "common/dbgtool[debuglib]",
                           "common/system[syslib]",
                           "common/util[utillib]",
                           "common/container[contlib]",
                           "common/runtime[runtlib]",
                           "common/fileio[fileiolib]")

project.AddExportedFunctions('RMACreateInstance')

DLLTarget('asncfsys')

DependTarget()

--- NEW FILE: wrkrrqst.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: wrkrrqst.h,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef _WRKRRQST_H_
#define _WRKRRQST_H_

#include 

_INTERFACE IHXFileResponse;
_INTERFACE IHXDataFile;
_INTERFACE IHXFastAlloc;
_INTERFACE IHXBuffer;

class WorkerRequest : public HXListElem
{
public:
    WorkerRequest(AsyncFileObject* pFObj, MessengerCallback* pCallback);
    AsyncFileObject* GetFileObject();
    virtual ~WorkerRequest();

    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile) PURE;

protected:
    AsyncFileObject*   m_pFObj;
    MessengerCallback* m_pCallback;
};

class WorkerCloseRequest : public WorkerRequest
{
public:
    WorkerCloseRequest(FD_TYPE nFd, IHXBuffer* pName);
    ~WorkerCloseRequest();
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);

private:
    FD_TYPE m_nFd;
    IHXBuffer* m_pName;
};

class WorkerSeekRequest : public WorkerRequest
{
public:
    WorkerSeekRequest(AsyncFileObject* pFObj, ULONG32 ulOffset, BOOL bRelative);
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);

private:
    ULONG32 m_ulOffset;
    BOOL m_bRelative;
};

class WorkerInitRequest : public WorkerRequest
{
public:
    WorkerInitRequest(AsyncFileObject* pFObj,
                      ULONG32 ulFlags,
                      MessengerCallback* pCallback);
    ~WorkerInitRequest();
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);

private:
    ULONG32 m_ulFlags;
};

class WorkerReadRequest : public WorkerRequest
{
public:
    WorkerReadRequest(AsyncFileObject* pFObj,
                      MessengerCallback* pCallback,
                      ULONG32 ulCount,
                      ULONG32 ulOffset = 0);
    ~WorkerReadRequest();
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);

private:
    friend class AsyncFileObject;

    ULONG32 m_ulCount;
    char* m_pBuffer;
    ULONG32 m_ulOffset;
};

class WorkerWriteRequest : public WorkerRequest
{
public:
    WorkerWriteRequest(AsyncFileObject* pFObj, IHXBuffer* pBuffer);
    ~WorkerWriteRequest();
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);

private:
    IHXBuffer* m_pBuffer;
};

class WorkerMakeDirRequest : public WorkerRequest
{
public:
    WorkerMakeDirRequest(AsyncFileObject* pFObj, MessengerCallback *pCallback) : WorkerRequest(pFObj, pCallback) {}
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);
};

class WorkerReadDirRequest : public WorkerRequest
{
public:
    WorkerReadDirRequest(AsyncFileObject* pFObj, MessengerCallback *pCallback) : WorkerRequest(pFObj, pCallback) {}
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);
};

class WorkerCloseDirRequest : public WorkerRequest
{
public:
    WorkerCloseDirRequest(AsyncFileObject* pFObj, MessengerCallback *pCallback) : WorkerRequest(pFObj, pCallback) {}
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);
};

class WorkerStatRequest : public WorkerRequest
{
public:
    WorkerStatRequest(AsyncFileObject* pFObj,
                      MessengerCallback* pCallback);
    ~WorkerStatRequest();
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);
};

class WorkerDoesExistRequest : public WorkerRequest
{
public:
    WorkerDoesExistRequest(AsyncFileObject* pFObj,
                           IHXBuffer* pPath,
                           MessengerCallback* pCallback);
    ~WorkerDoesExistRequest();
    STDMETHOD(Execute) (THIS_ IHXInterPluginMessenger2* pMessenger, FILE* pTimingFile);

private:
    IHXBuffer* m_pPath;
};

#endif /* _WRKRRQST_H_ */

--- NEW FILE: asncbuf.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: asncbuf.h,v 1.1 2005/06/08 18:01:06 rishimathew Exp $
 *
 * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 *
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */


#ifndef _ASNCBUF_H_
#define _ASNCBUF_H_

class AsyncFSysBuffer : public IHXBuffer
{
public:
    AsyncFSysBuffer(void* pBuffer, size_t length, UINT32 ulOffset);
    ~AsyncFSysBuffer();

    // IUnknown methods
    STDMETHOD(QueryInterface)   (THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)  (THIS);
    STDMETHOD_(ULONG32,Release) (THIS);

    /*
     *  IHXBuffer methods
     */
    STDMETHOD(Get)             (THIS_ REF(UCHAR*) pData, REF(ULONG32) ulLength);
    STDMETHOD(Set)              (THIS_ const UCHAR* pData, ULONG32 ulLength);
    STDMETHOD(SetSize)          (THIS_ ULONG32 ulLength);
    STDMETHOD_(ULONG32,GetSize) (THIS);
    STDMETHOD_(UCHAR*,GetBuffer)(THIS);

private:
    INT32  m_lRefCount;
    void*  m_pBuffer;
    void*  m_pData;
    size_t m_ulDataLength;
};

#endif // _ASNCBUF_H_


From dcollins at helixcommunity.org  Wed Jun  8 18:01:03 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Wed Jun  8 18:01:05 2005
Subject: [Server-cvs] datatype/common/pktskim mp4skim.cpp,1.4,1.5
Message-ID: 

Update of /cvsroot/server/datatype/common/pktskim
In directory cvs:/tmp/cvs-serv27882

Modified Files:
	mp4skim.cpp 
Log Message:
fix build buster


Index: mp4skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/mp4skim.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mp4skim.cpp	7 Jun 2005 03:06:37 -0000	1.4
+++ mp4skim.cpp	9 Jun 2005 01:01:01 -0000	1.5
@@ -64,6 +64,7 @@
     BOOL        bGroupOfVop = FALSE;
     char        pszBits[500];
     int         nCount = 500;
+    BOOL        bLoopDone = FALSE;
 
     ulPacketInfo = 0;
 
@@ -109,8 +110,6 @@
 
     pIndex = pMP4Hdr;
 
-    BOOL    bLoopDone = FALSE;
-
     // there needs to be at least 5 bytes of data in order to be a VOP 
     // (4 byte start code + 1 byte coding type)
     while (!bLoopDone && !bKeyFrame && nIndex < nMP4Size - 5)


From dcollins at helixcommunity.org  Wed Jun  8 18:01:25 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Wed Jun  8 18:01:26 2005
Subject: [Server-cvs] broadcast/transport/rtp/recv qtstream.cpp,1.15,1.16
Message-ID: 

Update of /cvsroot/server/broadcast/transport/rtp/recv
In directory cvs:/tmp/cvs-serv28492

Modified Files:
	qtstream.cpp 
Log Message:
fix build-buster


Index: qtstream.cpp
===================================================================
RCS file: /cvsroot/server/broadcast/transport/rtp/recv/qtstream.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- qtstream.cpp	8 Jun 2005 18:54:00 -0000	1.15
+++ qtstream.cpp	9 Jun 2005 01:01:22 -0000	1.16
@@ -57,6 +57,7 @@
 #include "hxcomm.h"
 #include "hxengin.h"
 #include "ihxpckts.h"
+#include "bufnum.h"
 #include "rtpwrap.h"
 #include "pkthndlr.h"
 #include "tconverter.h" // CHXTimestampConverter


From 47dougal at absolutemotion.com  Thu Jun  9 02:07:25 2005
From: 47dougal at absolutemotion.com (Vanessa J. Smith)
Date: Thu Jun  9 02:18:48 2005
Subject: [Server-cvs] All software - duty-free prices
Message-ID: <806b01c56cd2$5194a78b$bd29086f@absolutemotion.com>

Skipped content of type multipart/alternative
From dcollins at helixcommunity.org  Thu Jun  9 06:59:16 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Thu Jun  9 06:59:17 2005
Subject: [Server-cvs] build/BIF SERVER_11_0_STABLE-helix.bif,1.5,1.6
Message-ID: 

Update of /cvsroot/server/build/BIF
In directory cvs:/tmp/cvs-serv11418

Modified Files:
	SERVER_11_0_STABLE-helix.bif 
Log Message:
fix build buster due to missing server_datatype_common_pktskim module dependency


Index: SERVER_11_0_STABLE-helix.bif
===================================================================
RCS file: /cvsroot/server/build/BIF/SERVER_11_0_STABLE-helix.bif,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- SERVER_11_0_STABLE-helix.bif	18 May 2005 21:12:57 -0000	1.5
+++ SERVER_11_0_STABLE-helix.bif	9 Jun 2005 13:59:09 -0000	1.6
@@ -10301,6 +10301,7 @@
         protocol_sdp
         protocol_rtsp
         protocol_common_util
+        server_datatype_common_pktskim
       
     
 


From dcollins at helixcommunity.org  Thu Jun  9 07:38:53 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Thu Jun  9 07:38:55 2005
Subject: [Server-cvs] datatype/common/pktskim mp4skim.cpp,1.1.2.3,1.1.2.4
Message-ID: 

Update of /cvsroot/server/datatype/common/pktskim
In directory cvs:/tmp/cvs-serv21420

Modified Files:
      Tag: SERVER_11_0_STABLE
	mp4skim.cpp 
Log Message:
fix build-busters


Index: mp4skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/mp4skim.cpp,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- mp4skim.cpp	7 Jun 2005 03:03:23 -0000	1.1.2.3
+++ mp4skim.cpp	9 Jun 2005 14:38:49 -0000	1.1.2.4
@@ -64,6 +64,7 @@
     BOOL        bGroupOfVop = FALSE;
     char        pszBits[500];
     int         nCount = 500;
+    BOOL        bLoopDone = FALSE;
 
     ulPacketInfo = 0;
 
@@ -109,8 +110,6 @@
 
     pIndex = pMP4Hdr;
 
-    BOOL    bLoopDone = FALSE;
-
     // there needs to be at least 5 bytes of data in order to be a VOP 
     // (4 byte start code + 1 byte coding type)
     while (!bLoopDone && !bKeyFrame && nIndex < nMP4Size - 5)
@@ -137,7 +136,7 @@
                  DebugOut((SKIM_DBG_PACKETIZER | SKIM_DBG_PACKETIZER_VERBOSE),
                     "MP4: video object plane, vop coding type=%u, key frame=%s\n",
                     codingType,
-                    codingType?'No':'Yes');
+                    codingType ? "No" : "Yes");
                 if (!uiRTPMarker) // if this bit is not set, it means no more vops or video planes here stop searching
                 {
                     bLoopDone = TRUE;
@@ -176,7 +175,7 @@
 
             DebugOut((SKIM_DBG_PACKETIZER | SKIM_DBG_PACKETIZER_VERBOSE),
                 "MP4: video plane with short header, picture coding type=%u, key frame=%s\n",
-                ubPictureCodingType?'No':'Yes');
+                ubPictureCodingType ? "No" : "Yes");
 
             if (!uiRTPMarker) // if this bit is not set, it means no more video planes or vops here stop searching
             {


From dcollins at helixcommunity.org  Thu Jun  9 07:40:49 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Thu Jun  9 07:40:51 2005
Subject: [Server-cvs] datatype/common/pktskim mp4skim.cpp,1.5,1.6
Message-ID: 

Update of /cvsroot/server/datatype/common/pktskim
In directory cvs:/tmp/cvs-serv23234

Modified Files:
	mp4skim.cpp 
Log Message:
fix build busters


Index: mp4skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/mp4skim.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mp4skim.cpp	9 Jun 2005 01:01:01 -0000	1.5
+++ mp4skim.cpp	9 Jun 2005 14:40:47 -0000	1.6
@@ -136,7 +136,7 @@
                  DebugOut((SKIM_DBG_PACKETIZER | SKIM_DBG_PACKETIZER_VERBOSE),
                     "MP4: video object plane, vop coding type=%u, key frame=%s\n",
                     codingType,
-                    codingType?'No':'Yes');
+                    codingType ? "No" : "Yes");
                 if (!uiRTPMarker) // if this bit is not set, it means no more vops or video planes here stop searching
                 {
                     bLoopDone = TRUE;
@@ -175,7 +175,7 @@
 
             DebugOut((SKIM_DBG_PACKETIZER | SKIM_DBG_PACKETIZER_VERBOSE),
                 "MP4: video plane with short header, picture coding type=%u, key frame=%s\n",
-                ubPictureCodingType?'No':'Yes');
+                ubPictureCodingType ? "No" : "Yes");
 
             if (!uiRTPMarker) // if this bit is not set, it means no more video planes or vops here stop searching
             {


From Takouh_1675 at fusionpr.com  Thu Jun  9 11:37:53 2005
From: Takouh_1675 at fusionpr.com (Takouhi Emerson)
Date: Thu Jun  9 11:38:07 2005
Subject: [Server-cvs] Speccial prop
Message-ID: 

Hello, 
he received a visit from Captain Blood, whom he greetedde Porto Rico.  He chose for his objective the island of Barbados,Don Miguel had behind him not only the authority of his own nation,M. d'Ogeron looked on, a man bemused, unable to surmise what theShe also bore two treasure-chests containing fifty thousand piecesThat betraying us so hastily retrieved completed Blood'sthe West Indies should render you a very valuable servant to HisWhen the Jamaica fleet put to sea some few days later, Lord Juliansafe.  Here you are in danger - in dreadful danger.way of Fortune.  It was also the way of Fortune that Don MiguelBy his peers?to be encouraged as a check upon the power and greed of Spain, whichguests during the careening and repairing of La Foudre.smoke his pipe and tend his geraniums on this evening of all - something towards which they were rapidly sailing over thebefore he could wrench it from her.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050609/7188b943/attachment.htm
From dcollins at helixcommunity.org  Thu Jun  9 12:02:50 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Thu Jun  9 12:02:52 2005
Subject: [Server-cvs] include platform_config.h,1.1,1.2
Message-ID: 

Update of /cvsroot/server/include
In directory cvs:/tmp/cvs-serv16347

Modified Files:
	platform_config.h 
Log Message:
move LINUX_EPOLL_SUPPORT to platform cf file


Index: platform_config.h
===================================================================
RCS file: /cvsroot/server/include/platform_config.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- platform_config.h	26 May 2005 20:46:58 -0000	1.1
+++ platform_config.h	9 Jun 2005 19:02:47 -0000	1.2
@@ -49,11 +49,6 @@
 #endif //SHARED_FD_SUPPORT
 #endif //_UNIX
 
-#if defined(_LINUX)
-#ifndef LINUX_EPOLL_SUPPORT
-#define LINUX_EPOLL_SUPPORT
-#endif //LINUX_EPOLL_SUPPORT
-
 #elif defined(_SOLARIS)
 #ifndef DEV_POLL_SUPPORT
 #define DEV_POLL_SUPPORT


From dcollins at helixcommunity.org  Thu Jun  9 12:08:38 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Thu Jun  9 12:08:40 2005
Subject: [Server-cvs] include platform_config.h,1.1.2.1,1.1.2.2
Message-ID: 

Update of /cvsroot/server/include
In directory cvs:/tmp/cvs-serv21767

Modified Files:
      Tag: SERVER_11_0_STABLE
	platform_config.h 
Log Message:
move LINUX_EPOLL_SUPPORT to platform cf


Index: platform_config.h
===================================================================
RCS file: /cvsroot/server/include/platform_config.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- platform_config.h	26 May 2005 20:51:29 -0000	1.1.2.1
+++ platform_config.h	9 Jun 2005 19:08:35 -0000	1.1.2.2
@@ -49,11 +49,6 @@
 #endif //SHARED_FD_SUPPORT
 #endif //_UNIX
 
-#if defined(_LINUX)
-#ifndef LINUX_EPOLL_SUPPORT
-#define LINUX_EPOLL_SUPPORT
-#endif //LINUX_EPOLL_SUPPORT
-
 #elif defined(_SOLARIS)
 #ifndef DEV_POLL_SUPPORT
 #define DEV_POLL_SUPPORT


From dcollins at helixcommunity.org  Thu Jun  9 13:13:13 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Thu Jun  9 13:13:15 2005
Subject: [Server-cvs] include platform_config.h,1.1.2.2,1.1.2.3
Message-ID: 

Update of /cvsroot/server/include
In directory cvs:/tmp/cvs-serv30500

Modified Files:
      Tag: SERVER_11_0_STABLE
	platform_config.h 
Log Message:
fix ifdef


Index: platform_config.h
===================================================================
RCS file: /cvsroot/server/include/platform_config.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- platform_config.h	9 Jun 2005 19:08:35 -0000	1.1.2.2
+++ platform_config.h	9 Jun 2005 20:13:09 -0000	1.1.2.3
@@ -49,7 +49,7 @@
 #endif //SHARED_FD_SUPPORT
 #endif //_UNIX
 
-#elif defined(_SOLARIS)
+#if defined(_SOLARIS)
 #ifndef DEV_POLL_SUPPORT
 #define DEV_POLL_SUPPORT
 #endif //DEV_POLL_SUPPORT


From dcollins at helixcommunity.org  Thu Jun  9 13:13:54 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Thu Jun  9 13:13:55 2005
Subject: [Server-cvs] include platform_config.h,1.2,1.3
Message-ID: 

Update of /cvsroot/server/include
In directory cvs:/tmp/cvs-serv31360

Modified Files:
	platform_config.h 
Log Message:
fix ifdef


Index: platform_config.h
===================================================================
RCS file: /cvsroot/server/include/platform_config.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- platform_config.h	9 Jun 2005 19:02:47 -0000	1.2
+++ platform_config.h	9 Jun 2005 20:13:52 -0000	1.3
@@ -49,7 +49,7 @@
 #endif //SHARED_FD_SUPPORT
 #endif //_UNIX
 
-#elif defined(_SOLARIS)
+#if defined(_SOLARIS)
 #ifndef DEV_POLL_SUPPORT
 #define DEV_POLL_SUPPORT
 #endif //DEV_POLL_SUPPORT


From atin at helixcommunity.org  Thu Jun  9 14:32:10 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Thu Jun  9 14:32:12 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp, 1.157.2.23.2.1,
	1.157.2.23.2.2
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv11688

Modified Files:
      Tag: SERVER_11_0_BETA2
	rtspserv.cpp 
Log Message:
Synopsis                                                                       
========                                                                       
Fixes PR 141699                                                                
                                                                               
the server was CAing inside RTSPServerProtocol::_FinishSetup() when it tried   
to dereference the peer addr object.                                           
                                                                               
                                                                               
Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, SERVER_CURRENT
Reviewed By: dlew, dcollins


Description                                                                    
===========                                                                    
it turns out that the peer addr is NULL for a particular socket and so when it 
gets dereferenced the server crashes. the peer addr is used by TNG UDP/Mcast   
and RTP/UDP transports for sending out data.                                   
                                                                               
the workaround is to kill the connection if the peer addr is NULL.             
                                                                               
what needs to investigated is how the peer addr of the socket got to b NULL.   
smells like memory corruption.                                                 
                                                                               
                                                                               
Files Affected                                                                 
==============                                                                 
server/protocol/rtsp/rtspserv.cpp                                              
                                                                               
                                                                               
Testing Performed                                                              
=================                                                              
Unit Tests:                                                                    
Ran a test on an uptime rig for a period of 10+ hours with a low load.         
                                                                               
Integration Tests:                                                             
none                                                                           
                                                                               
Leak Tests:                                                                    
none                                                                           
                                                                               
Performance Tests:                                                             
none                                                                           
                                                                               
Platforms Tested: sunos-5.8-sparc-server
Build verified: sunos-5.8-sparc-server                                         
                                                                               
                                                                               
QA Hints                                                                       
===============                                                                
RTSPServerProtocol::_FinishSetup() CAs should not happen during the course of  
uptime testing.


Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.23.2.1
retrieving revision 1.157.2.23.2.2
diff -u -d -r1.157.2.23.2.1 -r1.157.2.23.2.2
--- rtspserv.cpp	19 May 2005 14:22:55 -0000	1.157.2.23.2.1
+++ rtspserv.cpp	9 Jun 2005 21:32:07 -0000	1.157.2.23.2.2
@@ -2849,6 +2849,15 @@
     //we need to make sure the refcount of the address is exactly ONE, before we pass it into those
     // SetupTransport functions. Because we may need to call SetPort in those functions.
     IHXSockAddr* pSingleRefPeerAddr = NULL;
+    HX_ASSERT(pPeerAddr);
+    if (!pPeerAddr)
+    {
+	// XXXAAK: for some reason the peer addr is NULL for this socket,
+	// which might indicate a memory corruption. its too late in the
+	// release cycle to chase down the mem corruption, so this workaround.
+	HX_RELEASE(pSession);
+	return HXR_UNEXPECTED;
+    }
     pPeerAddr->Clone(&pSingleRefPeerAddr);
     HX_RELEASE(pPeerAddr);
 


From atin at helixcommunity.org  Thu Jun  9 15:33:56 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Thu Jun  9 15:33:57 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.157.2.25,1.157.2.26
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv11036

Modified Files:
      Tag: SERVER_11_0_STABLE
	rtspserv.cpp 
Log Message:
Synopsis
========
mirror from SERVER_11_0_BETA2 -- Fixes PR 141699

the server was CAing inside RTSPServerProtocol::_FinishSetup() when it tried
to dereference the peer addr object.


Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, SERVER_CURRENT
Reviewed By: dlew, dcollins


Description
===========
it turns out that the peer addr is NULL for a particular socket and so when it
gets dereferenced the server crashes. the peer addr is used by TNG UDP/Mcast
and RTP/UDP transports for sending out data.

the workaround is to kill the connection if the peer addr is NULL.

what needs to investigated is how the peer addr of the socket got to b NULL.
smells like memory corruption.


Files Affected
==============
server/protocol/rtsp/rtspserv.cpp


Testing Performed
=================
Unit Tests:
Ran a test on an uptime rig for a period of 10+ hours with a low load.

Integration Tests:
none

Leak Tests:
none

Performance Tests:
none

Platforms Tested: sunos-5.8-sparc-server
Build verified: sunos-5.8-sparc-server


QA Hints
===============
RTSPServerProtocol::_FinishSetup() CAs should not happen during the course of
uptime testing.



Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.25
retrieving revision 1.157.2.26
diff -u -d -r1.157.2.25 -r1.157.2.26
--- rtspserv.cpp	23 May 2005 01:37:09 -0000	1.157.2.25
+++ rtspserv.cpp	9 Jun 2005 22:33:53 -0000	1.157.2.26
@@ -2856,9 +2856,18 @@
         m_pSocket->GetPeerAddr(&pPeerAddr);
     }
 
-    //we need to make sure the refcount of the address is exactly ONE, before we pass it into those
+    // we need to make sure the refcount of the address is exactly ONE, before we pass it into those
     // SetupTransport functions. Because we may need to call SetPort in those functions.
     IHXSockAddr* pSingleRefPeerAddr = NULL;
+    HX_ASSERT(pPeerAddr);
+    if (!pPeerAddr)
+    {
+       // XXXAAK: for some reason the peer addr is NULL for this socket,
+       // which might indicate a memory corruption. its too late in the
+       // release cycle to chase down the mem corruption, so this workaround.
+       HX_RELEASE(pSession);
+       return HXR_UNEXPECTED;
+    }
     pPeerAddr->Clone(&pSingleRefPeerAddr);
     HX_RELEASE(pPeerAddr);
 


From atin at helixcommunity.org  Thu Jun  9 15:36:36 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Thu Jun  9 15:36:38 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.182,1.183
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv14659

Modified Files:
	rtspserv.cpp 
Log Message:
Synopsis
========
mirror from SERVER_11_0_BETA2 -- Fixes PR 141699

the server was CAing inside RTSPServerProtocol::_FinishSetup() when it tried
to dereference the peer addr object.


Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, SERVER_CURRENT
Reviewed By: dlew, dcollins


Description
===========
it turns out that the peer addr is NULL for a particular socket and so when it
gets dereferenced the server crashes. the peer addr is used by TNG UDP/Mcast
and RTP/UDP transports for sending out data.

the workaround is to kill the connection if the peer addr is NULL.

what needs to investigated is how the peer addr of the socket got to b NULL.
smells like memory corruption.


Files Affected
==============
server/protocol/rtsp/rtspserv.cpp


Testing Performed
=================
Unit Tests:
Ran a test on an uptime rig for a period of 10+ hours with a low load.

Integration Tests:
none

Leak Tests:
none

Performance Tests:
none

Platforms Tested: sunos-5.8-sparc-server
Build verified: sunos-5.8-sparc-server


QA Hints
===============
RTSPServerProtocol::_FinishSetup() CAs should not happen during the course of
uptime testing.



Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- rtspserv.cpp	23 May 2005 02:00:29 -0000	1.182
+++ rtspserv.cpp	9 Jun 2005 22:36:34 -0000	1.183
@@ -2858,6 +2858,15 @@
     //we need to make sure the refcount of the address is exactly ONE, before we pass it into those
     // SetupTransport functions. Because we may need to call SetPort in those functions.
     IHXSockAddr* pSingleRefPeerAddr = NULL;
+    HX_ASSERT(pPeerAddr);
+    if (!pPeerAddr)
+    {
+       // XXXAAK: for some reason the peer addr is NULL for this socket,
+       // which might indicate a memory corruption. its too late in the
+       // release cycle to chase down the mem corruption, so this workaround.
+       HX_RELEASE(pSession);
+       return HXR_UNEXPECTED;
+    }
     pPeerAddr->Clone(&pSingleRefPeerAddr);
     HX_RELEASE(pPeerAddr);
 


From jgordon at helixcommunity.org  Thu Jun  9 15:59:10 2005
From: jgordon at helixcommunity.org (jgordon@helixcommunity.org)
Date: Thu Jun  9 15:59:11 2005
Subject: [Server-cvs] capex profile_cache.cpp,1.3,1.3.52.1
Message-ID: 

Update of /cvsroot/server/capex
In directory cvs:/tmp/cvs-serv3277

Modified Files:
      Tag: SERVER_11_0_BETA2
	profile_cache.cpp 
Log Message:
Synopsis
========
Fixes PR 133513 (sort of)

Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, HEAD (SERVER_CURRENT)
Reviewed By: dcollins


Description
===========
Changes were made to 10.0 to allow partial matching of user agents
in default capex profile configuration. This merges the 10.0 changes
to the current code base for 11.0. The change is for the local default
profile cache *only*, real cached profiles (http fetched) *must* not
allow a partial match, the url must match in full.

THIS NEEDS TO BE REVISITED POST BETA.
First, the code to allow partial matching is a hack. This needs to be
cleaned up.
Second, we need to properly determine the appropriate user-agent strings
to use in the config. We need to make an *informed* decision here.


Index: profile_cache.cpp
===================================================================
RCS file: /cvsroot/server/capex/profile_cache.cpp,v
retrieving revision 1.3
retrieving revision 1.3.52.1
diff -u -d -r1.3 -r1.3.52.1
--- profile_cache.cpp	6 Aug 2003 23:23:07 -0000	1.3
+++ profile_cache.cpp	9 Jun 2005 22:59:03 -0000	1.3.52.1
@@ -35,6 +35,7 @@
  *   
  * ***** END LICENSE BLOCK ***** */
 
+#include "hlxclib/string.h"
 #include "hxtypes.h"
 #include "hxcom.h"
 #include "hxassert.h"
@@ -61,8 +62,9 @@
     {
         Dict_iterator iterator(m_pCacheTable);
         ProfileData* pPrfData;
-        for(Dict_entry* pEntry = *iterator; pEntry; ++iterator)
+        for(Dict_entry* pEntry=NULL; *iterator; ++iterator)
         {
+            pEntry = *iterator;
             pPrfData = (ProfileData*)pEntry->obj;
             if(pPrfData)
             {
@@ -147,16 +149,29 @@
         return HXR_NOT_INITIALIZED;
     }
 
-    Dict_entry* pEntry = m_pCacheTable->find(szKey);
-    if(pEntry && pEntry->obj)
+    // XXXSCR - Turns out there are many, many Nokia User-Agents
+    // so we need to be able to match more.  I admit that iterating through
+    // removes all reasons for having this in a hash table, but
+    // in the interest of simplicity, I'll leave it.  We'll do a better
+    // job on the head.
+    if(m_pCacheTable)
     {
-        ProfileData* pPrfData = (ProfileData*)pEntry->obj;
-        pProfile = pPrfData->pProfile;
-        if(pProfile)
+        Dict_iterator iterator(m_pCacheTable);
+        for(Dict_entry* pEntry=NULL; *iterator; ++iterator)
         {
-            pProfile->AddRef();
-            ulMergeRule = pPrfData->ulMergeRule;
-            return HXR_OK;
+            pEntry = *iterator;
+            if (pEntry && pEntry->key && pEntry->obj && 
+                    !strncmp(pEntry->key, szKey, strlen(pEntry->key)))
+            {
+                ProfileData* pPrfData = (ProfileData*)pEntry->obj;
+                pProfile = pPrfData->pProfile;
+                if(pProfile)
+                {
+                    pProfile->AddRef();
+                    ulMergeRule = pPrfData->ulMergeRule;
+                    return HXR_OK;
+                }
+            }
         }
     }
 


From jgordon at helixcommunity.org  Thu Jun  9 16:04:23 2005
From: jgordon at helixcommunity.org (jgordon@helixcommunity.org)
Date: Thu Jun  9 16:04:25 2005
Subject: [Server-cvs] capex profile_cache.cpp,1.3,1.3.34.1
Message-ID: 

Update of /cvsroot/server/capex
In directory cvs:/tmp/cvs-serv8777

Modified Files:
      Tag: SERVER_11_0_STABLE
	profile_cache.cpp 
Log Message:
Synopsis
========
Fixes PR 133513 (sort of)

Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, HEAD (SERVER_CURRENT)
Reviewed By: dcollins


Description
===========
Changes were made to 10.0 to allow partial matching of user agents
in default capex profile configuration. This merges the 10.0 changes
to the current code base for 11.0. The change is for the local default
profile cache *only*, real cached profiles (http fetched) *must* not
allow a partial match, the url must match in full.

THIS NEEDS TO BE REVISITED POST BETA.
First, the code to allow partial matching is a hack. This needs to be
cleaned up.
Second, we need to properly determine the appropriate user-agent strings
to use in the config. We need to make an *informed* decision here.


Index: profile_cache.cpp
===================================================================
RCS file: /cvsroot/server/capex/profile_cache.cpp,v
retrieving revision 1.3
retrieving revision 1.3.34.1
diff -u -d -r1.3 -r1.3.34.1
--- profile_cache.cpp	6 Aug 2003 23:23:07 -0000	1.3
+++ profile_cache.cpp	9 Jun 2005 23:04:20 -0000	1.3.34.1
@@ -35,6 +35,7 @@
  *   
  * ***** END LICENSE BLOCK ***** */
 
+#include "hlxclib/string.h"
 #include "hxtypes.h"
 #include "hxcom.h"
 #include "hxassert.h"
@@ -61,8 +62,9 @@
     {
         Dict_iterator iterator(m_pCacheTable);
         ProfileData* pPrfData;
-        for(Dict_entry* pEntry = *iterator; pEntry; ++iterator)
+        for(Dict_entry* pEntry=NULL; *iterator; ++iterator)
         {
+            pEntry = *iterator;
             pPrfData = (ProfileData*)pEntry->obj;
             if(pPrfData)
             {
@@ -147,16 +149,29 @@
         return HXR_NOT_INITIALIZED;
     }
 
-    Dict_entry* pEntry = m_pCacheTable->find(szKey);
-    if(pEntry && pEntry->obj)
+    // XXXSCR - Turns out there are many, many Nokia User-Agents
+    // so we need to be able to match more.  I admit that iterating through
+    // removes all reasons for having this in a hash table, but
+    // in the interest of simplicity, I'll leave it.  We'll do a better
+    // job on the head.
+    if(m_pCacheTable)
     {
-        ProfileData* pPrfData = (ProfileData*)pEntry->obj;
-        pProfile = pPrfData->pProfile;
-        if(pProfile)
+        Dict_iterator iterator(m_pCacheTable);
+        for(Dict_entry* pEntry=NULL; *iterator; ++iterator)
         {
-            pProfile->AddRef();
-            ulMergeRule = pPrfData->ulMergeRule;
-            return HXR_OK;
+            pEntry = *iterator;
+            if (pEntry && pEntry->key && pEntry->obj && 
+                    !strncmp(pEntry->key, szKey, strlen(pEntry->key)))
+            {
+                ProfileData* pPrfData = (ProfileData*)pEntry->obj;
+                pProfile = pPrfData->pProfile;
+                if(pProfile)
+                {
+                    pProfile->AddRef();
+                    ulMergeRule = pPrfData->ulMergeRule;
+                    return HXR_OK;
+                }
+            }
         }
     }
 


From jgordon at helixcommunity.org  Thu Jun  9 16:04:54 2005
From: jgordon at helixcommunity.org (jgordon@helixcommunity.org)
Date: Thu Jun  9 16:04:55 2005
Subject: [Server-cvs] capex profile_cache.cpp,1.3,1.4
Message-ID: 

Update of /cvsroot/server/capex
In directory cvs:/tmp/cvs-serv9501

Modified Files:
	profile_cache.cpp 
Log Message:
Synopsis
========
Fixes PR 133513 (sort of)

Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, HEAD (SERVER_CURRENT)
Reviewed By: dcollins


Description
===========
Changes were made to 10.0 to allow partial matching of user agents
in default capex profile configuration. This merges the 10.0 changes
to the current code base for 11.0. The change is for the local default
profile cache *only*, real cached profiles (http fetched) *must* not
allow a partial match, the url must match in full.

THIS NEEDS TO BE REVISITED POST BETA.
First, the code to allow partial matching is a hack. This needs to be
cleaned up.
Second, we need to properly determine the appropriate user-agent strings
to use in the config. We need to make an *informed* decision here.


Index: profile_cache.cpp
===================================================================
RCS file: /cvsroot/server/capex/profile_cache.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- profile_cache.cpp	6 Aug 2003 23:23:07 -0000	1.3
+++ profile_cache.cpp	9 Jun 2005 23:04:51 -0000	1.4
@@ -35,6 +35,7 @@
  *   
  * ***** END LICENSE BLOCK ***** */
 
+#include "hlxclib/string.h"
 #include "hxtypes.h"
 #include "hxcom.h"
 #include "hxassert.h"
@@ -61,8 +62,9 @@
     {
         Dict_iterator iterator(m_pCacheTable);
         ProfileData* pPrfData;
-        for(Dict_entry* pEntry = *iterator; pEntry; ++iterator)
+        for(Dict_entry* pEntry=NULL; *iterator; ++iterator)
         {
+            pEntry = *iterator;
             pPrfData = (ProfileData*)pEntry->obj;
             if(pPrfData)
             {
@@ -147,16 +149,29 @@
         return HXR_NOT_INITIALIZED;
     }
 
-    Dict_entry* pEntry = m_pCacheTable->find(szKey);
-    if(pEntry && pEntry->obj)
+    // XXXSCR - Turns out there are many, many Nokia User-Agents
+    // so we need to be able to match more.  I admit that iterating through
+    // removes all reasons for having this in a hash table, but
+    // in the interest of simplicity, I'll leave it.  We'll do a better
+    // job on the head.
+    if(m_pCacheTable)
     {
-        ProfileData* pPrfData = (ProfileData*)pEntry->obj;
-        pProfile = pPrfData->pProfile;
-        if(pProfile)
+        Dict_iterator iterator(m_pCacheTable);
+        for(Dict_entry* pEntry=NULL; *iterator; ++iterator)
         {
-            pProfile->AddRef();
-            ulMergeRule = pPrfData->ulMergeRule;
-            return HXR_OK;
+            pEntry = *iterator;
+            if (pEntry && pEntry->key && pEntry->obj && 
+                    !strncmp(pEntry->key, szKey, strlen(pEntry->key)))
+            {
+                ProfileData* pPrfData = (ProfileData*)pEntry->obj;
+                pProfile = pPrfData->pProfile;
+                if(pProfile)
+                {
+                    pProfile->AddRef();
+                    ulMergeRule = pPrfData->ulMergeRule;
+                    return HXR_OK;
+                }
+            }
         }
     }
 


From murali at helixcommunity.org  Fri Jun 10 11:13:03 2005
From: murali at helixcommunity.org (murali@helixcommunity.org)
Date: Fri Jun 10 11:13:05 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp, 1.157.2.23.2.2,
	1.157.2.23.2.3
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv29472

Modified Files:
      Tag: SERVER_11_0_BETA2
	rtspserv.cpp 
Log Message:
Changes to get legacy encoder( port 4040) working with latest server.


Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.23.2.2
retrieving revision 1.157.2.23.2.3
diff -u -d -r1.157.2.23.2.2 -r1.157.2.23.2.3
--- rtspserv.cpp	9 Jun 2005 21:32:07 -0000	1.157.2.23.2.2
+++ rtspserv.cpp	10 Jun 2005 18:13:01 -0000	1.157.2.23.2.3
@@ -9435,6 +9435,8 @@
 
                                 pInfo->m_bIsLive = ulIsLive ? TRUE : FALSE;
 
+                                pInfo->m_ulControlID = streamNumber;
+                                pInfo->m_uStreamGroupNumber = streamNumber;
                                 pSession->m_ppStreamInfo[streamNumber] = pInfo;
 
                                 /*


From murali at helixcommunity.org  Fri Jun 10 11:13:53 2005
From: murali at helixcommunity.org (murali@helixcommunity.org)
Date: Fri Jun 10 11:13:54 2005
Subject: [Server-cvs] protocol/transport/rdt rdttran.cpp, 1.56.2.11.2.1,
	1.56.2.11.2.2
Message-ID: 

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs:/tmp/cvs-serv30720/rdt

Modified Files:
      Tag: SERVER_11_0_BETA2
	rdttran.cpp 
Log Message:
Changes made to get legacye encoder(port 4040) working with lates server.


Index: rdttran.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdttran.cpp,v
retrieving revision 1.56.2.11.2.1
retrieving revision 1.56.2.11.2.2
diff -u -d -r1.56.2.11.2.1 -r1.56.2.11.2.2
--- rdttran.cpp	18 May 2005 22:46:10 -0000	1.56.2.11.2.1
+++ rdttran.cpp	10 Jun 2005 18:13:51 -0000	1.56.2.11.2.2
@@ -3139,10 +3139,10 @@
     case  HX_SOCK_EVENT_READ:
         if (SUCCEEDED(m_pUDPSocket->Read(&pBuf)))
         {
-            HX_ASSERT(m_bIsSource);
             m_pResp->PacketReady(HXR_OK, m_sessionID, NULL);
 
             rc = handlePacket(pBuf);
+            releasePackets();
         }
 
         HX_RELEASE(pBuf);


From darrick at helixcommunity.org  Fri Jun 10 15:34:03 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Fri Jun 10 15:34:05 2005
Subject: [Server-cvs] datatype/common/pktskim mp4skim.cpp,1.6,1.7
Message-ID: 

Update of /cvsroot/server/datatype/common/pktskim
In directory cvs:/tmp/cvs-serv24633/datatype/common/pktskim

Modified Files:
	mp4skim.cpp 
Log Message:
Synopsis
========
Fix build busters on the head. Due to trivial nature of this checkin, doing so now. Diff follows below.

Branches: SERVER_CURRENT_RN
CR: none-- TBR by dcollins/mtuncer as necessary 


Description
===========
A helix community checkin removed an #include for hxengin.h from hxmutexlock.h. Add #includes to hxengin.h where appropriate.

Standard var. initialization/goto stuff in the packet skimmer library.



Testing Performed
=================

Unit Tests: n/a

Integration Tests: n/a

Leak Tests: n/a

Performance Tests: n/a

Platforms Tested: n/a
Build verified: linux-2.6



Index: mp4skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/mp4skim.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mp4skim.cpp	9 Jun 2005 14:40:47 -0000	1.6
+++ mp4skim.cpp	10 Jun 2005 22:34:01 -0000	1.7
@@ -61,11 +61,11 @@
     int         nIndex = 0;
     BYTE*       pIndex = NULL;
     BOOL        bKeyFrame = FALSE;
-    BOOL        bGroupOfVop = FALSE;
     char        pszBits[500];
     int         nCount = 500;
     BOOL        bLoopDone = FALSE;
-
+    UINT8       uiRTPMarker = 0;
+    
     ulPacketInfo = 0;
 
     // Enforce minimum size: RTP hdr(12)
@@ -88,7 +88,7 @@
     }
 
     // rtp marker bit
-    UINT8 uiRTPMarker = ((pRTPHdr[1] >> 7) & 0x01);
+    uiRTPMarker = ((pRTPHdr[1] >> 7) & 0x01);
 
     // scan the mp4 data to find start code prefix (0x00, 0x00, 0x01)
   


From darrick at helixcommunity.org  Fri Jun 10 15:34:03 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Fri Jun 10 15:34:05 2005
Subject: [Server-cvs] engine/context/pub imutex.h,1.3,1.4
Message-ID: 

Update of /cvsroot/server/engine/context/pub
In directory cvs:/tmp/cvs-serv24633/engine/context/pub

Modified Files:
	imutex.h 
Log Message:
Synopsis
========
Fix build busters on the head. Due to trivial nature of this checkin, doing so now. Diff follows below.

Branches: SERVER_CURRENT_RN
CR: none-- TBR by dcollins/mtuncer as necessary 


Description
===========
A helix community checkin removed an #include for hxengin.h from hxmutexlock.h. Add #includes to hxengin.h where appropriate.

Standard var. initialization/goto stuff in the packet skimmer library.



Testing Performed
=================

Unit Tests: n/a

Integration Tests: n/a

Leak Tests: n/a

Performance Tests: n/a

Platforms Tested: n/a
Build verified: linux-2.6



Index: imutex.h
===================================================================
RCS file: /cvsroot/server/engine/context/pub/imutex.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- imutex.h	4 Sep 2003 22:39:08 -0000	1.3
+++ imutex.h	10 Jun 2005 22:34:01 -0000	1.4
@@ -43,6 +43,7 @@
 
 #include "hxtypes.h"
 #include "hxcom.h"
+#include "hxengin.h"
 #include "mutex.h"
 
 /***********************************************************************


From darrick at helixcommunity.org  Fri Jun 10 15:34:04 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Fri Jun 10 15:34:06 2005
Subject: [Server-cvs] engine/inputsource fileformat_handler.cpp,1.31,1.32
Message-ID: 

Update of /cvsroot/server/engine/inputsource
In directory cvs:/tmp/cvs-serv24633/engine/inputsource

Modified Files:
	fileformat_handler.cpp 
Log Message:
Synopsis
========
Fix build busters on the head. Due to trivial nature of this checkin, doing so now. Diff follows below.

Branches: SERVER_CURRENT_RN
CR: none-- TBR by dcollins/mtuncer as necessary 


Description
===========
A helix community checkin removed an #include for hxengin.h from hxmutexlock.h. Add #includes to hxengin.h where appropriate.

Standard var. initialization/goto stuff in the packet skimmer library.



Testing Performed
=================

Unit Tests: n/a

Integration Tests: n/a

Leak Tests: n/a

Performance Tests: n/a

Platforms Tested: n/a
Build verified: linux-2.6



Index: fileformat_handler.cpp
===================================================================
RCS file: /cvsroot/server/engine/inputsource/fileformat_handler.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- fileformat_handler.cpp	4 Mar 2005 00:49:48 -0000	1.31
+++ fileformat_handler.cpp	10 Jun 2005 22:34:01 -0000	1.32
@@ -49,6 +49,7 @@
 #include "hxstrutl.h"
 
 #include "hxmon.h"
+#include "hxengin.h"
 
 #include "servpckts.h"
 #include "streamgroupmgr.h"


From MicheConnol at gapvax.com  Fri Jun 10 17:13:17 2005
From: MicheConnol at gapvax.com (Micheal Connolly)
Date: Fri Jun 10 17:13:39 2005
Subject: [Server-cvs] Roccky Man
Message-ID: 

Hello, 
at that spot.  He realized that he might have to retreat in a hurry.having been painted black - the four vessels, without a lightthe roar of guns from sea and land, announcing that battle wasthe advantage of a surprise blow, which had put the fort out ofWalking leisurely, he skirted the embattled wall, and passed throughthey had accomplished it two more of their boats had been sunk.I think that cancels the articles between us, he said.  Witha man of rank.  Here, quite clearly, was no buccaneer.  He wascareless and slovenly in his dress.  He allowed a black beard toWilloughby and van der Kuylen on the poop had watched in breathlessVery well, he said.  Be so good as to recall this Captain Blood. - throve out of a scarcely tacit partnership with the filibusters,one of your slaves was being murthered by the sun and the flies.gaudy, swaggering raffishness something that the women foundFor the eight thousand pieces that go to the Arabella, I maketruth is that the lingering remains of the regard in which he had
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050610/6a849d9d/attachment.htm
From atin at helixcommunity.org  Sat Jun 11 12:11:57 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Sat Jun 11 12:11:59 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp, 1.157.2.23.2.3,
	1.157.2.23.2.4
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv8029

Modified Files:
      Tag: SERVER_11_0_BETA2
	rtspserv.cpp 
Log Message:
fix for potential CA because the pSession object doesn't need to be
released since its not been AddRef'd.


Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.23.2.3
retrieving revision 1.157.2.23.2.4
diff -u -d -r1.157.2.23.2.3 -r1.157.2.23.2.4
--- rtspserv.cpp	10 Jun 2005 18:13:01 -0000	1.157.2.23.2.3
+++ rtspserv.cpp	11 Jun 2005 19:11:55 -0000	1.157.2.23.2.4
@@ -2855,7 +2855,8 @@
 	// XXXAAK: for some reason the peer addr is NULL for this socket,
 	// which might indicate a memory corruption. its too late in the
 	// release cycle to chase down the mem corruption, so this workaround.
-	HX_RELEASE(pSession);
+	// might b related to the client sending multiple identical SETUP
+	// messages for the same streamID for rtp (h264).
 	return HXR_UNEXPECTED;
     }
     pPeerAddr->Clone(&pSingleRefPeerAddr);


From atin at helixcommunity.org  Sat Jun 11 12:13:33 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Sat Jun 11 12:13:35 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.183,1.184
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv13159

Modified Files:
	rtspserv.cpp 
Log Message:
fix potential CA caused by doing an extra release of pSession.


Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -d -r1.183 -r1.184
--- rtspserv.cpp	9 Jun 2005 22:36:34 -0000	1.183
+++ rtspserv.cpp	11 Jun 2005 19:13:30 -0000	1.184
@@ -2864,7 +2864,8 @@
        // XXXAAK: for some reason the peer addr is NULL for this socket,
        // which might indicate a memory corruption. its too late in the
        // release cycle to chase down the mem corruption, so this workaround.
-       HX_RELEASE(pSession);
+       // might b related to the client sending multiple identical
+       // SETUP messages for the same streamID for rtp (h264).
        return HXR_UNEXPECTED;
     }
     pPeerAddr->Clone(&pSingleRefPeerAddr);


From atin at helixcommunity.org  Sat Jun 11 12:14:54 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Sat Jun 11 12:14:56 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.157.2.26,1.157.2.27
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv15475

Modified Files:
      Tag: SERVER_11_0_STABLE
	rtspserv.cpp 
Log Message:
fix potential CA caused by an extra release of pSession.


Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.26
retrieving revision 1.157.2.27
diff -u -d -r1.157.2.26 -r1.157.2.27
--- rtspserv.cpp	9 Jun 2005 22:33:53 -0000	1.157.2.26
+++ rtspserv.cpp	11 Jun 2005 19:14:52 -0000	1.157.2.27
@@ -2862,11 +2862,12 @@
     HX_ASSERT(pPeerAddr);
     if (!pPeerAddr)
     {
-       // XXXAAK: for some reason the peer addr is NULL for this socket,
-       // which might indicate a memory corruption. its too late in the
-       // release cycle to chase down the mem corruption, so this workaround.
-       HX_RELEASE(pSession);
-       return HXR_UNEXPECTED;
+	// XXXAAK: for some reason the peer addr is NULL for this socket,
+	// which might indicate a memory corruption. its too late in the
+	// release cycle to chase down the mem corruption, so this workaround.
+	// might b related to the client sending multiple identical SETUP
+	// messages for the same streamID for rtp (h264).
+        return HXR_UNEXPECTED;
     }
     pPeerAddr->Clone(&pSingleRefPeerAddr);
     HX_RELEASE(pPeerAddr);


From dcollins at helixcommunity.org  Sat Jun 11 13:01:47 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Sat Jun 11 13:01:48 2005
Subject: [Server-cvs] protocol/rtsp rtspprot.cpp, 1.66.2.3,
	1.66.2.3.4.1 rtspserv.cpp, 1.157.2.23.2.4, 1.157.2.23.2.5
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv1550

Modified Files:
      Tag: SERVER_11_0_BETA2
	rtspprot.cpp rtspserv.cpp 
Log Message:
Synopsis
========
Fixes PR 142404: "uptime: RHEL4 CAs in RTSPProtocol::AddTransport"

Branches: SERVER_11_0_BETA2_RN, SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
Reviewed By: Atin


Description
===========
The uptime was failing with asserts in RTSPProtocol::AddTransport().
The problem occured with RTP/UDP Live connections playing h.264 content.

This diff corrects the server-side part of this problem.  Credit goes
to Atin for figuring out the main part of the fix.

The situation arises from what seems like a player-side bug that Go
tracked down, and which will be investigated further.  A seperate PR
will be entered for this assuming this turns out to be the case.
This fix allows the server to more robustly handle the player error.
The content in question still does not play however.


Files Affected
==============

server/protocol/rtsp/rtspprot.cpp
server/protocol/rtsp/rtspserv.cpp


Testing Performed
=================

Unit Tests:
- None.

Integration Tests:
- Ran a private build in the linux uptime rig, observed that CAs were
  no longer occuring.

Leak Tests:
- None.

Performance Tests:
- None.

Platforms Tested: linux-rhel4-i686
Build verified:   linux-rhel4-i686


QA Hints
===============

Regress PR 142404 in a Beta2 uptime.  Ensure RTP Live clips are not
causing server CAs.



Index: rtspprot.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspprot.cpp,v
retrieving revision 1.66.2.3
retrieving revision 1.66.2.3.4.1
diff -u -d -r1.66.2.3 -r1.66.2.3.4.1
--- rtspprot.cpp	6 Dec 2004 01:20:11 -0000	1.66.2.3
+++ rtspprot.cpp	11 Jun 2005 20:01:44 -0000	1.66.2.3.4.1
@@ -1141,6 +1141,11 @@
     }
 #endif /* ndef PERF_NOCLIENTREG */
     //client()->get_client_stats()->SetUDP(bIsUDP);
+    HX_ASSERT(pSession);
+    if (!pSession)
+    { 
+        return HXR_UNEXPECTED;
+    }
     if (pSession->m_pStats)
     {
         pSession->m_pStats->SetUDP(bIsUDP);

Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.23.2.4
retrieving revision 1.157.2.23.2.5
diff -u -d -r1.157.2.23.2.4 -r1.157.2.23.2.5
--- rtspserv.cpp	11 Jun 2005 19:11:55 -0000	1.157.2.23.2.4
+++ rtspserv.cpp	11 Jun 2005 20:01:44 -0000	1.157.2.23.2.5
@@ -2732,6 +2732,7 @@
         {
             // Duplicate setup, return 455 (RFC2326, s10.4)
             SendSetupResponse(HXR_FAILED, 455, pSession);
+            return HXR_UNEXPECTED;
         }
         pSession->m_pbSETUPRcvdStrm[usStreamNumber] = TRUE;
     }


From dcollins at helixcommunity.org  Sat Jun 11 13:02:04 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Sat Jun 11 13:02:06 2005
Subject: [Server-cvs] protocol/rtsp rtspprot.cpp, 1.66.2.3,
	1.66.2.4 rtspserv.cpp, 1.157.2.27, 1.157.2.28
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv2123

Modified Files:
      Tag: SERVER_11_0_STABLE
	rtspprot.cpp rtspserv.cpp 
Log Message:
Synopsis
========
Fixes PR 142404: "uptime: RHEL4 CAs in RTSPProtocol::AddTransport"

Branches: SERVER_11_0_BETA2_RN, SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
Reviewed By: Atin


Description
===========
The uptime was failing with asserts in RTSPProtocol::AddTransport().
The problem occured with RTP/UDP Live connections playing h.264 content.

This diff corrects the server-side part of this problem.  Credit goes
to Atin for figuring out the main part of the fix.

The situation arises from what seems like a player-side bug that Go
tracked down, and which will be investigated further.  A seperate PR
will be entered for this assuming this turns out to be the case.
This fix allows the server to more robustly handle the player error.
The content in question still does not play however.


Files Affected
==============

server/protocol/rtsp/rtspprot.cpp
server/protocol/rtsp/rtspserv.cpp


Testing Performed
=================

Unit Tests:
- None.

Integration Tests:
- Ran a private build in the linux uptime rig, observed that CAs were
  no longer occuring.

Leak Tests:
- None.

Performance Tests:
- None.

Platforms Tested: linux-rhel4-i686
Build verified:   linux-rhel4-i686


QA Hints
===============

Regress PR 142404 in a Beta2 uptime.  Ensure RTP Live clips are not
causing server CAs.



Index: rtspprot.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspprot.cpp,v
retrieving revision 1.66.2.3
retrieving revision 1.66.2.4
diff -u -d -r1.66.2.3 -r1.66.2.4
--- rtspprot.cpp	6 Dec 2004 01:20:11 -0000	1.66.2.3
+++ rtspprot.cpp	11 Jun 2005 20:02:01 -0000	1.66.2.4
@@ -1141,6 +1141,11 @@
     }
 #endif /* ndef PERF_NOCLIENTREG */
     //client()->get_client_stats()->SetUDP(bIsUDP);
+    HX_ASSERT(pSession);
+    if (!pSession)
+    { 
+        return HXR_UNEXPECTED;
+    }
     if (pSession->m_pStats)
     {
         pSession->m_pStats->SetUDP(bIsUDP);

Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.27
retrieving revision 1.157.2.28
diff -u -d -r1.157.2.27 -r1.157.2.28
--- rtspserv.cpp	11 Jun 2005 19:14:52 -0000	1.157.2.27
+++ rtspserv.cpp	11 Jun 2005 20:02:01 -0000	1.157.2.28
@@ -2742,6 +2742,7 @@
         {
             // Duplicate setup, return 455 (RFC2326, s10.4)
             SendSetupResponse(HXR_FAILED, 455, pSession);
+            return HXR_UNEXPECTED;
         }
         pSession->m_pbSETUPRcvdStrm[usStreamNumber] = TRUE;
     }


From dcollins at helixcommunity.org  Sat Jun 11 13:02:11 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Sat Jun 11 13:02:12 2005
Subject: [Server-cvs] protocol/rtsp rtspprot.cpp, 1.69, 1.70 rtspserv.cpp,
	1.184, 1.185
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv2409

Modified Files:
	rtspprot.cpp rtspserv.cpp 
Log Message:
Synopsis
========
Fixes PR 142404: "uptime: RHEL4 CAs in RTSPProtocol::AddTransport"

Branches: SERVER_11_0_BETA2_RN, SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
Reviewed By: Atin


Description
===========
The uptime was failing with asserts in RTSPProtocol::AddTransport().
The problem occured with RTP/UDP Live connections playing h.264 content.

This diff corrects the server-side part of this problem.  Credit goes
to Atin for figuring out the main part of the fix.

The situation arises from what seems like a player-side bug that Go
tracked down, and which will be investigated further.  A seperate PR
will be entered for this assuming this turns out to be the case.
This fix allows the server to more robustly handle the player error.
The content in question still does not play however.


Files Affected
==============

server/protocol/rtsp/rtspprot.cpp
server/protocol/rtsp/rtspserv.cpp


Testing Performed
=================

Unit Tests:
- None.

Integration Tests:
- Ran a private build in the linux uptime rig, observed that CAs were
  no longer occuring.

Leak Tests:
- None.

Performance Tests:
- None.

Platforms Tested: linux-rhel4-i686
Build verified:   linux-rhel4-i686


QA Hints
===============

Regress PR 142404 in a Beta2 uptime.  Ensure RTP Live clips are not
causing server CAs.



Index: rtspprot.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspprot.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- rtspprot.cpp	6 Dec 2004 01:47:22 -0000	1.69
+++ rtspprot.cpp	11 Jun 2005 20:02:09 -0000	1.70
@@ -1141,6 +1141,11 @@
     }
 #endif /* ndef PERF_NOCLIENTREG */
     //client()->get_client_stats()->SetUDP(bIsUDP);
+    HX_ASSERT(pSession);
+    if (!pSession)
+    { 
+        return HXR_UNEXPECTED;
+    }
     if (pSession->m_pStats)
     {
         pSession->m_pStats->SetUDP(bIsUDP);

Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -d -r1.184 -r1.185
--- rtspserv.cpp	11 Jun 2005 19:13:30 -0000	1.184
+++ rtspserv.cpp	11 Jun 2005 20:02:09 -0000	1.185
@@ -2741,6 +2741,7 @@
         {
             // Duplicate setup, return 455 (RFC2326, s10.4)
             SendSetupResponse(HXR_FAILED, 455, pSession);
+            return HXR_UNEXPECTED;
         }
         pSession->m_pbSETUPRcvdStrm[usStreamNumber] = TRUE;
     }


From QuinoShell at galvol.com  Sat Jun 11 23:09:05 2005
From: QuinoShell at galvol.com (Shell Quinones)
Date: Sat Jun 11 23:09:17 2005
Subject: [Server-cvs] Life is goood
Message-ID: 

Hello, 
stores, besides canoes and small craft in tow.merchants surrender all moneys and goods held by them for theirand Ogle had agreed to join the venture, and eight others had beennothing grave; merely sufficient to make him keep his cabin.  It isThe Governor seemed to shed his chubbiness.  He drew himselfforgotten in his panic - supported by Colonel Bishop and some lesserthat account disregard the words, nor did Hagthorpe, nor yet thethe guns abruptly ceased.Don Esteban expressed his last lingering uneasiness:that its owner was disposed to sell it for twenty-two pounds.  Thatout of them.  Had they, themselves, been prisoners accused ofIt was his only remaining hope that Colonel Bishop might not havedeath comes to him.been completely gathered?entreatingly, piteously into the face of the dragoon.  He leeredthe means to be adopted.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050612/8980082f/attachment.htm
From Dela at jpeterman.com  Mon Jun 13 10:17:48 2005
From: Dela at jpeterman.com (Roxie Delaney)
Date: Mon Jun 13 10:18:00 2005
Subject: [Server-cvs] Val Meddz
Message-ID: 

Hello, 
They bustled him away, choking almost from a reluctance that he daredthe morning air.may depend upon my loyal service.voice calling back on a quavering note -for what I want.there.cats - oh, the cats they wait for us!  The cats are those fourPitt, who watched the scene from the quarter-deck rail, tells ussitting alone in his cabin, his head in his hands, torment in theentertain no delusive hope of ever winning her for his own, of everyet of whose foulness her intuitions made her conscious.those massing in the town, so as to oppose and overwhelm the Spanishto open fire upon the Salvador.  First athwart her hawse he hadtogether with these some half-dozen Spaniards in like case, thejust then with her movements.Jeremy Pitt, the master, lounging at Blood's elbow, looked darkly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050613/b90ecacc/attachment.htm
From seansmith at helixcommunity.org  Mon Jun 13 11:05:48 2005
From: seansmith at helixcommunity.org (seansmith@helixcommunity.org)
Date: Mon Jun 13 11:05:50 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.100.2.37,1.100.2.38
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv13406

Modified Files:
      Tag: SERVER_10_1_STABLE
	rtspserv.cpp 
Log Message:
Description
===========
After the proxy gets a file via the cache connection, it proceeds to
send a PLAY request (null transport) via the accounting connection. The
problem is that for a PLAY request, we only send a play response from
somewhere like SetStreamStartTime(). For an accounting connection, the
ppm is not involved, and no response is sent. This ends up blocking ALL
further accounting requests, because RTSPServerProtocol::handleInput()
returns prematurely if the current response hasn't been sent.

This (most likely) makes it impossible to play smil presentations via
the proxy, since all accounting connection requests following PLAY will
be ignored!

The solution is to call SendPlayResponse() at the end of
RTSPServerProtocol::OnPlayRequest() when the associated session is null
transport. The protocol itself doesn't keep track of whether it is
associated with a null transport connection. Fortunately, there is a
variable called bIsDataCapable that is FALSE for a null transport
(accounting) connection. OnPlayRequest() has a loop that iterates
through the transport list, and sets bIsDataCapable to true if one or
more of the transports != RTSP_TR_NULLSET.

Reviewed by: tmarshall, jcarlton
Branch: SERVER_10_1_STABLE_RN


Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.100.2.37
retrieving revision 1.100.2.38
diff -u -d -r1.100.2.37 -r1.100.2.38
--- rtspserv.cpp	20 Apr 2005 14:15:33 -0000	1.100.2.37
+++ rtspserv.cpp	13 Jun 2005 18:05:45 -0000	1.100.2.38
@@ -11751,6 +11751,13 @@
         HX_RELEASE(pReg);
     }
 
+    // if null transport session, send response now since 
+    // SendPlayResponse won't get called otherwise
+    if (bIsDataCapable == FALSE)
+    {
+        SendPlayResponse(200, pSession->m_ulPlayReqCSeq, pSession);
+    } 
+
     return HXR_FAIL; // SendPlayResponse will handle state transition
 }
 


From darrick at helixcommunity.org  Mon Jun 13 11:33:57 2005
From: darrick at helixcommunity.org (darrick@helixcommunity.org)
Date: Mon Jun 13 11:33:59 2005
Subject: [Server-cvs] datatype/common/pktskim mp4skim.cpp,1.1.2.4,1.1.2.5
Message-ID: 

Update of /cvsroot/server/datatype/common/pktskim
In directory cvs:/tmp/cvs-serv5330

Modified Files:
      Tag: SERVER_11_0_STABLE
	mp4skim.cpp 
Log Message:
Synopsis
========
Fix build busters on the head. Due to trivial nature of this checkin,
checking in now. Diff follows below. Please post-review as necessary.

Branches: SERVER_11_0_STABLE_RN
CR: n/a - dcollins/mtuncer to post-review as necessary


Description
===========
Standard var. initialization/goto stuff in the packet skimmer library.



Testing Performed
=================

Unit Tests: n/a

Integration Tests: n/a

Leak Tests: n/a

Performance Tests: n/a

Platforms Tested: n/a
Build verified: linux-2.6



Index: mp4skim.cpp
===================================================================
RCS file: /cvsroot/server/datatype/common/pktskim/mp4skim.cpp,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- mp4skim.cpp	9 Jun 2005 14:38:49 -0000	1.1.2.4
+++ mp4skim.cpp	13 Jun 2005 18:33:55 -0000	1.1.2.5
@@ -61,11 +61,11 @@
     int         nIndex = 0;
     BYTE*       pIndex = NULL;
     BOOL        bKeyFrame = FALSE;
-    BOOL        bGroupOfVop = FALSE;
     char        pszBits[500];
     int         nCount = 500;
     BOOL        bLoopDone = FALSE;
-
+    UINT8       uiRTPMarker = 0;
+    
     ulPacketInfo = 0;
 
     // Enforce minimum size: RTP hdr(12)
@@ -88,7 +88,7 @@
     }
 
     // rtp marker bit
-    UINT8 uiRTPMarker = ((pRTPHdr[1] >> 7) & 0x01);
+    uiRTPMarker = ((pRTPHdr[1] >> 7) & 0x01);
 
     // scan the mp4 data to find start code prefix (0x00, 0x00, 0x01)
   


From atin at helixcommunity.org  Mon Jun 13 17:29:56 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Mon Jun 13 17:29:58 2005
Subject: [Server-cvs] protocol/transport/rdt rdttran.cpp, 1.56.2.11.2.2,
	1.56.2.11.2.3
Message-ID: 

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs:/tmp/cvs-serv11233

Modified Files:
      Tag: SERVER_11_0_BETA2
	rdttran.cpp 
Log Message:
Synopsis                                                                       
========                                                                       
internal PR# 142135 -- server uptime: memory leak of 12.5Mb/hour v11 beta2                                                                                    
Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, SERVER_CURRENT                
Suggested Reviewer: tmarshall, dcollins                                                                                                                                    
                                                                               
Description                                                                    
===========                                                                    
inside the TNGTCPTransport::sendBWProbingPackets() a BYTE vector was being
created within a loop and it was being passed as a parameter to a              
CHXStaticBuffer which was getting destroyed. the problem was that a            
CHXStaticBuffer doesn't delete the buffer it points to, so the BYTE vector     
leaked.                                                                        

changed the buffer to a ServerBuffer which will delete the vector when
its destructor is called.
                                                                               
Files Affected                                                                 
==============                                                                 
server/protocol/transport/rdt/rdttran.cpp                                      
                                                                               
                                                                               
Testing Performed                                                              
=================                                                              
Unit Tests: n/a                                                                
                                                                               
Integration Tests: n/a                                                         
                                                                               
Leak Tests: ran with --lct and didn't see the leak after the fix.              
                                                                               
Performance Tests: n/a                                                         
                                                                               
Platforms Tested: linux-rhel4-i686                                             
Build verified: linux-rhel4-i686                                               
                                                                               
QA Hints                                                                       
========                                                                       
the uptimes should see reduced (or no) leaks.


Index: rdttran.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdttran.cpp,v
retrieving revision 1.56.2.11.2.2
retrieving revision 1.56.2.11.2.3
diff -u -d -r1.56.2.11.2.2 -r1.56.2.11.2.3
--- rdttran.cpp	10 Jun 2005 18:13:51 -0000	1.56.2.11.2.2
+++ rdttran.cpp	14 Jun 2005 00:29:54 -0000	1.56.2.11.2.3
@@ -2956,10 +2956,7 @@
 
     pBuffer = new CHXStaticBuffer((UCHAR*)g_pABDBuf,(ulPacketSize+ulPacketCount));
     if (pBuffer == NULL)
-    {
-	    fprintf(stderr,"pBuffer NULL\n");
         return HXR_FAIL;
-    }
     pBuffer->AddRef();
 
     pc = pBuffer->GetBuffer();
@@ -2984,8 +2981,8 @@
         pSendBuf->AddRef();
 
         pc++; //just to make data in each packet to be different
-	             //The g_pABDBUF is big enough that this pointer will not 
-		     //go out if bounds. 
+	      //The g_pABDBUF is big enough that this pointer will not 
+	      //go out if bounds. 
 
         if (SUCCEEDED(m_pUDPSocket->Write(pSendBuf)))
         {
@@ -5651,7 +5648,7 @@
 
     TNGBWProbingPacket pkt;
     CHXStaticBuffer* pBuffer = NULL;
-    CHXStaticBuffer* pSendBuf = NULL;
+    ServerBuffer* pSendBuf = NULL;
     BYTE* pc = NULL;
     UINT32 ulTemp = 0;
 
@@ -5686,17 +5683,16 @@
 
         HX_ASSERT(ulPacketSize == ulTemp);
 
-        BYTE* pPacketData = new BYTE[ulPacketSize+4];
-        pPacketData[0] = '$';
-        pPacketData[1] = m_tcpInterleave;
-        putshort(&pPacketData[2], (UINT16)ulPacketSize);
+	BYTE* pPacketData = new BYTE[ulPacketSize+4];
+	pPacketData[0] = '$';
+	pPacketData[1] = m_tcpInterleave;
+	putshort(&pPacketData[2], (UINT16)ulPacketSize);
         memcpy(&pPacketData[4], pc, HX_SAFESIZE_T(ulPacketSize));
-        pSendBuf = new CHXStaticBuffer(pPacketData, ulPacketSize + 4);
+        pSendBuf = new ServerBuffer(pPacketData, ulPacketSize + 4);
 
         pSendBuf->AddRef();
         pc++;
 
-
         if (SUCCEEDED(m_pTCPSocket->Write(pSendBuf)))
         {
             pSendBuf->Release();
@@ -5712,7 +5708,6 @@
             break;
         }
     }
-
     pBuffer->Release();
 
     m_pTCPSocket->SetOption(HX_SOCKOPT_TCP_NODELAY, 0);


From atin at helixcommunity.org  Mon Jun 13 17:31:23 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Mon Jun 13 17:31:24 2005
Subject: [Server-cvs] protocol/transport/rdt rdttran.cpp,1.65,1.66
Message-ID: 

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs:/tmp/cvs-serv13655

Modified Files:
	rdttran.cpp 
Log Message:
Synopsis                                                                       
========                                                                       
internal PR# 142135 -- server uptime: memory leak of 12.5Mb/hour v11 beta2                                                                                    
Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, SERVER_CURRENT                
Suggested Reviewer: anyone                                                                                                                                    
                                                                               
Description                                                                    
===========                                                                    
inside the TNGTCPTransport::sendBWProbingPackets() a BYTE vector was being
created within a loop and it was being passed as a parameter to a              
CHXStaticBuffer which was getting destroyed. the problem was that a            
CHXStaticBuffer doesn't delete the buffer it points to, so the BYTE vector     
leaked.                                                                        

changed the buffer to a ServerBuffer which will delete the vector when
its destructor is called.
                                                                               
Files Affected                                                                 
==============                                                                 
server/protocol/transport/rdt/rdttran.cpp                                      
                                                                               
                                                                               
Testing Performed                                                              
=================                                                              
Unit Tests: n/a                                                                
                                                                               
Integration Tests: n/a                                                         
                                                                               
Leak Tests: ran with --lct and didn't see the leak after the fix.              
                                                                               
Performance Tests: n/a                                                         
                                                                               
Platforms Tested: linux-rhel4-i686                                             
Build verified: linux-rhel4-i686                                               
                                                                               
QA Hints                                                                       
========                                                                       
the uptimes should see reduced (or no) leaks.


Index: rdttran.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdttran.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- rdttran.cpp	18 May 2005 22:51:21 -0000	1.65
+++ rdttran.cpp	14 Jun 2005 00:31:21 -0000	1.66
@@ -5652,7 +5652,7 @@
 
     TNGBWProbingPacket pkt;
     CHXStaticBuffer* pBuffer = NULL;
-    CHXStaticBuffer* pSendBuf = NULL;
+    ServerBuffer* pSendBuf = NULL;
     BYTE* pc = NULL;
     UINT32 ulTemp = 0;
 
@@ -5692,7 +5692,7 @@
         pPacketData[1] = m_tcpInterleave;
         putshort(&pPacketData[2], (UINT16)ulPacketSize);
         memcpy(&pPacketData[4], pc, HX_SAFESIZE_T(ulPacketSize));
-        pSendBuf = new CHXStaticBuffer(pPacketData, ulPacketSize + 4);
+        pSendBuf = new ServerBuffer(pPacketData, ulPacketSize + 4);
 
         pSendBuf->AddRef();
         pc++;


From atin at helixcommunity.org  Mon Jun 13 17:32:19 2005
From: atin at helixcommunity.org (atin@helixcommunity.org)
Date: Mon Jun 13 17:32:21 2005
Subject: [Server-cvs] protocol/transport/rdt rdttran.cpp, 1.56.2.12,
	1.56.2.13
Message-ID: 

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs:/tmp/cvs-serv15515

Modified Files:
      Tag: SERVER_11_0_STABLE
	rdttran.cpp 
Log Message:
Synopsis                                                                       
========                                                                       
internal PR# 142135 -- server uptime: memory leak of 12.5Mb/hour v11 beta2                                                                                    
Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, SERVER_CURRENT                
Suggested Reviewer: tmarshall, dcollins                                                                                                                                    
                                                                               
Description                                                                    
===========                                                                    
inside the TNGTCPTransport::sendBWProbingPackets() a BYTE vector was being
created within a loop and it was being passed as a parameter to a              
CHXStaticBuffer which was getting destroyed. the problem was that a            
CHXStaticBuffer doesn't delete the buffer it points to, so the BYTE vector     
leaked.                                                                        

changed the buffer to a ServerBuffer which will delete the vector when
its destructor is called.
                                                                               
Files Affected                                                                 
==============                                                                 
server/protocol/transport/rdt/rdttran.cpp                                      
                                                                               
                                                                               
Testing Performed                                                              
=================                                                              
Unit Tests: n/a                                                                
                                                                               
Integration Tests: n/a                                                         
                                                                               
Leak Tests: ran with --lct and didn't see the leak after the fix.              
                                                                               
Performance Tests: n/a                                                         
                                                                               
Platforms Tested: linux-rhel4-i686                                             
Build verified: linux-rhel4-i686                                               
                                                                               
QA Hints                                                                       
========                                                                       
the uptimes should see reduced (or no) leaks.


Index: rdttran.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdttran.cpp,v
retrieving revision 1.56.2.12
retrieving revision 1.56.2.13
diff -u -d -r1.56.2.12 -r1.56.2.13
--- rdttran.cpp	18 May 2005 22:50:11 -0000	1.56.2.12
+++ rdttran.cpp	14 Jun 2005 00:32:17 -0000	1.56.2.13
@@ -5651,7 +5651,7 @@
 
     TNGBWProbingPacket pkt;
     CHXStaticBuffer* pBuffer = NULL;
-    CHXStaticBuffer* pSendBuf = NULL;
+    ServerBuffer* pSendBuf = NULL;
     BYTE* pc = NULL;
     UINT32 ulTemp = 0;
 
@@ -5691,7 +5691,7 @@
         pPacketData[1] = m_tcpInterleave;
         putshort(&pPacketData[2], (UINT16)ulPacketSize);
         memcpy(&pPacketData[4], pc, HX_SAFESIZE_T(ulPacketSize));
-        pSendBuf = new CHXStaticBuffer(pPacketData, ulPacketSize + 4);
+        pSendBuf = new ServerBuffer(pPacketData, ulPacketSize + 4);
 
         pSendBuf->AddRef();
         pc++;


From jgordon at helixcommunity.org  Mon Jun 13 20:00:17 2005
From: jgordon at helixcommunity.org (jgordon@helixcommunity.org)
Date: Mon Jun 13 20:00:18 2005
Subject: [Server-cvs] protocol/transport/rdt rdttran.cpp, 1.56.2.11.2.3,
	1.56.2.11.2.4
Message-ID: 

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs:/tmp/cvs-serv29038

Modified Files:
      Tag: SERVER_11_0_BETA2
	rdttran.cpp 
Log Message:
Synopsis
========
Fixes win32 build buster in server_rn/broadcast/transport/rdt/recv
and server_rn/proxy/spltplin.
Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, HEAD (SERVER_CURRENT)
Review: pending

Description
===========
ABD was changed to use a ServerBuffer directly, but the servrdtlib
is used by two plugins. ServerBuffer requires MemCache class to be
defined, but it is defined in server/engine/core and therefore not
available to plugins. This changes the direct use of ServerBuffer
to instead call CreateInstance for an IHXBuffer.


Index: rdttran.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdttran.cpp,v
retrieving revision 1.56.2.11.2.3
retrieving revision 1.56.2.11.2.4
diff -u -d -r1.56.2.11.2.3 -r1.56.2.11.2.4
--- rdttran.cpp	14 Jun 2005 00:29:54 -0000	1.56.2.11.2.3
+++ rdttran.cpp	14 Jun 2005 03:00:14 -0000	1.56.2.11.2.4
@@ -5648,7 +5648,7 @@
 
     TNGBWProbingPacket pkt;
     CHXStaticBuffer* pBuffer = NULL;
-    ServerBuffer* pSendBuf = NULL;
+    IHXBuffer* pSendBuf = NULL;
     BYTE* pc = NULL;
     UINT32 ulTemp = 0;
 
@@ -5683,14 +5683,21 @@
 
         HX_ASSERT(ulPacketSize == ulTemp);
 
-	BYTE* pPacketData = new BYTE[ulPacketSize+4];
+        hresult = m_pCommonClassFactory->CreateInstance(
+                    CLSID_IHXBuffer, (void**)&pSendBuf);
+        if (FAILED(hresult))
+        {
+            break;
+        }
+
+        pSendBuf->SetSize(ulPacketSize + 4);
+        BYTE* pPacketData = (BYTE*)pSendBuf->GetBuffer();
+
 	pPacketData[0] = '$';
 	pPacketData[1] = m_tcpInterleave;
 	putshort(&pPacketData[2], (UINT16)ulPacketSize);
         memcpy(&pPacketData[4], pc, HX_SAFESIZE_T(ulPacketSize));
-        pSendBuf = new ServerBuffer(pPacketData, ulPacketSize + 4);
 
-        pSendBuf->AddRef();
         pc++;
 
         if (SUCCEEDED(m_pTCPSocket->Write(pSendBuf)))


From jgordon at helixcommunity.org  Mon Jun 13 20:02:52 2005
From: jgordon at helixcommunity.org (jgordon@helixcommunity.org)
Date: Mon Jun 13 20:02:54 2005
Subject: [Server-cvs] protocol/transport/rdt rdttran.cpp,1.66,1.67
Message-ID: 

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs:/tmp/cvs-serv1796

Modified Files:
	rdttran.cpp 
Log Message:
Synopsis
========
Fixes win32 build buster in server_rn/broadcast/transport/rdt/recv
and server_rn/proxy/spltplin.
Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, HEAD (SERVER_CURRENT)
Review: pending

Description
===========
ABD was changed to use a ServerBuffer directly, but the servrdtlib
is used by two plugins. ServerBuffer requires MemCache class to be
defined, but it is defined in server/engine/core and therefore not
available to plugins. This changes the direct use of ServerBuffer
to instead call CreateInstance for an IHXBuffer.


Index: rdttran.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdttran.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- rdttran.cpp	14 Jun 2005 00:31:21 -0000	1.66
+++ rdttran.cpp	14 Jun 2005 03:02:49 -0000	1.67
@@ -5652,7 +5652,7 @@
 
     TNGBWProbingPacket pkt;
     CHXStaticBuffer* pBuffer = NULL;
-    ServerBuffer* pSendBuf = NULL;
+    IHXBuffer* pSendBuf = NULL;
     BYTE* pc = NULL;
     UINT32 ulTemp = 0;
 
@@ -5687,14 +5687,21 @@
 
         HX_ASSERT(ulPacketSize == ulTemp);
 
-        BYTE* pPacketData = new BYTE[ulPacketSize+4];
+        hresult = m_pCommonClassFactory->CreateInstance(
+                    CLSID_IHXBuffer, (void**)&pSendBuf);
+        if (FAILED(hresult))
+        {
+            break;
+        }
+
+        pSendBuf->SetSize(ulPacketSize + 4);
+        BYTE* pPacketData = (BYTE*)pSendBuf->GetBuffer();
+
         pPacketData[0] = '$';
         pPacketData[1] = m_tcpInterleave;
         putshort(&pPacketData[2], (UINT16)ulPacketSize);
         memcpy(&pPacketData[4], pc, HX_SAFESIZE_T(ulPacketSize));
-        pSendBuf = new ServerBuffer(pPacketData, ulPacketSize + 4);
-
-        pSendBuf->AddRef();
+        
         pc++;
 
 


From jgordon at helixcommunity.org  Mon Jun 13 20:03:20 2005
From: jgordon at helixcommunity.org (jgordon@helixcommunity.org)
Date: Mon Jun 13 20:03:22 2005
Subject: [Server-cvs] protocol/transport/rdt rdttran.cpp, 1.56.2.13,
	1.56.2.14
Message-ID: 

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs:/tmp/cvs-serv2623

Modified Files:
      Tag: SERVER_11_0_STABLE
	rdttran.cpp 
Log Message:
Synopsis
========
Fixes win32 build buster in server_rn/broadcast/transport/rdt/recv
and server_rn/proxy/spltplin.
Branches: SERVER_11_0_BETA2, SERVER_11_0_STABLE, HEAD (SERVER_CURRENT)
Review: pending

Description
===========
ABD was changed to use a ServerBuffer directly, but the servrdtlib
is used by two plugins. ServerBuffer requires MemCache class to be
defined, but it is defined in server/engine/core and therefore not
available to plugins. This changes the direct use of ServerBuffer
to instead call CreateInstance for an IHXBuffer.


Index: rdttran.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdttran.cpp,v
retrieving revision 1.56.2.13
retrieving revision 1.56.2.14
diff -u -d -r1.56.2.13 -r1.56.2.14
--- rdttran.cpp	14 Jun 2005 00:32:17 -0000	1.56.2.13
+++ rdttran.cpp	14 Jun 2005 03:03:18 -0000	1.56.2.14
@@ -5651,7 +5651,7 @@
 
     TNGBWProbingPacket pkt;
     CHXStaticBuffer* pBuffer = NULL;
-    ServerBuffer* pSendBuf = NULL;
+    IHXBuffer* pSendBuf = NULL;
     BYTE* pc = NULL;
     UINT32 ulTemp = 0;
 
@@ -5686,14 +5686,21 @@
 
         HX_ASSERT(ulPacketSize == ulTemp);
 
-        BYTE* pPacketData = new BYTE[ulPacketSize+4];
+        hresult = m_pCommonClassFactory->CreateInstance(
+                    CLSID_IHXBuffer, (void**)&pSendBuf);
+        if (FAILED(hresult))
+        {
+            break;
+        }
+
+        pSendBuf->SetSize(ulPacketSize + 4);
+        BYTE* pPacketData = (BYTE*)pSendBuf->GetBuffer();
+
         pPacketData[0] = '$';
         pPacketData[1] = m_tcpInterleave;
         putshort(&pPacketData[2], (UINT16)ulPacketSize);
         memcpy(&pPacketData[4], pc, HX_SAFESIZE_T(ulPacketSize));
-        pSendBuf = new ServerBuffer(pPacketData, ulPacketSize + 4);
 
-        pSendBuf->AddRef();
         pc++;
 
 


From Christ at keywestflorida.com  Tue Jun 14 07:19:40 2005
From: Christ at keywestflorida.com (Christophe Duckworth)
Date: Tue Jun 14 07:19:56 2005
Subject: [Server-cvs] VV-take
Message-ID: 

Hello, 
their heaviest cannon.undoing of the buccaneer.  He might reasonably have urged - had hehushed court.Captain Blood, I, too, will speak frankly; and you, too, mustLord Julian should report himself to the Deputy-Governor at Portplanted in the middle of that green space for the punishment ofHere was a cheap and ready way to discharge these claims.  Fromtreasure-ship of the fleet, with plate on board to the value ofCaptain Gardner, recognizing the finality of the tone, sighed anddenied the opportunity which his gifts entitled him to make forhave an angel for his niece? said he recklessly, for he was recklessyears ago.  To her it was just a great ship that was headingThe boats pulled away from the shore, with their loads of laughing,a jarring thud.  By then Blood was down in the waist, judging andbestow upon him those epithets in the very moment and circumstancewas held to his quivering lips.  He drank greedily, noisily, nor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050614/1d220199/attachment.htm
From murali at helixcommunity.org  Tue Jun 14 13:37:41 2005
From: murali at helixcommunity.org (murali@helixcommunity.org)
Date: Tue Jun 14 13:37:43 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.157.2.28,1.157.2.29
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv24624

Modified Files:
      Tag: SERVER_11_0_STABLE
	rtspserv.cpp 
Log Message:
Changes to get Legacy encoding(port 4040) working.


Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.28
retrieving revision 1.157.2.29
diff -u -d -r1.157.2.28 -r1.157.2.29
--- rtspserv.cpp	11 Jun 2005 20:02:01 -0000	1.157.2.28
+++ rtspserv.cpp	14 Jun 2005 20:37:38 -0000	1.157.2.29
@@ -9440,6 +9440,7 @@
                         if (pSD->GetValues(pBuffer, nValues, ppValues) == HXR_OK)
                         {
                             ULONG32 streamNumber;
+                            ULONG32 unStreamGroupNumber;
                             ULONG32 needReliable;
                             ULONG32 rtpPayloadType;
                             ULONG32 ulIsLive = 0;
@@ -9476,6 +9477,7 @@
                             for (i=0;im_bIsLive = ulIsLive ? TRUE : FALSE;
 
+                                pInfo->m_ulControlID = streamNumber;
+                                if (FAILED(ppValues[i]->GetPropertyULONG32("StreamGroupNumber",
+                                                                                unStreamGroupNumber)))
+                                {
+                                        unStreamGroupNumber = streamNumber;
+                                }
+                                pInfo->m_uStreamGroupNumber = (UINT16)unStreamGroupNumber;
+
                                 pSession->m_ppStreamInfo[streamNumber] = pInfo;
 
                                 /*


From murali at helixcommunity.org  Tue Jun 14 13:38:39 2005
From: murali at helixcommunity.org (murali@helixcommunity.org)
Date: Tue Jun 14 13:38:44 2005
Subject: [Server-cvs] protocol/transport/rdt rdttran.cpp, 1.56.2.14,
	1.56.2.15
Message-ID: 

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs:/tmp/cvs-serv25088/rdt

Modified Files:
      Tag: SERVER_11_0_STABLE
	rdttran.cpp 
Log Message:
Changes to get legacy encoding(port 4040) working.


Index: rdttran.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdttran.cpp,v
retrieving revision 1.56.2.14
retrieving revision 1.56.2.15
diff -u -d -r1.56.2.14 -r1.56.2.15
--- rdttran.cpp	14 Jun 2005 03:03:18 -0000	1.56.2.14
+++ rdttran.cpp	14 Jun 2005 20:38:37 -0000	1.56.2.15
@@ -3139,10 +3139,10 @@
     case  HX_SOCK_EVENT_READ:
         if (SUCCEEDED(m_pUDPSocket->Read(&pBuf)))
         {
-            HX_ASSERT(m_bIsSource);
             m_pResp->PacketReady(HXR_OK, m_sessionID, NULL);
 
             rc = handlePacket(pBuf);
+            releasePackets();
         }
 
         HX_RELEASE(pBuf);


From murali at helixcommunity.org  Tue Jun 14 13:42:19 2005
From: murali at helixcommunity.org (murali@helixcommunity.org)
Date: Tue Jun 14 13:42:21 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.185,1.186
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv28663

Modified Files:
	rtspserv.cpp 
Log Message:
Changes to get legacy encoding(port 4040) working.


Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- rtspserv.cpp	11 Jun 2005 20:02:09 -0000	1.185
+++ rtspserv.cpp	14 Jun 2005 20:42:16 -0000	1.186
@@ -9439,6 +9439,7 @@
                         if (pSD->GetValues(pBuffer, nValues, ppValues) == HXR_OK)
                         {
                             ULONG32 streamNumber;
+                            ULONG32 unStreamGroupNumber;
                             ULONG32 needReliable;
                             ULONG32 rtpPayloadType;
                             ULONG32 ulIsLive = 0;
@@ -9475,6 +9476,7 @@
                             for (i=0;im_bIsLive = ulIsLive ? TRUE : FALSE;
 
+                                pInfo->m_ulControlID = streamNumber;
+                                if (FAILED(ppValues[i]->GetPropertyULONG32("StreamGroupNumber",
+                                                                                unStreamGroupNumber)))
+                                {
+                                        unStreamGroupNumber = streamNumber;
+                                }
+                                pInfo->m_uStreamGroupNumber = (UINT16)unStreamGroupNumber;
+
                                 pSession->m_ppStreamInfo[streamNumber] = pInfo;
 
                                 /*


From murali at helixcommunity.org  Tue Jun 14 13:43:22 2005
From: murali at helixcommunity.org (murali@helixcommunity.org)
Date: Tue Jun 14 13:43:23 2005
Subject: [Server-cvs] protocol/transport/rdt rdttran.cpp,1.67,1.68
Message-ID: 

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs:/tmp/cvs-serv30602/rdt

Modified Files:
	rdttran.cpp 
Log Message:
Changes to get legacy encoding(port 4040) working.


Index: rdttran.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdttran.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- rdttran.cpp	14 Jun 2005 03:02:49 -0000	1.67
+++ rdttran.cpp	14 Jun 2005 20:43:19 -0000	1.68
@@ -3138,10 +3138,10 @@
     case  HX_SOCK_EVENT_READ:
         if (SUCCEEDED(m_pUDPSocket->Read(&pBuf)))
         {
-            HX_ASSERT(m_bIsSource);
             m_pResp->PacketReady(HXR_OK, m_sessionID, NULL);
 
             rc = handlePacket(pBuf);
+	    releasePackets();
         }
 
         HX_RELEASE(pBuf);


From ArchLeon_4409 at fsltechnologies.com  Wed Jun 15 05:26:54 2005
From: ArchLeon_4409 at fsltechnologies.com (Leon Archer)
Date: Wed Jun 15 05:27:06 2005
Subject: [Server-cvs] GigaaMedz
Message-ID: 

Hello, 
On the contrary, it is because I did it that I am here.blame him, that in the end he succumbed?  And remember that theseyour mistake in my own way.believing it part of a world tormented by strife and bloodshed.it had neither walls nor bars, however spacious it might be.  Andto the arch-scoundrel who commanded them, and so deliver you fromlast about to be separated from this man with whom he had stoodthing of all.  He crushed her to him brutally, deliberately hurtfulthick black hair, once so sedulously curled, hung now in a lank,of it took him, and he yielded to it.addressed to a grande of Spain, heavily sealed with the arms ofBut my dear Don Pedro!  The Spaniard's tone was one of amusedto be able to recollect whither they were bound?Guns off Port Royal... that should argue Colonel Bishop at work.the beard of the King of France, and we'll take him this time, ifNot so daft as you when you talk of fighting that.  He flung out
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/server-cvs/attachments/20050615/b3d16768/attachment.htm
From jgordon at helixcommunity.org  Wed Jun 15 11:01:01 2005
From: jgordon at helixcommunity.org (jgordon@helixcommunity.org)
Date: Wed Jun 15 11:01:03 2005
Subject: [Server-cvs] engine/core _main.cpp,1.75.2.18,1.75.2.19
Message-ID: 

Update of /cvsroot/server/engine/core
In directory cvs:/tmp/cvs-serv18036

Modified Files:
      Tag: SERVER_11_0_STABLE
	_main.cpp 
Log Message:
Synopsis
========
Adds a handler to treat a win32 pure virtual function call as a CA,
printing the stack and recovering.
Branches: SERVER_11_0_STABLE, HEAD, SERVER_11_0_BETA2 ??
Reviewed By: dcollins


Description
===========
Adds a pure virtual call handler that raises a custom exception
in order to CA. On release builds, the stack we get in the pure call
handler is missing the top most stack frame, greatly reducing the
usefulness, but is still much better than exiting with no stack at
all. We will hopefully find a solution to this problem. Debug builds
will print a full correct stack as is.

I used 1 for the exception code, but I'm not really sure what the best
value is. The highest bit is ignored and the standard exceptions use
0xC0000xxxx, so low values won't conflict.

Also adds the exception code to CA print out (mirroring the line
printing the signal in Unix) so we can determine the type of error
that occurred.


Index: _main.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/_main.cpp,v
retrieving revision 1.75.2.18
retrieving revision 1.75.2.19
diff -u -d -r1.75.2.18 -r1.75.2.19
--- _main.cpp	1 Jun 2005 21:43:07 -0000	1.75.2.18
+++ _main.cpp	15 Jun 2005 18:00:59 -0000	1.75.2.19
@@ -2014,6 +2014,7 @@
 
 #ifdef _WIN32
     ptr += sprintf(ptr, "TID %lu\n", GetCurrentThreadId());
+    ptr += sprintf(ptr, "Caught Exception %x\n", code);
 #else
 #ifdef PTHREADS_SUPPORTED
     ptr += sprintf(ptr, "TID %lu\n", pthread_self());
@@ -2165,10 +2166,11 @@
 #ifdef _WIN32
 
 //#include "hxtrace.h"
+#define HLXSERVER_PURECALL_EXCEPTION 0x1
 int g_got_dummy_call = 1;
 
 void
-dummy_call()
+dummy_call(DWORD code)
 {
     g_got_dummy_call = 1;
 
@@ -2191,7 +2193,7 @@
         }
 
         GetCrashPrintLock();
-        dump_info(FALSE, CrashState, 0, 0);
+        dump_info(FALSE, CrashState, 0, code);
         ReleaseCrashPrintLock();
 
         CrashState = NO_FAULT;
@@ -2209,7 +2211,7 @@
     {
         CrashState = IN_FAULT_DOUBLE_FAULT_HANDLER;
 
-        dump_info(FALSE, CrashState, "Double Fault, No Trace", 0);
+        dump_info(FALSE, CrashState, "Double Fault, No Trace", code);
         ReleaseCrashPrintLock(); // was locked in first crash handler
 
         CrashState = NO_FAULT;
@@ -2252,6 +2254,7 @@
 server_fault(_EXCEPTION_POINTERS *pExceptionInfo)
 {
     CONTEXT* pContext = pExceptionInfo->ContextRecord;
+    DWORD code = pExceptionInfo->ExceptionRecord->ExceptionCode;
     g_last_known_eip = pContext->Eip;
     g_last_known_ebp = pContext->Ebp;
 
@@ -2279,7 +2282,7 @@
      */
     if (bSafeToLJFromHere && b_dummy_ok)
     {
-        dummy_call();
+        dummy_call(code);
     }
     else
     {
@@ -2291,6 +2294,12 @@
     return EXCEPTION_CONTINUE_EXECUTION;
 }
 
+void
+PurecallHandler(void)
+{
+    RaiseException(HLXSERVER_PURECALL_EXCEPTION, 0, 0, NULL);
+}
+
 #endif /* _WIN32 */
 #ifdef _UNIX
 
@@ -5759,6 +5768,7 @@
     {
         SetUnhandledExceptionFilter(
             (LPTOP_LEVEL_EXCEPTION_FILTER)server_fault);
+        _set_purecall_handler(PurecallHandler);
     }
 
 #endif


From jgordon at helixcommunity.org  Wed Jun 15 11:04:52 2005
From: jgordon at helixcommunity.org (jgordon@helixcommunity.org)
Date: Wed Jun 15 11:04:55 2005
Subject: [Server-cvs] engine/core _main.cpp,1.75.2.14.2.2,1.75.2.14.2.3
Message-ID: 

Update of /cvsroot/server/engine/core
In directory cvs:/tmp/cvs-serv25793

Modified Files:
      Tag: SERVER_11_0_BETA2
	_main.cpp 
Log Message:
Synopsis
========
Adds a handler to treat a pure virtual function call as a CA,
printing the stack and recovering.
Branches: SERVER_11_0_STABLE, HEAD, SERVER_11_0_BETA2
Reviewed By: dcollins


Description
===========
Adds a pure virtual call handler that raises a custom exception
in order to CA. On release builds, the stack we get in the pure call
handler is missing the top most stack frame, greatly reducing the
usefulness, but is still much better than exiting with no stack at
all. We will hopefully find a solution to this problem. Debug builds
will print a full correct stack as is.

I used 1 for the exception code, but I'm not really sure what the best
value is. The highest bit is ignored and the standard exceptions use
0xC0000xxxx, so low values won't conflict.

Also adds the exception code to CA print out (mirroring the line
printing the signal in Unix) so we can determine the type of error
that occurred.


Index: _main.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/_main.cpp,v
retrieving revision 1.75.2.14.2.2
retrieving revision 1.75.2.14.2.3
diff -u -d -r1.75.2.14.2.2 -r1.75.2.14.2.3
--- _main.cpp	20 May 2005 00:21:01 -0000	1.75.2.14.2.2
+++ _main.cpp	15 Jun 2005 18:04:50 -0000	1.75.2.14.2.3
@@ -2003,6 +2003,7 @@
 
 #ifdef _WIN32
     ptr += sprintf(ptr, "TID %lu\n", GetCurrentThreadId());
+    ptr += sprintf(ptr, "Caught Exception %x\n", code);
 #else
 #ifdef PTHREADS_SUPPORTED
     ptr += sprintf(ptr, "TID %lu\n", pthread_self());
@@ -2154,10 +2155,11 @@
 #ifdef _WIN32
 
 //#include "hxtrace.h"
+#define HLXSERVER_PURECALL_EXCEPTION 0x1
 int g_got_dummy_call = 1;
 
 void
-dummy_call()
+dummy_call(DWORD code)
 {
     g_got_dummy_call = 1;
 
@@ -2180,7 +2182,7 @@
         }
 
         GetCrashPrintLock();
-        dump_info(FALSE, CrashState, 0, 0);
+        dump_info(FALSE, CrashState, 0, code);
         ReleaseCrashPrintLock();
 
         CrashState = NO_FAULT;
@@ -2198,7 +2200,7 @@
     {
         CrashState = IN_FAULT_DOUBLE_FAULT_HANDLER;
 
-        dump_info(FALSE, CrashState, "Double Fault, No Trace", 0);
+        dump_info(FALSE, CrashState, "Double Fault, No Trace", code);
         ReleaseCrashPrintLock(); // was locked in first crash handler
 
         CrashState = NO_FAULT;
@@ -2241,6 +2243,7 @@
 server_fault(_EXCEPTION_POINTERS *pExceptionInfo)
 {
     CONTEXT* pContext = pExceptionInfo->ContextRecord;
+    DWORD code = pExceptionInfo->ExceptionRecord->ExceptionCode;
     g_last_known_eip = pContext->Eip;
     g_last_known_ebp = pContext->Ebp;
 
@@ -2268,7 +2271,7 @@
      */
     if (bSafeToLJFromHere && b_dummy_ok)
     {
-        dummy_call();
+        dummy_call(code);
     }
     else
     {
@@ -2280,6 +2283,12 @@
     return EXCEPTION_CONTINUE_EXECUTION;
 }
 
+void
+PurecallHandler(void)
+{
+    RaiseException(HLXSERVER_PURECALL_EXCEPTION, 0, 0, NULL);
+}
+
 #endif /* _WIN32 */
 #ifdef _UNIX
 
@@ -5737,6 +5746,7 @@
     {
         SetUnhandledExceptionFilter(
             (LPTOP_LEVEL_EXCEPTION_FILTER)server_fault);
+        _set_purecall_handler(PurecallHandler);
     }
 
 #endif


From jgordon at helixcommunity.org  Wed Jun 15 11:09:48 2005
From: jgordon at helixcommunity.org (jgordon@helixcommunity.org)
Date: Wed Jun 15 11:09:49 2005
Subject: [Server-cvs] engine/core _main.cpp,1.92,1.93
Message-ID: 

Update of /cvsroot/server/engine/core
In directory cvs:/tmp/cvs-serv28664

Modified Files:
	_main.cpp 
Log Message:
Synopsis
========
Adds a handler to treat a pure virtual function call as a CA,
printing the stack and recovering.
Branches: SERVER_11_0_STABLE, HEAD, SERVER_11_0_BETA2
Reviewed By: dcollins


Description
===========
Adds a pure virtual call handler that raises a custom exception
in order to CA. On release builds, the stack we get in the pure call
handler is missing the top most stack frame, greatly reducing the
usefulness, but is still much better than exiting with no stack at
all. We will hopefully find a solution to this problem. Debug builds
will print a full correct stack as is.

I used 1 for the exception code, but I'm not really sure what the best
value is. The highest bit is ignored and the standard exceptions use
0xC0000xxxx, so low values won't conflict.

Also adds the exception code to CA print out (mirroring the line
printing the signal in Unix) so we can determine the type of error
that occurred.


Index: _main.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/_main.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- _main.cpp	3 Jun 2005 01:15:33 -0000	1.92
+++ _main.cpp	15 Jun 2005 18:09:46 -0000	1.93
@@ -2014,6 +2014,7 @@
 
 #ifdef _WIN32
     ptr += sprintf(ptr, "TID %lu\n", GetCurrentThreadId());
+    ptr += sprintf(ptr, "Caught Exception %x\n", code);
 #else
 #ifdef PTHREADS_SUPPORTED
     ptr += sprintf(ptr, "TID %lu\n", pthread_self());
@@ -2165,10 +2166,11 @@
 #ifdef _WIN32
 
 //#include "hxtrace.h"
+#define HLXSERVER_PURECALL_EXCEPTION 0x1
 int g_got_dummy_call = 1;
 
 void
-dummy_call()
+dummy_call(DWORD code)
 {
     g_got_dummy_call = 1;
 
@@ -2191,7 +2193,7 @@
         }
 
         GetCrashPrintLock();
-        dump_info(FALSE, CrashState, 0, 0);
+        dump_info(FALSE, CrashState, 0, code);
         ReleaseCrashPrintLock();
 
         CrashState = NO_FAULT;
@@ -2209,7 +2211,7 @@
     {
         CrashState = IN_FAULT_DOUBLE_FAULT_HANDLER;
 
-        dump_info(FALSE, CrashState, "Double Fault, No Trace", 0);
+        dump_info(FALSE, CrashState, "Double Fault, No Trace", code);
         ReleaseCrashPrintLock(); // was locked in first crash handler
 
         CrashState = NO_FAULT;
@@ -2252,6 +2254,7 @@
 server_fault(_EXCEPTION_POINTERS *pExceptionInfo)
 {
     CONTEXT* pContext = pExceptionInfo->ContextRecord;
+    DWORD code = pExceptionInfo->ExceptionRecord->ExceptionCode;
     g_last_known_eip = pContext->Eip;
     g_last_known_ebp = pContext->Ebp;
 
@@ -2279,7 +2282,7 @@
      */
     if (bSafeToLJFromHere && b_dummy_ok)
     {
-        dummy_call();
+        dummy_call(code);
     }
     else
     {
@@ -2291,6 +2294,12 @@
     return EXCEPTION_CONTINUE_EXECUTION;
 }
 
+void
+PurecallHandler(void)
+{
+    RaiseException(HLXSERVER_PURECALL_EXCEPTION, 0, 0, NULL);
+}
+
 #endif /* _WIN32 */
 #ifdef _UNIX
 
@@ -5758,6 +5767,7 @@
     {
         SetUnhandledExceptionFilter(
             (LPTOP_LEVEL_EXCEPTION_FILTER)server_fault);
+        _set_purecall_handler(PurecallHandler);
     }
 
 #endif


From dcollins at helixcommunity.org  Wed Jun 15 15:24:32 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Wed Jun 15 15:24:34 2005
Subject: [Server-cvs] common/analysis rss2tdf,1.32,1.33
Message-ID: 

Update of /cvsroot/server/common/analysis
In directory cvs:/tmp/cvs-serv24838

Modified Files:
	rss2tdf 
Log Message:
Fix parsing of "Players by Protocol" RSS section for Seneca.


Index: rss2tdf
===================================================================
RCS file: /cvsroot/server/common/analysis/rss2tdf,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- rss2tdf	23 May 2005 18:47:58 -0000	1.32
+++ rss2tdf	15 Jun 2005 22:24:30 -0000	1.33
@@ -625,9 +625,12 @@
     }
     elsif ($nMajorVer >= 9 && /Players by Protocol:/)
     {
-
-        ($nPNAPct, $nRTSPPct, $nMMSPct, $nHTTPPct, $nCloakedPct) = $_ =~
-            /(\d*)% PNA, (\d*)% RTSP, (\d*)% MMS, (\d*)% HTTP \((\d*)% Cloaked\)/;
+        ($nRTSPPct, $nMMSPct, $nHTTPPct, $nCloakedPct) = $_ =~
+            /(\d*)% RTSP, (\d*)% MMS, (\d*)% HTTP \((\d*)% Cloaked\)/;
+        if ($nMajorVer <= 10)  #No PNA support in 11.0 and later
+        {
+            ($nPNAPct) = $_ =~ /(\d*)% PNA/;
+        }
     }
     elsif (/Players by Transport:/)
     {


From dcollins at helixcommunity.org  Wed Jun 15 15:24:54 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Wed Jun 15 15:24:54 2005
Subject: [Server-cvs] common/analysis playerbyprot.plt,1.17,1.18
Message-ID: 

Update of /cvsroot/server/common/analysis
In directory cvs:/tmp/cvs-serv25523

Modified Files:
	playerbyprot.plt 
Log Message:
make generating the PNA graph optional


Index: playerbyprot.plt
===================================================================
RCS file: /cvsroot/server/common/analysis/playerbyprot.plt,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- playerbyprot.plt	23 May 2005 18:48:31 -0000	1.17
+++ playerbyprot.plt	15 Jun 2005 22:24:51 -0000	1.18
@@ -107,6 +107,7 @@
 #setifnotgiven smrecty2 = 3
 
 #setifnotgiven maxcurvepoints = 1000000
+#setifnotgiven showpnaplayers = "yes"
 
 #proc areadef
     titledetails: size=20 align=C style=B
@@ -176,6 +177,7 @@
 //
 // Do PNA players (pna)
 //
+#if @showpnaplayers != "no"
 #proc areadef
     #clone: A
 #endproc
@@ -197,6 +199,7 @@
     order: 10
     maxinpoints: @maxcurvepoints
 #endproc
+#endif
  
 
 //////////////////////////////////////////////////////////////////////


From tmarshall at helixcommunity.org  Wed Jun 15 15:43:29 2005
From: tmarshall at helixcommunity.org (tmarshall@helixcommunity.org)
Date: Wed Jun 15 15:43:31 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.100.2.38,1.100.2.39
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv9502

Modified Files:
      Tag: SERVER_10_1_STABLE
	rtspserv.cpp 
Log Message:
Fix CA when session is referenced after a failed DESCRIBE.

Fixes 140115



Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.100.2.38
retrieving revision 1.100.2.39
diff -u -d -r1.100.2.38 -r1.100.2.39
--- rtspserv.cpp	13 Jun 2005 18:05:45 -0000	1.100.2.38
+++ rtspserv.cpp	15 Jun 2005 22:43:27 -0000	1.100.2.39
@@ -10128,6 +10128,18 @@
 
                 IHXBuffer* pSessionStatsObjId = NULL;
 
+                if (!pSessionItemCurrent || !pSessionNew)
+                {
+                    // The Session requested does not exist.
+
+                    sendResponseCode(454);
+
+                    m_pResp->HandleSetupRequest(HXR_NO_SESSION_ID);
+
+                    rc = HXR_FAIL;
+                    break;
+                }
+
                 // Store client requested stream url for RTP-Info
                 HX_ASSERT(pSessionNew->m_pStreamUrl == NULL);
                 ulURLSize = pURL->GetSize(); // Use the full requseted url
@@ -10142,18 +10154,6 @@
                 HX_RELEASE(pSessionStatsObjId);
 
 
-                if (!pSessionItemCurrent || !pSessionNew)
-                {
-                    // The Session requested does not exist.
-
-                    sendResponseCode(454);
-
-                    m_pResp->HandleSetupRequest(HXR_NO_SESSION_ID);
-
-                    rc = HXR_FAIL;
-                    break;
-                }
-
                 pSessionItemCurrent->m_bSetup = TRUE;
 
                 // Save Seq Num for use when making the reply message


From dcollins at helixcommunity.org  Wed Jun 15 16:07:36 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Wed Jun 15 16:07:38 2005
Subject: [Server-cvs] 
	common/analysis fastfile.plt, 1.4, 1.5 memory.plt, 1.4,
	1.5 perf.plt, 1.29, 1.30
Message-ID: 

Update of /cvsroot/server/common/analysis
In directory cvs:/tmp/cvs-serv2224

Modified Files:
	fastfile.plt memory.plt perf.plt 
Log Message:
adjust y-axis scaling for some data fields to accomodate larger values


Index: memory.plt
===================================================================
RCS file: /cvsroot/server/common/analysis/memory.plt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- memory.plt	23 May 2005 18:48:31 -0000	1.4
+++ memory.plt	15 Jun 2005 23:07:34 -0000	1.5
@@ -309,9 +309,12 @@
     #elseif @mempagerange <= 500000.0
         stubs: inc 50000
         minorticinc: 5000
-    #else
+    #elseif @mempagerange <= 1000000.0
         stubs: inc 100000
         minorticinc: 10000
+    #else
+        stubs: inc 1000000
+        minorticinc: 100000
     #endif
     #saveas: YA_MEMOPS
 #endproc

Index: fastfile.plt
===================================================================
RCS file: /cvsroot/server/common/analysis/fastfile.plt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- fastfile.plt	23 May 2005 18:48:31 -0000	1.4
+++ fastfile.plt	15 Jun 2005 23:07:34 -0000	1.5
@@ -390,9 +390,21 @@
     #elseif @fastbpsrange <= 5000.0
         stubs: inc 500
         minorticinc: 25
-    #else
+    #elseif @fastbpsrange <= 10000.0
         stubs: inc 1000
+        minorticinc: 10
+    #elseif @fastbpsrange <= 100000.0
+        stubs: inc 10000
         minorticinc: 100
+    #elseif @fastbpsrange <= 1000000.0
+        stubs: inc 100000
+        minorticinc: 1000
+    #elseif @fastbpsrange <= 10000000.0
+        stubs: inc 1000000
+        minorticinc: 10000
+    #else
+        stubs: inc 100000000
+        minorticinc: 10000000
     #endif
     #saveas: YA_READS
 #endproc

Index: perf.plt
===================================================================
RCS file: /cvsroot/server/common/analysis/perf.plt,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- perf.plt	23 May 2005 18:48:31 -0000	1.29
+++ perf.plt	15 Jun 2005 23:07:34 -0000	1.30
@@ -526,9 +526,21 @@
     #elseif @schedrange <= 5000.0
         stubs: inc 500
         minorticinc: 25
-    #else
+    #elseif @schedrange <= 10000.0
         stubs: inc 1000
         minorticinc: 100
+    #elseif @schedrange <= 100000.0
+        stubs: inc 10000
+        minorticinc: 1000
+    #elseif @schedrange <= 1000000.0
+        stubs: inc 100000
+        minorticinc: 10000
+    #elseif @schedrange <= 10000000.0
+        stubs: inc 1000000
+        minorticinc: 100000
+    #else
+        stubs: inc 10000000
+        minorticinc: 1000000
     #endif
     #saveas: YA_SCHED
 #endproc


From tmarshall at helixcommunity.org  Wed Jun 15 16:08:54 2005
From: tmarshall at helixcommunity.org (tmarshall@helixcommunity.org)
Date: Wed Jun 15 16:08:56 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.157.2.29,1.157.2.30
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv2701

Modified Files:
      Tag: SERVER_11_0_STABLE
	rtspserv.cpp 
Log Message:
Fix CA when session is referenced after a failed DESCRIBE.

Fixes 140115
CR ghori



Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.29
retrieving revision 1.157.2.30
diff -u -d -r1.157.2.29 -r1.157.2.30
--- rtspserv.cpp	14 Jun 2005 20:37:38 -0000	1.157.2.29
+++ rtspserv.cpp	15 Jun 2005 23:08:51 -0000	1.157.2.30
@@ -10055,6 +10055,18 @@
 
                 IHXBuffer* pSessionStatsObjId = NULL;
 
+                if (!pSessionItemCurrent || !pSessionNew)
+                {
+                    // The Session requested does not exist.
+
+                    SendResponse(454);
+
+                    m_pResp->HandleSetupRequest(HXR_NO_SESSION_ID);
+
+                    rc = HXR_FAIL;
+                    break;
+                }
+
                 // Store client requested stream url for RTP-Info
                 HX_ASSERT(pSessionNew->m_pStreamUrl == NULL);
                 ulURLSize = pURL->GetSize(); // Use the full requseted url
@@ -10101,18 +10113,6 @@
                     bUpdatedEvents = TRUE;
                 }
 
-                if (!pSessionItemCurrent || !pSessionNew)
-                {
-                    // The Session requested does not exist.
-
-                    SendResponse(454);
-
-                    m_pResp->HandleSetupRequest(HXR_NO_SESSION_ID);
-
-                    rc = HXR_FAIL;
-                    break;
-                }
-
                 pSessionItemCurrent->m_bSetup = TRUE;
 
                 // Save Seq Num for use when making the reply message


From tmarshall at helixcommunity.org  Wed Jun 15 16:09:55 2005
From: tmarshall at helixcommunity.org (tmarshall@helixcommunity.org)
Date: Wed Jun 15 16:09:59 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.186,1.187
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv2824

Modified Files:
	rtspserv.cpp 
Log Message:
Fix CA when session is referenced after a failed DESCRIBE.

Fixes 140115
CR ghori



Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -d -r1.186 -r1.187
--- rtspserv.cpp	14 Jun 2005 20:42:16 -0000	1.186
+++ rtspserv.cpp	15 Jun 2005 23:09:53 -0000	1.187
@@ -10054,6 +10054,18 @@
 
                 IHXBuffer* pSessionStatsObjId = NULL;
 
+                if (!pSessionItemCurrent || !pSessionNew)
+                {
+                    // The Session requested does not exist.
+
+                    SendResponse(454);
+
+                    m_pResp->HandleSetupRequest(HXR_NO_SESSION_ID);
+
+                    rc = HXR_FAIL;
+                    break;
+                }
+
                 // Store client requested stream url for RTP-Info
                 HX_ASSERT(pSessionNew->m_pStreamUrl == NULL);
                 ulURLSize = pURL->GetSize(); // Use the full requseted url
@@ -10100,18 +10112,6 @@
                     bUpdatedEvents = TRUE;
                 }
 
-                if (!pSessionItemCurrent || !pSessionNew)
-                {
-                    // The Session requested does not exist.
-
-                    SendResponse(454);
-
-                    m_pResp->HandleSetupRequest(HXR_NO_SESSION_ID);
-
-                    rc = HXR_FAIL;
-                    break;
-                }
-
                 pSessionItemCurrent->m_bSetup = TRUE;
 
                 // Save Seq Num for use when making the reply message


From dcollins at helixcommunity.org  Wed Jun 15 18:36:55 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Wed Jun 15 18:36:59 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp, 1.157.2.23.2.5,
	1.157.2.23.2.6
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv31466

Modified Files:
      Tag: SERVER_11_0_BETA2
	rtspserv.cpp 
Log Message:
Synopsis
========
Fixes PR 142452 proxy uptime: proxy exits after "pure virtual function call" message

Branches: SERVER_11_0_BETA2_RN, SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
Suggested Reviewer:  JJ, anyone


Description
===========
PR 142452 is related to a pure virtual function call error that was
causing the Windows proxy to exit without reporting any useful information
about the problem.

First of all, JJ actually fixed this, not me.  He sent me the diff,
then told me how to fix it when it wasn't entirely correct, so he gets
all the credit on this one.

Thanks to Jamie's seperate check-in to catch pure virtual function call
errors on Windows and handle them like normal CAs, we were able to clearly
isolate the problem and verify the fix.  Without that change it was very
difficult to track down the cause of the problem.

The error that this diff fixes is a bit of a race condition, where
the non-COM pMsg object was getting deleted in some situations
while a pointer was still held to it and being used.


Files Affected
==============

server/protocol/rtsp/rtspserv.cpp


Testing Performed
=================

Unit Tests:
- Printfs used to verify section of code was related to the virt. fn. error.

Integration Tests:
- Ran proxy bits in a BETA2 uptime rig, with and without the change to repro
  the problem and verify the fix.

Leak Tests:
- None.

Performance Tests:
- None.

Platforms Tested: win32-i386-vc7
Build verified:   win32-i386-vc7


QA Hints
===============

Regress PR 142452 with a new BETA2 uptime.




Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.23.2.5
retrieving revision 1.157.2.23.2.6
diff -u -d -r1.157.2.23.2.5 -r1.157.2.23.2.6
--- rtspserv.cpp	11 Jun 2005 20:01:44 -0000	1.157.2.23.2.5
+++ rtspserv.cpp	16 Jun 2005 01:36:53 -0000	1.157.2.23.2.6
@@ -1246,9 +1246,13 @@
             (*m_pKeepAlivePendingMessages)[m_ulLastSeqNo+1] =
                 new_string(pSession->m_sessionID);
         }
-        sendRequest(pMsg, ++m_ulLastSeqNo);
 
-        OnServerRequestEvent(pMsg, NULL, pSession);
+        rc = OnServerRequestEvent(pMsg, NULL, pSession);
+
+        if (SUCCEEDED(rc))
+        {
+            rc = sendRequest(pMsg, ++m_ulLastSeqNo);
+        }
     }
     else
     {


From dcollins at helixcommunity.org  Wed Jun 15 18:37:13 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Wed Jun 15 18:37:14 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.157.2.30,1.157.2.31
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv31634

Modified Files:
      Tag: SERVER_11_0_STABLE
	rtspserv.cpp 
Log Message:
Synopsis
========
Fixes PR 142452 proxy uptime: proxy exits after "pure virtual function call" message

Branches: SERVER_11_0_BETA2_RN, SERVER_11_0_STABLE_RN, SERVER_CURRENT_RN
Suggested Reviewer:  JJ, anyone


Description
===========
PR 142452 is related to a pure virtual function call error that was
causing the Windows proxy to exit without reporting any useful information
about the problem.

First of all, JJ actually fixed this, not me.  He sent me the diff,
then told me how to fix it when it wasn't entirely correct, so he gets
all the credit on this one.

Thanks to Jamie's seperate check-in to catch pure virtual function call
errors on Windows and handle them like normal CAs, we were able to clearly
isolate the problem and verify the fix.  Without that change it was very
difficult to track down the cause of the problem.

The error that this diff fixes is a bit of a race condition, where
the non-COM pMsg object was getting deleted in some situations
while a pointer was still held to it and being used.


Files Affected
==============

server/protocol/rtsp/rtspserv.cpp


Testing Performed
=================

Unit Tests:
- Printfs used to verify section of code was related to the virt. fn. error.

Integration Tests:
- Ran proxy bits in a BETA2 uptime rig, with and without the change to repro
  the problem and verify the fix.

Leak Tests:
- None.

Performance Tests:
- None.

Platforms Tested: win32-i386-vc7
Build verified:   win32-i386-vc7


QA Hints
===============

Regress PR 142452 with a new BETA2 uptime.




Index: rtspserv.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/rtspserv.cpp,v
retrieving revision 1.157.2.30
retrieving revision 1.157.2.31
diff -u -d -r1.157.2.30 -r1.157.2.31
--- rtspserv.cpp	15 Jun 2005 23:08:51 -0000	1.157.2.30
+++ rtspserv.cpp	16 Jun 2005 01:37:10 -0000	1.157.2.31
@@ -1256,9 +1256,13 @@
             (*m_pKeepAlivePendingMessages)[m_ulLastSeqNo+1] =
                 new_string(pSession->m_sessionID);
         }
-        sendRequest(pMsg, ++m_ulLastSeqNo);
 
-        OnServerRequestEvent(pMsg, NULL, pSession);
+        rc = OnServerRequestEvent(pMsg, NULL, pSession);
+
+        if (SUCCEEDED(rc))
+        {
+            rc = sendRequest(pMsg, ++m_ulLastSeqNo);
+        }
     }
     else
     {


From dcollins at helixcommunity.org  Wed Jun 15 18:37:26 2005
From: dcollins at helixcommunity.org (dcollins@helixcommunity.org)
Date: Wed Jun 15 18:37:27 2005
Subject: [Server-cvs] protocol/rtsp rtspserv.cpp,1.187,1.188
Message-ID: 

Update of /cvsroot/server/protocol/rtsp
In directory cvs:/tmp/cvs-serv31