]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client: Made dummy response for returning internal errors more complet...
authorStephan Bosch <stephan@rename-it.nl>
Sat, 12 Oct 2013 07:53:16 +0000 (10:53 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Sat, 12 Oct 2013 07:53:16 +0000 (10:53 +0300)
src/lib-http/http-response.c
src/lib-http/http-response.h

index abafb865e013a404deab63a06c3056d08319bcd0..f5d23c142fec8c85777081409d548f1835ec6722 100644 (file)
@@ -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)
 {
index 80fce334b4b176d3526b5562c5a3abae1417c015..061ed2e1031aa2be0f65a0ecfea6660fc097c50e 100644 (file)
@@ -28,14 +28,9 @@ struct http_response {
        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)