Showing
11 changed files
with
83 additions
and
35 deletions
@@ -46,7 +46,7 @@ TR_CLASSVARS_DECL(TR_CommManager) { | @@ -46,7 +46,7 @@ TR_CLASSVARS_DECL(TR_CommManager) { | ||
46 | TR_CV_EXTENDS(TR_EventHandler); | 46 | TR_CV_EXTENDS(TR_EventHandler); |
47 | }; | 47 | }; |
48 | 48 | ||
49 | -TR_EventDone TR_commManagerShutdown(TR_CommManager, TR_Event event); | 49 | +TR_EventDone TR_commManagerShutdown(void *, TR_Event event); |
50 | 50 | ||
51 | #endif // __TR_COMM_MANAGER_H__ | 51 | #endif // __TR_COMM_MANAGER_H__ |
52 | 52 |
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | #include "tr/protocol.h" | 31 | #include "tr/protocol.h" |
32 | #include "tr/proto_message.h" | 32 | #include "tr/proto_message.h" |
33 | 33 | ||
34 | -typedef TR_ProtoMessage (* fptr_TR_protoCreateMessage)(void *); | 34 | +typedef TR_ProtoMessage (* fptr_TR_protoCreateMessage)(void *, va_list *); |
35 | typedef TR_ProtoMessage (* fptr_TR_protoCreateRequest)(void *, va_list *); | 35 | typedef TR_ProtoMessage (* fptr_TR_protoCreateRequest)(void *, va_list *); |
36 | typedef TR_ProtoMessage (* fptr_TR_protoCreateResponse)(void *, va_list *); | 36 | typedef TR_ProtoMessage (* fptr_TR_protoCreateResponse)(void *, va_list *); |
37 | typedef TR_RemoteData (* fptr_TR_protoCompose)(void *, TR_ProtoMessage); | 37 | typedef TR_RemoteData (* fptr_TR_protoCompose)(void *, TR_ProtoMessage); |
@@ -47,7 +47,8 @@ TR_INTERFACE(TR_Protocol) { | @@ -47,7 +47,8 @@ TR_INTERFACE(TR_Protocol) { | ||
47 | fptr_TR_protoCompose compose; | 47 | fptr_TR_protoCompose compose; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | -TR_ProtoMessage TR_protoCreateMessage(void *, TR_Socket); | 50 | +TR_ProtoMessage TR_vprotoCreateMessage(void *, TR_Socket, va_list*); |
51 | +TR_ProtoMessage TR_protoCreateMessage(void *, TR_Socket, ...); | ||
51 | TR_ProtoMessage TR_vprotoCreateRequest(void *, TR_Socket, va_list*); | 52 | TR_ProtoMessage TR_vprotoCreateRequest(void *, TR_Socket, va_list*); |
52 | TR_ProtoMessage TR_protoCreateRequest(void *, TR_Socket, ...); | 53 | TR_ProtoMessage TR_protoCreateRequest(void *, TR_Socket, ...); |
53 | TR_ProtoMessage TR_vprotoCreateResponse(void *, TR_Socket, va_list*); | 54 | TR_ProtoMessage TR_vprotoCreateResponse(void *, TR_Socket, va_list*); |
@@ -83,8 +83,9 @@ TR_commManagerEnableWrite(void * _this, TR_Event event) | @@ -83,8 +83,9 @@ TR_commManagerEnableWrite(void * _this, TR_Event event) | ||
83 | 83 | ||
84 | static | 84 | static |
85 | TR_EventDone | 85 | TR_EventDone |
86 | -TR_commManagerAddEndpointEvt(TR_CommManager this, TR_Event event) | 86 | +TR_commManagerAddEndpointEvt(void * _this, TR_Event event) |
87 | { | 87 | { |
88 | + TR_CommManager this = _this; | ||
88 | TR_commManagerAddEndpoint(this, (TR_CommEndPoint)event->subject); | 89 | TR_commManagerAddEndpoint(this, (TR_CommEndPoint)event->subject); |
89 | 90 | ||
90 | return TR_EVENT_DONE; | 91 | return TR_EVENT_DONE; |
@@ -96,8 +97,8 @@ TR_EventDone TR_commManagerPollRead(void *, TR_Event); | @@ -96,8 +97,8 @@ TR_EventDone TR_commManagerPollRead(void *, TR_Event); | ||
96 | TR_EventDone TR_commManagerDisableRead(void *, TR_Event); | 97 | TR_EventDone TR_commManagerDisableRead(void *, TR_Event); |
97 | TR_EventDone TR_commManagerDisableWrite(void *, TR_Event); | 98 | TR_EventDone TR_commManagerDisableWrite(void *, TR_Event); |
98 | TR_EventDone TR_commManagerClose(void *, TR_Event); | 99 | TR_EventDone TR_commManagerClose(void *, TR_Event); |
99 | -TR_EventDone TR_commManagerShutdownRead(TR_CommManager, TR_Event); | ||
100 | -TR_EventDone TR_commManagerShutdownWrite(TR_CommManager, TR_Event); | 100 | +TR_EventDone TR_commManagerShutdownRead(void *, TR_Event); |
101 | +TR_EventDone TR_commManagerShutdownWrite(void *, TR_Event); | ||
101 | 102 | ||
102 | static | 103 | static |
103 | void | 104 | void |
@@ -66,7 +66,7 @@ commManagerEpollDtor(void * _this) | @@ -66,7 +66,7 @@ commManagerEpollDtor(void * _this) | ||
66 | } | 66 | } |
67 | 67 | ||
68 | static | 68 | static |
69 | -void | 69 | +TR_EventDone |
70 | TR_commManagerEpollAddEndpoint(void * _this, TR_CommEndPoint endpoint) | 70 | TR_commManagerEpollAddEndpoint(void * _this, TR_CommEndPoint endpoint) |
71 | { | 71 | { |
72 | TR_CommManagerEpoll this = _this; | 72 | TR_CommManagerEpoll this = _this; |
@@ -79,10 +79,12 @@ TR_commManagerEpollAddEndpoint(void * _this, TR_CommEndPoint endpoint) | @@ -79,10 +79,12 @@ TR_commManagerEpollAddEndpoint(void * _this, TR_CommEndPoint endpoint) | ||
79 | event.events = this->events[handle]; | 79 | event.events = this->events[handle]; |
80 | 80 | ||
81 | epoll_ctl(this->handle, EPOLL_CTL_ADD, handle, &event); | 81 | epoll_ctl(this->handle, EPOLL_CTL_ADD, handle, &event); |
82 | + | ||
83 | + return TR_EVENT_DONE; | ||
82 | } | 84 | } |
83 | 85 | ||
84 | static | 86 | static |
85 | -void | 87 | +TR_EventDone |
86 | TR_commManagerEpollSelect(void * _this, TR_Event event, unsigned long timeout) | 88 | TR_commManagerEpollSelect(void * _this, TR_Event event, unsigned long timeout) |
87 | { | 89 | { |
88 | TR_CommManagerEpoll this = _this; | 90 | TR_CommManagerEpoll this = _this; |
@@ -131,11 +133,13 @@ TR_commManagerEpollSelect(void * _this, TR_Event event, unsigned long timeout) | @@ -131,11 +133,13 @@ TR_commManagerEpollSelect(void * _this, TR_Event event, unsigned long timeout) | ||
131 | NULL)); | 133 | NULL)); |
132 | } | 134 | } |
133 | } | 135 | } |
136 | + | ||
137 | + return TR_EVENT_DONE; | ||
134 | } | 138 | } |
135 | 139 | ||
136 | static | 140 | static |
137 | inline | 141 | inline |
138 | -void | 142 | +TR_EventDone |
139 | TR_commManagerEpollDisable(void * _this, uint32_t mask, TR_Event event) | 143 | TR_commManagerEpollDisable(void * _this, uint32_t mask, TR_Event event) |
140 | { | 144 | { |
141 | TR_CommManagerEpoll this = _this; | 145 | TR_CommManagerEpoll this = _this; |
@@ -148,11 +152,13 @@ TR_commManagerEpollDisable(void * _this, uint32_t mask, TR_Event event) | @@ -148,11 +152,13 @@ TR_commManagerEpollDisable(void * _this, uint32_t mask, TR_Event event) | ||
148 | _event.events = this->events[handle]; | 152 | _event.events = this->events[handle]; |
149 | 153 | ||
150 | epoll_ctl(this->handle, EPOLL_CTL_MOD, handle, &_event); | 154 | epoll_ctl(this->handle, EPOLL_CTL_MOD, handle, &_event); |
155 | + | ||
156 | + return TR_EVENT_DONE; | ||
151 | } | 157 | } |
152 | 158 | ||
153 | static | 159 | static |
154 | inline | 160 | inline |
155 | -void | 161 | +TR_EventDone |
156 | TR_commManagerEpollEnable(void * _this, uint32_t mask, TR_Event event) | 162 | TR_commManagerEpollEnable(void * _this, uint32_t mask, TR_Event event) |
157 | { | 163 | { |
158 | TR_CommManagerEpoll this = _this; | 164 | TR_CommManagerEpoll this = _this; |
@@ -165,48 +171,60 @@ TR_commManagerEpollEnable(void * _this, uint32_t mask, TR_Event event) | @@ -165,48 +171,60 @@ TR_commManagerEpollEnable(void * _this, uint32_t mask, TR_Event event) | ||
165 | _event.events = this->events[handle]; | 171 | _event.events = this->events[handle]; |
166 | 172 | ||
167 | epoll_ctl(this->handle, EPOLL_CTL_MOD, handle, &_event); | 173 | epoll_ctl(this->handle, EPOLL_CTL_MOD, handle, &_event); |
174 | + | ||
175 | + return TR_EVENT_DONE; | ||
168 | } | 176 | } |
169 | 177 | ||
170 | static | 178 | static |
171 | -void | 179 | +TR_EventDone |
172 | TR_commManagerEpollEnableWrite(void * _this, TR_Event event) | 180 | TR_commManagerEpollEnableWrite(void * _this, TR_Event event) |
173 | { | 181 | { |
174 | if (! TR_socketFinWr(((TR_CommEndPoint)event->subject)->transport)) { | 182 | if (! TR_socketFinWr(((TR_CommEndPoint)event->subject)->transport)) { |
175 | TR_commManagerEpollEnable(_this, EPOLLOUT, event); | 183 | TR_commManagerEpollEnable(_this, EPOLLOUT, event); |
176 | } | 184 | } |
185 | + | ||
186 | + return TR_EVENT_DONE; | ||
177 | } | 187 | } |
178 | 188 | ||
179 | static | 189 | static |
180 | -void | 190 | +TR_EventDone |
181 | TR_commManagerEpollEnableRead(void * _this, TR_Event event) | 191 | TR_commManagerEpollEnableRead(void * _this, TR_Event event) |
182 | { | 192 | { |
183 | if (! TR_socketFinRd(((TR_CommEndPoint)event->subject)->transport)) { | 193 | if (! TR_socketFinRd(((TR_CommEndPoint)event->subject)->transport)) { |
184 | TR_commManagerEpollEnable(_this, EPOLLIN, event); | 194 | TR_commManagerEpollEnable(_this, EPOLLIN, event); |
185 | } | 195 | } |
196 | + | ||
197 | + return TR_EVENT_DONE; | ||
186 | } | 198 | } |
187 | 199 | ||
188 | static | 200 | static |
189 | -void | 201 | +TR_EventDone |
190 | TR_commManagerEpollDisableWrite(void * _this, TR_Event event) | 202 | TR_commManagerEpollDisableWrite(void * _this, TR_Event event) |
191 | { | 203 | { |
192 | TR_commManagerEpollDisable(_this, EPOLLOUT, event); | 204 | TR_commManagerEpollDisable(_this, EPOLLOUT, event); |
205 | + | ||
206 | + return TR_EVENT_DONE; | ||
193 | } | 207 | } |
194 | 208 | ||
195 | static | 209 | static |
196 | -void | 210 | +TR_EventDone |
197 | TR_commManagerEpollDisableRead(void * _this, TR_Event event) | 211 | TR_commManagerEpollDisableRead(void * _this, TR_Event event) |
198 | { | 212 | { |
199 | TR_commManagerEpollDisable(_this, EPOLLIN, event); | 213 | TR_commManagerEpollDisable(_this, EPOLLIN, event); |
214 | + | ||
215 | + return TR_EVENT_DONE; | ||
200 | } | 216 | } |
201 | 217 | ||
202 | static | 218 | static |
203 | -void | 219 | +TR_EventDone |
204 | TR_commManagerEpollClose(void * _this, TR_Event event) | 220 | TR_commManagerEpollClose(void * _this, TR_Event event) |
205 | { | 221 | { |
206 | TR_CommManagerEpoll this = _this; | 222 | TR_CommManagerEpoll this = _this; |
207 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; | 223 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; |
208 | 224 | ||
209 | epoll_ctl(this->handle, EPOLL_CTL_DEL, endpoint->transport->handle, NULL); | 225 | epoll_ctl(this->handle, EPOLL_CTL_DEL, endpoint->transport->handle, NULL); |
226 | + | ||
227 | + return TR_EVENT_DONE; | ||
210 | } | 228 | } |
211 | 229 | ||
212 | static | 230 | static |
@@ -65,17 +65,19 @@ commManagerPollDtor(void * _this) | @@ -65,17 +65,19 @@ commManagerPollDtor(void * _this) | ||
65 | } | 65 | } |
66 | 66 | ||
67 | static | 67 | static |
68 | -void | 68 | +TR_EventDone |
69 | TR_commManagerPollAddEndpoint(void * _this, TR_CommEndPoint endpoint) | 69 | TR_commManagerPollAddEndpoint(void * _this, TR_CommEndPoint endpoint) |
70 | { | 70 | { |
71 | TR_CommManagerPoll this = _this; | 71 | TR_CommManagerPoll this = _this; |
72 | 72 | ||
73 | - this->fds[endpoint->transport->handle].fd = endpoint->transport->handle; | 73 | + this->fds[endpoint->transport->handle].fd = endpoint->transport->handle; |
74 | this->fds[endpoint->transport->handle].events = 0; | 74 | this->fds[endpoint->transport->handle].events = 0; |
75 | + | ||
76 | + return TR_EVENT_DONE; | ||
75 | } | 77 | } |
76 | - | 78 | + |
77 | static | 79 | static |
78 | -void | 80 | +TR_EventDone |
79 | TR_commManagerPollSelect(void * _this, TR_Event event, unsigned long timeout) | 81 | TR_commManagerPollSelect(void * _this, TR_Event event, unsigned long timeout) |
80 | { | 82 | { |
81 | TR_CommManagerPoll this = _this; | 83 | TR_CommManagerPoll this = _this; |
@@ -126,10 +128,12 @@ TR_commManagerPollSelect(void * _this, TR_Event event, unsigned long timeout) | @@ -126,10 +128,12 @@ TR_commManagerPollSelect(void * _this, TR_Event event, unsigned long timeout) | ||
126 | } | 128 | } |
127 | } | 129 | } |
128 | } | 130 | } |
131 | + | ||
132 | + return TR_EVENT_DONE; | ||
129 | } | 133 | } |
130 | 134 | ||
131 | static | 135 | static |
132 | -void | 136 | +TR_EventDone |
133 | TR_commManagerPollEnableWrite(void * _this, TR_Event event) | 137 | TR_commManagerPollEnableWrite(void * _this, TR_Event event) |
134 | { | 138 | { |
135 | TR_CommManagerPoll this = _this; | 139 | TR_CommManagerPoll this = _this; |
@@ -138,10 +142,12 @@ TR_commManagerPollEnableWrite(void * _this, TR_Event event) | @@ -138,10 +142,12 @@ TR_commManagerPollEnableWrite(void * _this, TR_Event event) | ||
138 | if (! TR_socketFinWr(endpoint->transport)) { | 142 | if (! TR_socketFinWr(endpoint->transport)) { |
139 | this->fds[endpoint->transport->handle].events |= POLLOUT|POLLHUP; | 143 | this->fds[endpoint->transport->handle].events |= POLLOUT|POLLHUP; |
140 | } | 144 | } |
145 | + | ||
146 | + return TR_EVENT_DONE; | ||
141 | } | 147 | } |
142 | 148 | ||
143 | static | 149 | static |
144 | -void | 150 | +TR_EventDone |
145 | TR_commManagerPollEnableRead(void * _this, TR_Event event) | 151 | TR_commManagerPollEnableRead(void * _this, TR_Event event) |
146 | { | 152 | { |
147 | TR_CommManagerPoll this = _this; | 153 | TR_CommManagerPoll this = _this; |
@@ -150,30 +156,36 @@ TR_commManagerPollEnableRead(void * _this, TR_Event event) | @@ -150,30 +156,36 @@ TR_commManagerPollEnableRead(void * _this, TR_Event event) | ||
150 | if (! TR_socketFinRd(endpoint->transport)) { | 156 | if (! TR_socketFinRd(endpoint->transport)) { |
151 | this->fds[endpoint->transport->handle].events |= POLLIN; | 157 | this->fds[endpoint->transport->handle].events |= POLLIN; |
152 | } | 158 | } |
159 | + | ||
160 | + return TR_EVENT_DONE; | ||
153 | } | 161 | } |
154 | 162 | ||
155 | static | 163 | static |
156 | -void | 164 | +TR_EventDone |
157 | TR_commManagerPollDisableWrite(void * _this, TR_Event event) | 165 | TR_commManagerPollDisableWrite(void * _this, TR_Event event) |
158 | { | 166 | { |
159 | TR_CommManagerPoll this = _this; | 167 | TR_CommManagerPoll this = _this; |
160 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; | 168 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; |
161 | 169 | ||
162 | this->fds[endpoint->transport->handle].events &= ~(POLLOUT|POLLHUP); | 170 | this->fds[endpoint->transport->handle].events &= ~(POLLOUT|POLLHUP); |
171 | + | ||
172 | + return TR_EVENT_DONE; | ||
163 | } | 173 | } |
164 | 174 | ||
165 | static | 175 | static |
166 | -void | 176 | +TR_EventDone |
167 | TR_commManagerPollDisableRead(void * _this, TR_Event event) | 177 | TR_commManagerPollDisableRead(void * _this, TR_Event event) |
168 | { | 178 | { |
169 | TR_CommManagerPoll this = _this; | 179 | TR_CommManagerPoll this = _this; |
170 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; | 180 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; |
171 | 181 | ||
172 | this->fds[endpoint->transport->handle].events &= ~POLLIN; | 182 | this->fds[endpoint->transport->handle].events &= ~POLLIN; |
183 | + | ||
184 | + return TR_EVENT_DONE; | ||
173 | } | 185 | } |
174 | 186 | ||
175 | static | 187 | static |
176 | -void | 188 | +TR_EventDone |
177 | TR_commManagerPollClose(void * _this, TR_Event event) | 189 | TR_commManagerPollClose(void * _this, TR_Event event) |
178 | { | 190 | { |
179 | TR_CommManagerPoll this = _this; | 191 | TR_CommManagerPoll this = _this; |
@@ -181,6 +193,8 @@ TR_commManagerPollClose(void * _this, TR_Event event) | @@ -181,6 +193,8 @@ TR_commManagerPollClose(void * _this, TR_Event event) | ||
181 | 193 | ||
182 | this->fds[endpoint->transport->handle].events = 0; | 194 | this->fds[endpoint->transport->handle].events = 0; |
183 | this->fds[endpoint->transport->handle].fd = -1; | 195 | this->fds[endpoint->transport->handle].fd = -1; |
196 | + | ||
197 | + return TR_EVENT_DONE; | ||
184 | } | 198 | } |
185 | 199 | ||
186 | static | 200 | static |
@@ -30,8 +30,9 @@ | @@ -30,8 +30,9 @@ | ||
30 | #include "tr/_comm_manager.h" | 30 | #include "tr/_comm_manager.h" |
31 | 31 | ||
32 | TR_EventDone | 32 | TR_EventDone |
33 | -TR_commManagerShutdown(TR_CommManager this, TR_Event event) | 33 | +TR_commManagerShutdown(void * _this, TR_Event event) |
34 | { | 34 | { |
35 | + TR_CommManager this = _this; | ||
35 | nfds_t i; | 36 | nfds_t i; |
36 | 37 | ||
37 | for (i=0; i<=this->max_handle; i++) { | 38 | for (i=0; i<=this->max_handle; i++) { |
@@ -29,8 +29,9 @@ | @@ -29,8 +29,9 @@ | ||
29 | #include "tr/_comm_manager.h" | 29 | #include "tr/_comm_manager.h" |
30 | 30 | ||
31 | TR_EventDone | 31 | TR_EventDone |
32 | -TR_commManagerShutdownRead(TR_CommManager this, TR_Event event) | 32 | +TR_commManagerShutdownRead(void * _this, TR_Event event) |
33 | { | 33 | { |
34 | + TR_CommManager this = _this; | ||
34 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; | 35 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; |
35 | 36 | ||
36 | if (! TR_socketFinRd(endpoint->transport)) { | 37 | if (! TR_socketFinRd(endpoint->transport)) { |
@@ -28,8 +28,9 @@ | @@ -28,8 +28,9 @@ | ||
28 | #include "tr/_comm_manager.h" | 28 | #include "tr/_comm_manager.h" |
29 | 29 | ||
30 | TR_EventDone | 30 | TR_EventDone |
31 | -TR_commManagerShutdownWrite(TR_CommManager this, TR_Event event) | 31 | +TR_commManagerShutdownWrite(void * _this, TR_Event event) |
32 | { | 32 | { |
33 | + TR_CommManager this = _this; | ||
33 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; | 34 | TR_CommEndPoint endpoint = (TR_CommEndPoint)event->subject; |
34 | 35 | ||
35 | if (! TR_socketFinWr(endpoint->transport)) { | 36 | if (! TR_socketFinWr(endpoint->transport)) { |
@@ -86,7 +86,7 @@ datagramServiceNextMessage(void * _this, TR_RemoteData * data) | @@ -86,7 +86,7 @@ datagramServiceNextMessage(void * _this, TR_RemoteData * data) | ||
86 | } | 86 | } |
87 | 87 | ||
88 | static | 88 | static |
89 | -int | 89 | +size_t |
90 | datagramServiceCompose(void * _this, TR_ProtoMessage message) | 90 | datagramServiceCompose(void * _this, TR_ProtoMessage message) |
91 | { | 91 | { |
92 | TR_RemoteData data = | 92 | TR_RemoteData data = |
@@ -31,10 +31,10 @@ | @@ -31,10 +31,10 @@ | ||
31 | TR_CREATE_INTERFACE(TR_Protocol, 5); | 31 | TR_CREATE_INTERFACE(TR_Protocol, 5); |
32 | 32 | ||
33 | TR_ProtoMessage | 33 | TR_ProtoMessage |
34 | -TR_protoCreateMessage(void * _this, TR_Socket remote) | 34 | +TR_vprotoCreateMessage(void * _this, TR_Socket remote, va_list * params) |
35 | { | 35 | { |
36 | TR_ProtoMessage callret; | 36 | TR_ProtoMessage callret; |
37 | - TR_RETCALL(_this, TR_Protocol, createMessage, callret); | 37 | + TR_RETCALL(_this, TR_Protocol, createMessage, callret, params); |
38 | if (callret != NULL) { | 38 | if (callret != NULL) { |
39 | callret->remote = remote; | 39 | callret->remote = remote; |
40 | } | 40 | } |
@@ -42,6 +42,17 @@ TR_protoCreateMessage(void * _this, TR_Socket remote) | @@ -42,6 +42,17 @@ TR_protoCreateMessage(void * _this, TR_Socket remote) | ||
42 | } | 42 | } |
43 | 43 | ||
44 | TR_ProtoMessage | 44 | TR_ProtoMessage |
45 | +TR_protoCreateMessage(void * _this, TR_Socket remote, ...) | ||
46 | +{ | ||
47 | + TR_ProtoMessage callret; | ||
48 | + va_list params; | ||
49 | + va_start(params, remote); | ||
50 | + callret = TR_vprotoCreateMessage(_this, remote, ¶ms); | ||
51 | + va_end(params); | ||
52 | + return callret; | ||
53 | +} | ||
54 | + | ||
55 | +TR_ProtoMessage | ||
45 | TR_vprotoCreateRequest(void * _this, TR_Socket remote, va_list * params) | 56 | TR_vprotoCreateRequest(void * _this, TR_Socket remote, va_list * params) |
46 | { | 57 | { |
47 | TR_ProtoMessage callret; | 58 | TR_ProtoMessage callret; |
@@ -67,7 +78,7 @@ TR_ProtoMessage | @@ -67,7 +78,7 @@ TR_ProtoMessage | ||
67 | TR_vprotoCreateResponse(void * _this, TR_Socket remote, va_list * params) | 78 | TR_vprotoCreateResponse(void * _this, TR_Socket remote, va_list * params) |
68 | { | 79 | { |
69 | TR_ProtoMessage callret; | 80 | TR_ProtoMessage callret; |
70 | - TR_RETCALL(_this, TR_Protocol, createResponse, callret, ¶ms); | 81 | + TR_RETCALL(_this, TR_Protocol, createResponse, callret, params); |
71 | if (callret != NULL) { | 82 | if (callret != NULL) { |
72 | callret->remote = remote; | 83 | callret->remote = remote; |
73 | } | 84 | } |
@@ -45,9 +45,9 @@ static void protocolRawDtor(void * _this) {} | @@ -45,9 +45,9 @@ static void protocolRawDtor(void * _this) {} | ||
45 | 45 | ||
46 | static | 46 | static |
47 | TR_ProtoMessage | 47 | TR_ProtoMessage |
48 | -protocolRawCreateMessage(void * _this, TR_Socket remote) | 48 | +protocolRawCreateMessage(void * _this, va_list * args) |
49 | { | 49 | { |
50 | - return (TR_ProtoMessage)TR_new(TR_ProtoMessageRaw, remote); | 50 | + return (TR_ProtoMessage)TR_new(TR_ProtoMessageRaw); |
51 | } | 51 | } |
52 | 52 | ||
53 | static | 53 | static |
@@ -110,9 +110,9 @@ protocolRawCompose(void * _this, TR_ProtoMessage _message) | @@ -110,9 +110,9 @@ protocolRawCompose(void * _this, TR_ProtoMessage _message) | ||
110 | { | 110 | { |
111 | TR_ProtoMessageRaw message = (TR_ProtoMessageRaw)_message; | 111 | TR_ProtoMessageRaw message = (TR_ProtoMessageRaw)_message; |
112 | TR_SizedData data; | 112 | TR_SizedData data; |
113 | - | 113 | + |
114 | data = (TR_SizedData)TR_new(TR_RemoteData, NULL, 0, _message->remote); | 114 | data = (TR_SizedData)TR_new(TR_RemoteData, NULL, 0, _message->remote); |
115 | - | 115 | + |
116 | data->size = message->size + 2; | 116 | data->size = message->size + 2; |
117 | data->data = TR_malloc(data->size); | 117 | data->data = TR_malloc(data->size); |
118 | *(uint16_t *)data->data = htons(message->size); | 118 | *(uint16_t *)data->data = htons(message->size); |
Please
register
or
login
to post a comment