uhttpd: recognize PATCH, PUT and DELETE HTTP methods
[project/uhttpd.git] / client.c
index 05044ed9d38dc3755a80a9cd8e2c7cc2cbf631c9..3c1aa9daf783a587cffc9be44241de396d2d9b77 100644 (file)
--- a/client.c
+++ b/client.c
@@ -40,6 +40,9 @@ const char * const http_methods[] = {
        [UH_HTTP_MSG_POST] = "POST",
        [UH_HTTP_MSG_HEAD] = "HEAD",
        [UH_HTTP_MSG_OPTIONS] = "OPTIONS",
+       [UH_HTTP_MSG_PUT] = "PUT",
+       [UH_HTTP_MSG_PATCH] = "PATCH",
+       [UH_HTTP_MSG_DELETE] = "DELETE",
 };
 
 void uh_http_header(struct client *cl, int code, const char *summary)
@@ -553,6 +556,12 @@ void uh_client_notify_state(struct client *cl)
 
                if (!s->eof || s->w.data_bytes)
                        return;
+
+               if (cl->tls && cl->ssl.conn && cl->ssl.conn->w.data_bytes) {
+                       cl->ssl.conn->eof = s->eof;
+                       if (!ustream_write_pending(cl->ssl.conn))
+                               return;
+               }
        }
 
        return client_close(cl);