summaryrefslogtreecommitdiffstats
path: root/nanohttp/nanohttp-client.c
diff options
context:
space:
mode:
authorGravatar snowdrop2004-08-30 15:26:48 +0000
committerGravatar snowdrop2004-08-30 15:26:48 +0000
commit30911b1730a1a69241beaca7d1ed71212d4f7b3f (patch)
tree1538c363a546cc7584f88b3886433d43aca50c77 /nanohttp/nanohttp-client.c
parent056647348ff38f83b5e13bed1c4f4bb76cce50f9 (diff)
downloadcsoap-30911b1730a1a69241beaca7d1ed71212d4f7b3f.tar.gz
csoap-30911b1730a1a69241beaca7d1ed71212d4f7b3f.tar.bz2
migration win32 socket code
Diffstat (limited to 'nanohttp/nanohttp-client.c')
-rw-r--r--nanohttp/nanohttp-client.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/nanohttp/nanohttp-client.c b/nanohttp/nanohttp-client.c
index 59d0cd0..22571c6 100644
--- a/nanohttp/nanohttp-client.c
+++ b/nanohttp/nanohttp-client.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: nanohttp-client.c,v 1.15 2004/08/30 13:28:58 snowdrop Exp $
+* $Id: nanohttp-client.c,v 1.16 2004/08/30 15:26:53 snowdrop Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -53,7 +53,19 @@ static struct tm *localtime_r(const time_t *const timep, struct tm *p_tm)
return tmp;
}
-#endif
+#endif
+
+/*--------------------------------------------------
+FUNCTION: httpc_init
+DESC: Initialize http client connection
+NOTE: This will be called from soap_client_init_args()
+----------------------------------------------------*/
+int httpc_init(int argc, char *argv[])
+{
+ hsocket_module_init();
+ return 0;
+}
+
/*--------------------------------------------------
FUNCTION: httpc_new
DESC: Creates a new http client connection object
@@ -577,12 +589,8 @@ int httpc_talk_to_server(hreq_method method, httpc_conn_t *conn,
char buffer[4096];
int status;
-#ifndef WIN32
- #if HSOCKET_BLOCKMODE!=0
- fcntl(conn->sock, F_SETFL, O_NONBLOCK);
- #endif
-#else
- unsigned long iMode = HSOCKET_BLOCKMODE;
+#ifdef WIN32
+ unsigned long iMode = HSOCKET_NONBLOCKMODE;
#endif
@@ -613,10 +621,12 @@ int httpc_talk_to_server(hreq_method method, httpc_conn_t *conn,
}
#ifndef WIN32
-#if HSOCKET_BLOCKMODE!=0
+ /* Try always non block mode
+ #if HSOCKET_BLOCKMODE!=0*/
fcntl(conn->sock, F_SETFL, O_NONBLOCK);
-#endif
-#else
+ /*#endif*/
+#else
+ iMode = HSOCKET_NONBLOCKMODE;
if(ioctlsocket(conn->sock, FIONBIO, (u_long FAR*) &iMode) == INVALID_SOCKET)
{
log_error1("ioctlsocket error");