X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=libs%2Fshttpd%2Fio_socket.c;fp=libs%2Fshttpd%2Fio_socket.c;h=0000000000000000000000000000000000000000;hb=dec33c63afafabf83c3039e916725cac6faef9b3;hp=9e2b73edc4ca2e179e6d241dae7e6f511be49dab;hpb=9b22dd53fe62e312c1647310b7ec43aa127090af;p=fms.git diff --git a/libs/shttpd/io_socket.c b/libs/shttpd/io_socket.c deleted file mode 100644 index 9e2b73e..0000000 --- a/libs/shttpd/io_socket.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2004-2005 Sergey Lyubka - * All rights reserved - * - * "THE BEER-WARE LICENSE" (Revision 42): - * Sergey Lyubka wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. - */ - -#include "defs.h" - -static int -read_socket(struct stream *stream, void *buf, size_t len) -{ - assert(stream->chan.sock != -1); - return (recv(stream->chan.sock, buf, len, 0)); -} - -static int -write_socket(struct stream *stream, const void *buf, size_t len) -{ - assert(stream->chan.sock != -1); - return (send(stream->chan.sock, buf, len, 0)); -} - -static void -close_socket(struct stream *stream) -{ - assert(stream->chan.sock != -1); - (void) closesocket(stream->chan.sock); -} - -const struct io_class io_socket = { - "socket", - read_socket, - write_socket, - close_socket -};