summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-02-11 17:30:10 +0100
committerSimon Josefsson <simon@josefsson.org>2009-02-11 17:30:10 +0100
commitb6d7c1c1c6f9e0b49d379ea66f46900909471001 (patch)
tree61ab87ea6f776e1fcbdc06f7a3d2858a7fb96e7e
parent20ab2b58da366d7ee3a8fb35e306e021d172eae7 (diff)
downloadgnutls-b6d7c1c1c6f9e0b49d379ea66f46900909471001.tar.gz
More gnulib usage.
-rw-r--r--src/serv.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/serv.c b/src/serv.c
index c851b06c94..218f64e65a 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -43,9 +43,11 @@
#include <netdb.h>
#include <error.h>
+/* Gnulib portability files. */
#include "progname.h"
#include "version-etc.h"
#include "read-file.h"
+#include "minmax.h"
/* konqueror cannot handle sending the page in multiple
* pieces.
@@ -87,12 +89,6 @@ char *x509_crlfile = NULL;
#define GERR(ret) fprintf(stdout, "Error: %s\n", safe_strerror(ret))
-#undef max
-#define max(x,y) ((x) > (y) ? (x) : (y))
-#undef min
-#define min(x,y) ((x) < (y) ? (x) : (y))
-
-
#define HTTP_END "</BODY></HTML>\n\n"
#define HTTP_UNIMPLEMENTED "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n<HTML><HEAD>\r\n<TITLE>501 Method Not Implemented</TITLE>\r\n</HEAD><BODY>\r\n<H1>Method Not Implemented</H1>\r\n<HR>\r\n</BODY></HTML>\r\n"
@@ -1046,7 +1042,7 @@ main (int argc, char **argv)
/* check for new incoming connections */
FD_SET (h, &rd);
- n = max (n, h);
+ n = MAX (n, h);
/* flag which connections we are reading or writing to within the fd sets */
lloopstart (listener_list, j)
@@ -1064,12 +1060,12 @@ main (int argc, char **argv)
if (j->http_state == HTTP_STATE_REQUEST)
{
FD_SET (j->fd, &rd);
- n = max (n, j->fd);
+ n = MAX (n, j->fd);
}
if (j->http_state == HTTP_STATE_RESPONSE)
{
FD_SET (j->fd, &wr);
- n = max (n, j->fd);
+ n = MAX (n, j->fd);
}
}
lloopend (listener_list, j);
@@ -1185,7 +1181,7 @@ main (int argc, char **argv)
if (j->handshake_ok == 1)
{
r = gnutls_record_recv (j->tls_session, buf,
- min (1024, SMALL_READ_TEST));
+ MIN (1024, SMALL_READ_TEST));
if (r == GNUTLS_E_INTERRUPTED || r == GNUTLS_E_AGAIN)
{
/* do nothing */
@@ -1286,7 +1282,7 @@ main (int argc, char **argv)
r = gnutls_record_send (j->tls_session,
j->http_response +
j->response_written,
- min (j->response_length -
+ MIN (j->response_length -
j->response_written,
SMALL_READ_TEST));
if (r == GNUTLS_E_INTERRUPTED || r == GNUTLS_E_AGAIN)