summaryrefslogtreecommitdiffstats
path: root/nanohttp/nanohttp-socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'nanohttp/nanohttp-socket.c')
-rw-r--r--nanohttp/nanohttp-socket.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/nanohttp/nanohttp-socket.c b/nanohttp/nanohttp-socket.c
index 9aaca65..18edcb9 100644
--- a/nanohttp/nanohttp-socket.c
+++ b/nanohttp/nanohttp-socket.c
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: nanohttp-socket.c,v 1.4 2003/12/17 12:55:02 snowdrop Exp $
+ * $Id: nanohttp-socket.c,v 1.5 2004/01/05 10:42:15 snowdrop Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -133,6 +133,20 @@ void hsocket_close(hsocket_t sock)
/*--------------------------------------------------
FUNCTION: hsocket_send
----------------------------------------------------*/
+int hsocket_nsend(hsocket_t sock, const char* buffer, int n)
+{
+ int size;
+
+ size = send((int)sock, buffer, n, 0);
+ if (size == -1)
+ return HSOCKET_CAN_NOT_SEND;
+
+ return HSOCKET_OK;
+}
+
+/*--------------------------------------------------
+ FUNCTION: hsocket_send
+----------------------------------------------------*/
int hsocket_send(hsocket_t sock, const char* buffer)
{
int size;