dovecot-2.2: lib-http: http-client: Made dummy response for retu...
dovecot at dovecot.org
dovecot at dovecot.org
Sat Oct 12 11:14:58 EEST 2013
details: http://hg.dovecot.org/dovecot-2.2/rev/aa39d877d2c5
changeset: 16848:aa39d877d2c5
user: Stephan Bosch <stephan at rename-it.nl>
date: Sat Oct 12 10:53:16 2013 +0300
description:
lib-http: http-client: Made dummy response for returning internal errors more complete by filling in the version number and a proper date.
diffstat:
src/lib-http/http-response.c | 13 +++++++++++++
src/lib-http/http-response.h | 9 ++-------
2 files changed, 15 insertions(+), 7 deletions(-)
diffs (46 lines):
diff -r 74bc909ba6a0 -r aa39d877d2c5 src/lib-http/http-response.c
--- a/src/lib-http/http-response.c Sat Oct 12 10:52:35 2013 +0300
+++ b/src/lib-http/http-response.c Sat Oct 12 10:53:16 2013 +0300
@@ -1,9 +1,22 @@
#include "lib.h"
#include "array.h"
+#include "ioloop.h"
#include "istream.h"
#include "http-response.h"
+void
+http_response_init(struct http_response *resp,
+ unsigned int status, const char *reason)
+{
+ memset(resp, 0, sizeof(*resp));
+ resp->version_major = 1;
+ resp->version_minor = 1;
+ resp->date = ioloop_time;
+ resp->status = status;
+ resp->reason = reason;
+}
+
bool http_response_has_connection_option(const struct http_response *resp,
const char *option)
{
diff -r 74bc909ba6a0 -r aa39d877d2c5 src/lib-http/http-response.h
--- a/src/lib-http/http-response.h Sat Oct 12 10:52:35 2013 +0300
+++ b/src/lib-http/http-response.h Sat Oct 12 10:53:16 2013 +0300
@@ -28,14 +28,9 @@
unsigned int connection_close:1;
};
-static inline void
+void
http_response_init(struct http_response *resp,
- unsigned int status, const char *reason)
-{
- memset(resp, 0, sizeof(*resp));
- resp->status = status;
- resp->reason = reason;
-}
+ unsigned int status, const char *reason);
static inline const struct http_header_field *
http_response_header_find(const struct http_response *resp, const char *name)
More information about the dovecot-cvs
mailing list