(file) Return to http.c CVS log (file) (dir) Up to [OMI] / omi / http

Diff for /omi/http/http.c between version 1.3 and 1.4

version 1.3, 2015/04/20 18:19:52 version 1.4, 2015/09/25 20:24:20
Line 29 
Line 29 
 #include <sock/sock.h> #include <sock/sock.h>
 #include <sock/selector.h> #include <sock/selector.h>
 #include <pal/sleep.h> #include <pal/sleep.h>
   #include <pal/intsafe.h>
 #include <base/buf.h> #include <base/buf.h>
 #include <base/log.h> #include <base/log.h>
 #include <base/result.h> #include <base/result.h>
Line 649 
Line 650 
  
     }     }
  
       size_t allocSize = 0;
       if (SizeTAdd(sizeof(Page), handler->recvHeaders.contentLength, &allocSize) == S_OK &&
           SizeTAdd(allocSize, 1, &allocSize) == S_OK)
       {
     /* Allocate zero-terminated buffer */     /* Allocate zero-terminated buffer */
     handler->recvPage = (Page*)PAL_Malloc(sizeof(Page) + handler->recvHeaders.contentLength + 1);          handler->recvPage = (Page*)PAL_Malloc(allocSize);
       }
       else
       {
           // Overflow
           return PRT_RETURN_FALSE;
       }
  
     if (!handler->recvPage)     if (!handler->recvPage)
         return PRT_RETURN_FALSE;         return PRT_RETURN_FALSE;
Line 1229 
Line 1240 
  
     if (mask & SELECTOR_READ)     if (mask & SELECTOR_READ)
     {     {
         int count;  
   
         for (count = 0; count < 5; count++)  
         {  
             /* Accept the incoming connection */             /* Accept the incoming connection */
             r = Sock_Accept(handler->base.sock, &s, &addr);             r = Sock_Accept(handler->base.sock, &s, &addr);
  
Line 1303 
Line 1310 
                     Sock_Close(s);                     Sock_Close(s);
                     return MI_TRUE;                     return MI_TRUE;
                 }                 }
   
             }             }
  
             /* Watch for read events on the incoming connection */             /* Watch for read events on the incoming connection */
Line 1328 
Line 1334 
                 NULL,                 NULL,
                 MI_TRUE );                 MI_TRUE );
         }         }
     }  
  
     if ((mask & SELECTOR_REMOVE) != 0 ||     if ((mask & SELECTOR_REMOVE) != 0 ||
         (mask & SELECTOR_DESTROY) != 0)         (mask & SELECTOR_DESTROY) != 0)
Line 1714 
Line 1719 
     /* Run the selector */     /* Run the selector */
     return Selector_Run(self->selector, timeoutUsec, MI_FALSE);     return Selector_Run(self->selector, timeoutUsec, MI_FALSE);
 } }
   


Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

ViewCVS 0.9.2