]> git.saurik.com Git - cycript.git/blame - Network.cpp
Fixed a minor bug introduced today in CYClause serialization.
[cycript.git] / Network.cpp
CommitLineData
a2b15234
JF
1#include "cycript.hpp"
2
3#include <sys/types.h>
4#include <sys/socket.h>
5
6bool CYRecvAll_(int socket, uint8_t *data, size_t size) {
7 while (size != 0) if (size_t writ = _syscall(recv(socket, data, size, 0))) {
8 data += writ;
9 size -= writ;
10 } else
11 return false;
12 return true;
13}
14
15bool CYSendAll_(int socket, const uint8_t *data, size_t size) {
16 while (size != 0) if (size_t writ = _syscall(send(socket, data, size, 0))) {
17 data += writ;
18 size -= writ;
19 } else
20 return false;
21 return true;
22}