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

@@ -14,6 +14,7 @@
#include "peer.h"
#include "proto.h"
#include "raw.h"
#include "socket.h"
#include "send.h"
#include "uuid.h"
@@ -132,8 +133,7 @@ void receive_cleanup() {
void receive_new(int fd, void __attribute__((unused)) *passthrough, struct peer *on_close) {
peer_count_in++;
int res = shutdown(fd, SHUT_WR);
assert(res == 0 || (res == -1 && errno == ENOTSOCK));
socket_receive_init(fd);
struct receive *receive = malloc(sizeof(*receive));
assert(receive);