Move more socket code into socket.c

This commit is contained in:
Ian Gulliver
2016-02-28 22:21:07 -08:00
parent 669b289e84
commit aa11eea121
4 changed files with 21 additions and 4 deletions

View File

@@ -18,6 +18,7 @@
#include "peer.h"
#include "proto.h"
#include "raw.h"
#include "socket.h"
#include "stats.h"
#include "uuid.h"
@@ -114,8 +115,7 @@ struct serializer *send_get_serializer(char *name) {
void send_new(int fd, struct serializer *serializer, struct peer *on_close) {
peer_count_out++;
int res = shutdown(fd, SHUT_RD);
assert(res == 0 || (res == -1 && errno == ENOTSOCK));
socket_send_init(fd);
struct send *send = malloc(sizeof(*send));
assert(send);