about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/io/socketstream.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/io/socketstream.nim b/src/io/socketstream.nim
index 6b648003..2e56a4c7 100644
--- a/src/io/socketstream.nim
+++ b/src/io/socketstream.nim
@@ -18,9 +18,10 @@ proc sockReadData(s: Stream, buffer: pointer, len: int): int =
   assert len != 0
   let s = SocketStream(s)
   let wasend = s.isend
+  let buffer = cast[ptr UncheckedArray[uint8]](buffer)
   if s.blk:
     while result < len:
-      let n = s.source.recv(cast[pointer](cast[int](buffer) + result), len - result)
+      let n = s.source.recv(addr buffer[result], len - result)
       if n < 0:
         if result == 0:
           result = n
@@ -42,8 +43,9 @@ proc sockReadData(s: Stream, buffer: pointer, len: int): int =
 
 proc sockWriteData(s: Stream, buffer: pointer, len: int) =
   var i = 0
+  let buffer = cast[ptr UncheckedArray[uint8]](buffer)
   while i < len:
-    let n = SocketStream(s).source.send(cast[pointer](cast[int](buffer) + i), len - i)
+    let n = SocketStream(s).source.send(addr buffer[i], len - i)
     if n < 0:
       raise newException(IOError, $strerror(errno))
     i += n
+0200 Refactor fileloader' href='/ahoang/chawan/commit/src/io/http.nim?id=e2203257e07aada157be9d0a948273cb9d683072'>e2203257 ^
dab6f8ee ^















d526deb9 ^

e2203257 ^
dab6f8ee ^


e2203257 ^
dab6f8ee ^
e38402df ^

dab6f8ee ^


251b9469 ^
e38402df ^
dab6f8ee ^




a78c2619 ^
e2203257 ^



a78c2619 ^
dab6f8ee ^





d526deb9 ^

a78c2619 ^
e2203257 ^

e38402df ^
e2203257 ^

d526deb9 ^


dab6f8ee ^
a78c2619 ^
d526deb9 ^
87f9bd65 ^
e2203257 ^

dab6f8ee ^
17097052 ^
05b64a1d ^
d526deb9 ^
8027e52c ^
05b64a1d ^
d526deb9 ^
05b64a1d ^
8027e52c ^





05b64a1d ^
8027e52c ^
05b64a1d ^

05b64a1d ^




d526deb9 ^
dab6f8ee ^
e2203257 ^
d526deb9 ^
e2203257 ^

dab6f8ee ^
05b64a1d ^
e2203257 ^
05b64a1d ^
e2203257 ^
85c5b568 ^


c235e638 ^


e2203257 ^
05b64a1d ^

e2203257 ^

05b64a1d ^
e2203257 ^
e2203257 ^

05b64a1d ^




d526deb9 ^

05b64a1d ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137