Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/system/Basis/Implementation/Sockets/win32-socket.sml
ViewVC logotype

Diff of /sml/trunk/src/system/Basis/Implementation/Sockets/win32-socket.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1380, Wed Sep 17 20:20:51 2003 UTC revision 1381, Wed Sep 17 21:28:41 2003 UTC
# Line 202  Line 202 
202    
203      type 'a buf = {buf : 'a, i : int, sz : int option}      type 'a buf = {buf : 'a, i : int, sz : int option}
204    
205      local      val vbuf = Word8VectorSlice.base
206        fun chk (len, buf, i, NONE) =      val abuf = Word8ArraySlice.base
             if ((i < 0) orelse (len < i))  
               then raise Subscript  
               else (buf, i, len - i)  
         | chk (len, buf, i, SOME sz) =  
             if ((i < 0) orelse (sz < 0) orelse (len-i < sz))  
               then raise Subscript  
               else (buf, i, sz)  
     in  
     fun vbuf {buf, i, sz} = chk (W8V.length buf, buf, i, sz)  
     fun abuf {buf, i, sz} = chk (W8A.length buf, buf, i, sz)  
     end (* local *)  
207    
208    (* default flags *)    (* default flags *)
209      val dfltDon'tRoute = false      val dfltDon'tRoute = false
# Line 328  Line 317 
317              = sockFn "recvBufFrom"              = sockFn "recvBufFrom"
318      in      in
319      fun recvVecFrom (sock, sz) = recvFromV (sock, sz, dfltPeek, dfltOOB)      fun recvVecFrom (sock, sz) = recvFromV (sock, sz, dfltPeek, dfltOOB)
320      fun recvArrFrom (SOCK fd, {buf, i}) = let      fun recvArrFrom (SOCK fd, asl) = let
321            val (buf, i, sz) = abuf{buf=buf, i=i, sz=NONE}            val (buf, i, sz) = abuf asl
322            in            in
323              if (sz > 0)              if (sz > 0)
324                then let                then let
# Line 340  Line 329 
329                else (0, (ADDR(W8V.fromList[])))                else (0, (ADDR(W8V.fromList[])))
330            end            end
331      fun recvVecFrom' (sock, sz, {peek, oob}) = recvFromV (sock, sz, peek, oob)      fun recvVecFrom' (sock, sz, {peek, oob}) = recvFromV (sock, sz, peek, oob)
332      fun recvArrFrom' (SOCK fd, {buf, i}, {peek, oob}) = let      fun recvArrFrom' (SOCK fd, asl, {peek, oob}) = let
333            val (buf, i, sz) = abuf{buf=buf, i=i, sz=NONE}            val (buf, i, sz) = abuf asl
334            in            in
335              if (sz > 0)              if (sz > 0)
336                then let val (n, addr) = recvFromA(fd, buf, i, sz, peek, oob)                then let val (n, addr) = recvFromA(fd, buf, i, sz, peek, oob)

Legend:
Removed from v.1380  
changed lines
  Added in v.1381

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0