gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r5427 - in libmicrohttpd: . doc src/daemon


From: gnunet
Subject: [GNUnet-SVN] r5427 - in libmicrohttpd: . doc src/daemon
Date: Wed, 8 Aug 2007 14:48:53 -0600 (MDT)

Author: grothoff
Date: 2007-08-08 14:48:41 -0600 (Wed, 08 Aug 2007)
New Revision: 5427

Modified:
   libmicrohttpd/AUTHORS
   libmicrohttpd/README
   libmicrohttpd/doc/libmicrohttpd.3
   libmicrohttpd/src/daemon/connection.c
   libmicrohttpd/src/daemon/connection.h
   libmicrohttpd/src/daemon/daemon.c
   libmicrohttpd/src/daemon/internal.c
   libmicrohttpd/src/daemon/internal.h
   libmicrohttpd/src/daemon/memorypool.c
   libmicrohttpd/src/daemon/memorypool.h
   libmicrohttpd/src/daemon/response.c
   libmicrohttpd/src/daemon/response.h
Log:
fixing 1261

Modified: libmicrohttpd/AUTHORS
===================================================================
--- libmicrohttpd/AUTHORS       2007-08-08 20:12:16 UTC (rev 5426)
+++ libmicrohttpd/AUTHORS       2007-08-08 20:48:41 UTC (rev 5427)
@@ -1,2 +1,7 @@
+Primary developer:
 Christian Grothoff <address@hidden>
+
+Code contributions also came from:
 Chris GauthierDickey <address@hidden>
+Daniel Pittman 
+Nils Durner <address@hidden>

Modified: libmicrohttpd/README
===================================================================
--- libmicrohttpd/README        2007-08-08 20:12:16 UTC (rev 5426)
+++ libmicrohttpd/README        2007-08-08 20:48:41 UTC (rev 5427)
@@ -16,7 +16,6 @@
 connection.c:
 - support chunked requests from clients (#1260, ARCH, TEST)
 - send proper error code back if client forgot the "Host" header (#1264, TRIV)
-- automatically add MHD_HTTP_HEADER_DATE if client "forgot" to add one (#1261, 
TRIV)
 
 For POST:
 =========

Modified: libmicrohttpd/doc/libmicrohttpd.3
===================================================================
--- libmicrohttpd/doc/libmicrohttpd.3   2007-08-08 20:12:16 UTC (rev 5426)
+++ libmicrohttpd/doc/libmicrohttpd.3   2007-08-08 20:48:41 UTC (rev 5427)
@@ -1,28 +1,36 @@
-.TH LIBMICROHTTPD 3 "Jan 12, 2007"
-.SH NAME
-libmicrohttpd \- description 0.0.0
-.SH SYNOPSIS
+.TH LIBMICROHTTPD "3" "08 Aug 2007" "libmicrohttpd"
+.SH "NAME"
+libmicrohttpd \- library for embedding HTTP servers
+.SH "SYNOPSIS"
 
 \fB#include <microhttpd.h>
 
-Insert API here.
+\fPInsert API here.
 
-.SH DESCRIPTION
+.SH "DESCRIPTION"
 .P
 Insert API description here.
 
 .P
 .SH "SEE ALSO"
-fixme(1)
+\fBcurl\fP(1), \fBlibcurl\fP(3)
 
-.SH LEGAL NOTICE
+.SH "LEGAL NOTICE"
 libmicrohttpd is released under the GPL.
 
-.SH BUGS
-None, of course.
+.SH "FILES"
+.TP
+microhttpd.h
+libmicrohttpd include file
+.TP
+libmicrohttpd.so
+libmicrohttpd library
 
-.SH AUTHORS
-libmicrohttpd was originally designed by Christian Grothoff <address@hidden> 
and Chris GauthierDickey <address@hidden>.  
+.SH "REPORTING BUGS"
+Report bugs by using mantis <https://gnunet.org/mantis/>.
 
-.SH AVAILABILITY
+.SH "AUTHORS"
+libmicrohttpd was originally designed by Christian Grothoff <address@hidden> 
and Chris GauthierDickey <address@hidden>.  The implementation was done by 
Daniel Pittman and Christian Grothoff.
+
+.SH "AVAILABILITY"
 You can obtain the latest version from http://gnunet.org/libmicrohttpd/.

Modified: libmicrohttpd/src/daemon/connection.c
===================================================================
--- libmicrohttpd/src/daemon/connection.c       2007-08-08 20:12:16 UTC (rev 
5426)
+++ libmicrohttpd/src/daemon/connection.c       2007-08-08 20:48:41 UTC (rev 
5427)
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     (C) 2007 Daniel Pittman
+     (C) 2007 Daniel Pittman and Christian Grothoff
 
      libmicrohttpd is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -880,10 +880,10 @@
 
   if (connection->response->total_size == -1) {
     have = MHD_get_response_header(connection->response,
-                                  "Connection");
+                                  MHD_HTTP_HEADER_CONNECTION);
     if (have == NULL)
       MHD_add_response_header(connection->response,
-                             "Connection",
+                             MHD_HTTP_HEADER_CONNECTION,
                              "close");
   } else if (NULL == MHD_get_response_header(connection->response,
                                             MHD_HTTP_HEADER_CONTENT_LENGTH)) {
@@ -894,9 +894,30 @@
     MHD_add_response_header(connection->response,
                            MHD_HTTP_HEADER_CONTENT_LENGTH,
                            buf);
-  }
+  }  
 }
 
+static void get_date_string(char * date,
+                           unsigned int max) {
+  static const char * days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", 
"Sat" };
+  static const char * mons[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", 
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+  struct tm now;
+  time_t t;
+
+  time(&t);
+  gmtime_r(&t, &now);
+  snprintf(date,
+          max-1,
+          "Date: %3s, %02u %3s %04u %02u:%02u:%02u GMT\r\n",
+          days[now.tm_wday % 7],
+          now.tm_mday,
+          mons[now.tm_mon % 12],
+          now.tm_year,
+          now.tm_hour,
+          now.tm_min,
+          now.tm_sec);
+}
+
 /**
  * Allocate the connection's write buffer and
  * fill it with all of the headers from the
@@ -908,6 +929,7 @@
   size_t off;
   struct MHD_HTTP_Header * pos;
   char code[32];
+  char date[128];
   char * data;
 
   MHD_add_extra_headers(connection);
@@ -923,6 +945,12 @@
     size += strlen(pos->header) + strlen(pos->value) + 4; /* colon, space, 
linefeeds */
     pos = pos->next;
   }
+  if (NULL == MHD_get_response_header(connection->response,
+                                     MHD_HTTP_HEADER_DATE)) 
+    get_date_string(date, sizeof(date));
+  else
+    date[0] = '\0';  
+  size += strlen(date);
   /* produce data */
   data = MHD_pool_allocate(connection->pool,
                           size + 1,
@@ -944,6 +972,9 @@
     off += strlen(pos->header) + strlen(pos->value) + 4;
     pos = pos->next;
   }
+  strcpy(&data[off],
+        date);
+  off += strlen(date);
   sprintf(&data[off],
          "\r\n");
   off += 2;

Modified: libmicrohttpd/src/daemon/connection.h
===================================================================
--- libmicrohttpd/src/daemon/connection.h       2007-08-08 20:12:16 UTC (rev 
5426)
+++ libmicrohttpd/src/daemon/connection.h       2007-08-08 20:48:41 UTC (rev 
5427)
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     (C) 2007 Daniel Pittman
+     (C) 2007 Daniel Pittman and Christian Grothoff
 
      libmicrohttpd is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published

Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c   2007-08-08 20:12:16 UTC (rev 5426)
+++ libmicrohttpd/src/daemon/daemon.c   2007-08-08 20:48:41 UTC (rev 5427)
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     (C) 2007 Daniel Pittman
+     (C) 2007 Daniel Pittman and Christian Grothoff
 
      libmicrohttpd is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published

Modified: libmicrohttpd/src/daemon/internal.c
===================================================================
--- libmicrohttpd/src/daemon/internal.c 2007-08-08 20:12:16 UTC (rev 5426)
+++ libmicrohttpd/src/daemon/internal.c 2007-08-08 20:48:41 UTC (rev 5427)
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     (C) 2007 Daniel Pittman
+     (C) 2007 Daniel Pittman and Christian Grothoff
 
      libmicrohttpd is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published

Modified: libmicrohttpd/src/daemon/internal.h
===================================================================
--- libmicrohttpd/src/daemon/internal.h 2007-08-08 20:12:16 UTC (rev 5426)
+++ libmicrohttpd/src/daemon/internal.h 2007-08-08 20:48:41 UTC (rev 5427)
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     (C) 2007 Daniel Pittman
+     (C) 2007 Daniel Pittman and Christian Grothoff
 
      libmicrohttpd is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published

Modified: libmicrohttpd/src/daemon/memorypool.c
===================================================================
--- libmicrohttpd/src/daemon/memorypool.c       2007-08-08 20:12:16 UTC (rev 
5426)
+++ libmicrohttpd/src/daemon/memorypool.c       2007-08-08 20:48:41 UTC (rev 
5427)
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     (C) 2007 Daniel Pittman
+     (C) 2007 Daniel Pittman and Christian Grothoff
 
      libmicrohttpd is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published

Modified: libmicrohttpd/src/daemon/memorypool.h
===================================================================
--- libmicrohttpd/src/daemon/memorypool.h       2007-08-08 20:12:16 UTC (rev 
5426)
+++ libmicrohttpd/src/daemon/memorypool.h       2007-08-08 20:48:41 UTC (rev 
5427)
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     (C) 2007 Daniel Pittman
+     (C) 2007 Daniel Pittman and Christian Grothoff
 
      libmicrohttpd is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published

Modified: libmicrohttpd/src/daemon/response.c
===================================================================
--- libmicrohttpd/src/daemon/response.c 2007-08-08 20:12:16 UTC (rev 5426)
+++ libmicrohttpd/src/daemon/response.c 2007-08-08 20:48:41 UTC (rev 5427)
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     (C) 2007 Daniel Pittman
+     (C) 2007 Daniel Pittman and Christian Grothoff
 
      libmicrohttpd is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published

Modified: libmicrohttpd/src/daemon/response.h
===================================================================
--- libmicrohttpd/src/daemon/response.h 2007-08-08 20:12:16 UTC (rev 5426)
+++ libmicrohttpd/src/daemon/response.h 2007-08-08 20:48:41 UTC (rev 5427)
@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     (C) 2007 Daniel Pittman
+     (C) 2007 Daniel Pittman and Christian Grothoff
 
      libmicrohttpd is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published





reply via email to

[Prev in Thread] Current Thread [Next in Thread]