[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r32401 - in libmicrohttpd/src: include microhttpd testcurl
From: |
gnunet |
Subject: |
[GNUnet-SVN] r32401 - in libmicrohttpd/src: include microhttpd testcurl |
Date: |
Tue, 18 Feb 2014 19:39:59 +0100 |
Author: Karlson2k
Date: 2014-02-18 19:39:59 +0100 (Tue, 18 Feb 2014)
New Revision: 32401
Modified:
libmicrohttpd/src/include/platform.h
libmicrohttpd/src/microhttpd/connection.c
libmicrohttpd/src/microhttpd/daemon.c
libmicrohttpd/src/testcurl/perf_get.c
libmicrohttpd/src/testcurl/perf_get_concurrent.c
libmicrohttpd/src/testcurl/test_get.c
libmicrohttpd/src/testcurl/test_get_sendfile.c
libmicrohttpd/src/testcurl/test_post_loop.c
Log:
Remove PlibC wrappers and macros
Modified: libmicrohttpd/src/include/platform.h
===================================================================
--- libmicrohttpd/src/include/platform.h 2014-02-18 18:39:43 UTC (rev
32400)
+++ libmicrohttpd/src/include/platform.h 2014-02-18 18:39:59 UTC (rev
32401)
@@ -124,6 +124,16 @@
#define usleep(useconds) (void)SleepEx((useconds)/1000, 1)
#endif
+#if !defined(SHUT_WR) && defined(SD_SEND)
+#define SHUT_WR SD_SEND
+#endif
+#if !defined(SHUT_RD) && defined(SD_RECEIVE)
+#define SHUT_RD SD_RECEIVE
+#endif
+#if !defined(SHUT_RDWR) && defined(SD_BOTH)
+#define SHUT_RDWR SD_BOTH
+#endif
+
#ifndef MHD_SOCKET_DEFINED
/**
* MHD_socket is type for socket FDs
Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c 2014-02-18 18:39:43 UTC (rev
32400)
+++ libmicrohttpd/src/microhttpd/connection.c 2014-02-18 18:39:59 UTC (rev
32401)
@@ -265,7 +265,7 @@
daemon = connection->daemon;
if (0 == (connection->daemon->options & MHD_USE_EPOLL_TURBO))
- SHUTDOWN (connection->socket_fd,
+ shutdown (connection->socket_fd,
(MHD_YES == connection->read_closed) ? SHUT_WR : SHUT_RDWR);
connection->state = MHD_CONNECTION_CLOSED;
connection->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
@@ -625,7 +625,7 @@
Note that the change from 'SHOULD NOT' to 'MUST NOT' is
a recent development of the HTTP 1.1 specification.
*/
- SPRINTF (buf,
+ sprintf (buf,
MHD_UNSIGNED_LONG_LONG_PRINTF,
(MHD_UNSIGNED_LONG_LONG) connection->response->total_size);
MHD_add_response_header (connection->response,
@@ -769,7 +769,7 @@
add_extra_headers (connection);
rc = connection->responseCode & (~MHD_ICY_FLAG);
reason_phrase = MHD_get_reason_phrase_for (rc);
- SPRINTF (code,
+ sprintf (code,
"%s %u %s\r\n",
(0 != (connection->responseCode & MHD_ICY_FLAG))
? "ICY"
@@ -835,7 +835,7 @@
}
for (pos = connection->response->first_header; NULL != pos; pos = pos->next)
if (pos->kind == kind)
- off += SPRINTF (&data[off],
+ off += sprintf (&data[off],
"%s: %s\r\n",
pos->header,
pos->value);
@@ -1675,7 +1675,7 @@
return MHD_YES;
}
#if DEBUG_SEND_DATA
- FPRINTF (stderr,
+ fprintf (stderr,
"Sent response: `%.*s'\n",
ret,
&connection->write_buffer[connection->write_buffer_send_offset]);
@@ -2056,7 +2056,7 @@
return MHD_YES;
}
#if DEBUG_SEND_DATA
- FPRINTF (stderr,
+ fprintf (stderr,
"Sent 100 continue response: `%.*s'\n",
(int) ret,
&HTTP_100_CONTINUE[connection->continue_message_write_offset]);
@@ -2094,7 +2094,7 @@
const int err = MHD_socket_errno_;
#if DEBUG_SEND_DATA
if (ret > 0)
- FPRINTF (stderr,
+ fprintf (stderr,
"Sent DATA response: `%.*s'\n",
(int) ret,
&response->data[connection->response_write_position -
Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c 2014-02-18 18:39:43 UTC (rev
32400)
+++ libmicrohttpd/src/microhttpd/daemon.c 2014-02-18 18:39:59 UTC (rev
32401)
@@ -302,7 +302,7 @@
MHD_ip_count_lock (daemon);
/* Search for the IP address */
- if (NULL == (nodep = TSEARCH (key,
+ if (NULL == (nodep = tsearch (key,
&daemon->per_ip_connection_count,
&MHD_ip_addr_compare)))
{
@@ -358,7 +358,7 @@
MHD_ip_count_lock (daemon);
/* Search for the IP address */
- if (NULL == (nodep = TFIND (&search_key,
+ if (NULL == (nodep = tfind (&search_key,
&daemon->per_ip_connection_count,
&MHD_ip_addr_compare)))
{
@@ -375,7 +375,7 @@
/* Remove the node entirely if count reduces to 0 */
if (0 == --found_key->count)
{
- TDELETE (found_key,
+ tdelete (found_key,
&daemon->per_ip_connection_count,
&MHD_ip_addr_compare);
free (found_key);
@@ -850,7 +850,7 @@
MHD_set_socket_errno_ (ENOTCONN);
return -1;
}
- ret = RECV (connection->socket_fd, other, i, MSG_NOSIGNAL);
+ ret = recv (connection->socket_fd, other, i, MSG_NOSIGNAL);
#if EPOLL_SUPPORT
if (ret < (ssize_t) i)
{
@@ -889,7 +889,7 @@
return -1;
}
if (0 != (connection->daemon->options & MHD_USE_SSL))
- return SEND (connection->socket_fd, other, i, MSG_NOSIGNAL);
+ return send (connection->socket_fd, other, i, MSG_NOSIGNAL);
#if LINUX
if ( (connection->write_buffer_append_offset ==
connection->write_buffer_send_offset) &&
@@ -926,7 +926,7 @@
http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html
*/
}
#endif
- ret = SEND (connection->socket_fd, other, i, MSG_NOSIGNAL);
+ ret = send (connection->socket_fd, other, i, MSG_NOSIGNAL);
#if EPOLL_SUPPORT
if (ret < (ssize_t) i)
{
@@ -1707,7 +1707,7 @@
#if HAVE_ACCEPT4
s = accept4 (fd, addr, &addrlen, SOCK_CLOEXEC | nonblock);
#else
- s = ACCEPT (fd, addr, &addrlen);
+ s = accept (fd, addr, &addrlen);
#endif
if ((MHD_INVALID_SOCKET == s) || (addrlen <= 0))
{
@@ -1814,7 +1814,7 @@
if (MHD_INVALID_SOCKET != pos->socket_fd)
{
#ifdef WINDOWS
- SHUTDOWN (pos->socket_fd, SHUT_WR);
+ shutdown (pos->socket_fd, SHUT_WR);
#endif
if (0 != MHD_socket_close_ (pos->socket_fd))
MHD_PANIC ("close failed\n");
@@ -3082,11 +3082,11 @@
/* use SOCK_STREAM rather than ai_socktype: some getaddrinfo
* implementations do not set ai_socktype, e.g. RHL6.2. */
- fd = SOCKET (domain, ctype, protocol);
+ fd = socket (domain, ctype, protocol);
if ( (MHD_INVALID_SOCKET == fd) && (EINVAL == MHD_socket_errno_) && (0 !=
SOCK_CLOEXEC) )
{
ctype = type;
- fd = SOCKET(domain, type, protocol);
+ fd = socket(domain, type, protocol);
}
if (MHD_INVALID_SOCKET == fd)
return MHD_INVALID_SOCKET;
@@ -3440,10 +3440,10 @@
#endif
goto free_and_fail;
}
- if ( (0 > SETSOCKOPT (socket_fd,
+ if ( (0 > setsockopt (socket_fd,
SOL_SOCKET,
SO_REUSEADDR,
- &on, sizeof (on))) &&
+ (void*)&on, sizeof (on))) &&
(0 != (flags & MHD_USE_DEBUG)) )
{
#if HAVE_MESSAGES
@@ -3501,7 +3501,7 @@
const char
#endif
on = (MHD_USE_DUAL_STACK != (flags & MHD_USE_DUAL_STACK));
- if ( (0 > SETSOCKOPT (socket_fd,
+ if ( (0 > setsockopt (socket_fd,
IPPROTO_IPV6, IPV6_V6ONLY,
&on, sizeof (on))) &&
(0 != (flags & MHD_USE_DEBUG)) )
@@ -3515,7 +3515,7 @@
#endif
#endif
}
- if (-1 == BIND (socket_fd, servaddr, addrlen))
+ if (-1 == bind (socket_fd, servaddr, addrlen))
{
#if HAVE_MESSAGES
if (0 != (flags & MHD_USE_DEBUG))
@@ -3545,7 +3545,7 @@
}
}
#endif
- if (LISTEN (socket_fd, 32) < 0)
+ if (listen (socket_fd, 32) < 0)
{
#if HAVE_MESSAGES
if (0 != (flags & MHD_USE_DEBUG))
@@ -3860,7 +3860,7 @@
(0 != pthread_mutex_lock (&daemon->cleanup_connection_mutex)) )
MHD_PANIC ("Failed to acquire cleanup mutex\n");
for (pos = daemon->connections_head; NULL != pos; pos = pos->nextX)
- SHUTDOWN (pos->socket_fd,
+ shutdown (pos->socket_fd,
(pos->read_closed == MHD_YES) ? SHUT_WR : SHUT_RDWR);
if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
(0 != pthread_mutex_unlock (&daemon->cleanup_connection_mutex)) )
@@ -3956,7 +3956,7 @@
{
/* fd might be MHD_INVALID_SOCKET here due to 'MHD_quiesce_daemon' */
if (MHD_INVALID_SOCKET != fd)
- (void) SHUTDOWN (fd, SHUT_RDWR);
+ (void) shutdown (fd, SHUT_RDWR);
}
#endif
#if EPOLL_SUPPORT
Modified: libmicrohttpd/src/testcurl/perf_get.c
===================================================================
--- libmicrohttpd/src/testcurl/perf_get.c 2014-02-18 18:39:43 UTC (rev
32400)
+++ libmicrohttpd/src/testcurl/perf_get.c 2014-02-18 18:39:59 UTC (rev
32401)
@@ -82,7 +82,7 @@
{
struct timeval tv;
- GETTIMEOFDAY (&tv, NULL);
+ gettimeofday (&tv, NULL);
return (((unsigned long long) tv.tv_sec * 1000LL) +
((unsigned long long) tv.tv_usec / 1000LL));
}
Modified: libmicrohttpd/src/testcurl/perf_get_concurrent.c
===================================================================
--- libmicrohttpd/src/testcurl/perf_get_concurrent.c 2014-02-18 18:39:43 UTC
(rev 32400)
+++ libmicrohttpd/src/testcurl/perf_get_concurrent.c 2014-02-18 18:39:59 UTC
(rev 32401)
@@ -78,7 +78,7 @@
{
struct timeval tv;
- GETTIMEOFDAY (&tv, NULL);
+ gettimeofday (&tv, NULL);
return (((unsigned long long) tv.tv_sec * 1000LL) +
((unsigned long long) tv.tv_usec / 1000LL));
}
Modified: libmicrohttpd/src/testcurl/test_get.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get.c 2014-02-18 18:39:43 UTC (rev
32400)
+++ libmicrohttpd/src/testcurl/test_get.c 2014-02-18 18:39:59 UTC (rev
32401)
@@ -461,10 +461,10 @@
if (d == NULL)
return 16;
- fd = SOCKET (PF_INET, SOCK_STREAM, 0);
- if (fd < 0)
+ fd = socket (PF_INET, SOCK_STREAM, 0);
+ if (fd == MHD_INVALID_SOCKET)
{
- fprintf(stderr, "socket: %m\n");
+ fprintf(stderr, "socket error\n");
return 256;
}
@@ -473,9 +473,9 @@
sin.sin_port = htons(1081);
sin.sin_addr.s_addr = htonl(0x7f000001);
- if (CONNECT (fd, (struct sockaddr *)(&sin), sizeof(sin)) < 0)
+ if (connect (fd, (struct sockaddr *)(&sin), sizeof(sin)) < 0)
{
- fprintf(stderr, "connect: %m\n");
+ fprintf(stderr, "connect error\n");
MHD_socket_close_ (fd);
return 512;
}
Modified: libmicrohttpd/src/testcurl/test_get_sendfile.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get_sendfile.c 2014-02-18 18:39:43 UTC
(rev 32400)
+++ libmicrohttpd/src/testcurl/test_get_sendfile.c 2014-02-18 18:39:59 UTC
(rev 32401)
@@ -486,7 +486,7 @@
if (errorCount != 0)
fprintf (stderr, "Error (code: %u)\n", errorCount);
curl_global_cleanup ();
- UNLINK (sourcefile);
+ unlink (sourcefile);
free (sourcefile);
return errorCount != 0; /* 0 == pass */
}
Modified: libmicrohttpd/src/testcurl/test_post_loop.c
===================================================================
--- libmicrohttpd/src/testcurl/test_post_loop.c 2014-02-18 18:39:43 UTC (rev
32400)
+++ libmicrohttpd/src/testcurl/test_post_loop.c 2014-02-18 18:39:59 UTC (rev
32401)
@@ -462,7 +462,7 @@
{
struct timeval tv;
- GETTIMEOFDAY (&tv, NULL);
+ gettimeofday (&tv, NULL);
return (((unsigned long long) tv.tv_sec * 1000LL) +
((unsigned long long) tv.tv_usec / 1000LL));
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r32401 - in libmicrohttpd/src: include microhttpd testcurl,
gnunet <=