| 236 | } |
| 237 | |
| 238 | int readData(int socket, uint8_t *buf, int buflen) { |
| 239 | int sendSize = buflen; |
| 240 | int status; |
| 241 | |
| 242 | while (buflen) { |
| 243 | #ifndef __MACH__ |
| 244 | status = read(socket, buf, buflen); |
| 245 | #else |
| 246 | status = recv(socket, buf, buflen, 0); |
| 247 | #endif |
| 248 | if (status <= 0) { |
| 249 | return status; |
| 250 | } |
| 251 | buflen -= status; |
| 252 | buf += status; |
| 253 | } |
| 254 | |
| 255 | return sendSize; |
| 256 | } |
| 257 | |
| 258 | int readHdr(int socket, FlowControlProtocolHeader *hdr) { |
| 259 | uint8_t buffer[sizeof(FlowControlProtocolHeader)]; |
no outgoing calls
no test coverage detected