Description: Introduce function for performance of keep-alive and to allow WebDAV uploads
Origin: https://hg.orthanc-server.com/orthanc/file/default/OrthancFramework/Resources/Patches/civetweb-1.13.patch
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: civetweb-1.13/include/civetweb.h
===================================================================
--- civetweb-1.13.orig/include/civetweb.h
+++ civetweb-1.13/include/civetweb.h
@@ -1695,6 +1695,9 @@ CIVETWEB_API int mg_start_domain2(struct
                                   struct mg_error_data *error);
 #endif
 
+// Added by SJ
+CIVETWEB_API void mg_disable_keep_alive(struct mg_connection *conn);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: civetweb-1.13/src/civetweb.c
===================================================================
--- civetweb-1.13.orig/src/civetweb.c
+++ civetweb-1.13/src/civetweb.c
@@ -10876,6 +10876,11 @@ static const struct mg_http_method_info
     /* + MicroSoft extensions
      * https://msdn.microsoft.com/en-us/library/aa142917.aspx */
 
+    /* Added by SJ, for write access to WebDAV on Windows >= 7 */
+    {"LOCK", 1, 1, 0, 0, 0},
+    {"UNLOCK", 1, 0, 0, 0, 0},
+    {"PROPPATCH", 1, 1, 0, 0, 0},
+    
     /* REPORT method (RFC 3253) */
     {"REPORT", 1, 1, 1, 1, 1},
     /* REPORT method only allowed for CGI/Lua/LSP and callbacks. */
@@ -21287,4 +21292,12 @@ mg_exit_library(void)
 }
 
 
+// Added by SJ
+void mg_disable_keep_alive(struct mg_connection *conn)
+{
+  if (conn != NULL) {
+    conn->must_close = 1;
+  }
+}
+ 
 /* End of civetweb.c */
