Add support for L4Re Virtio Sockets
[src/app-framework-binder.git] / src / afb-websock.c
index fdfca9d..9e121c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017, 2018 "IoT.bzh"
+ * Copyright (C) 2016-2019 "IoT.bzh"
  * Author: José Bollo <jose.bollo@iot.bzh>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 
+#if WITH_LIBMICROHTTPD
+
 #define _GNU_SOURCE
 
 #include <stdlib.h>
@@ -158,7 +160,9 @@ static void upgrade_to_websocket(
                        close_websocket(urh);
                }
        }
+#if MHD_VERSION <= 0x00095900
        afb_hreq_unref(memo->hreq);
+#endif
        free(memo);
 }
 
@@ -253,3 +257,4 @@ int afb_websock_check_upgrade(struct afb_hreq *hreq, struct afb_apiset *apiset)
        return rc;
 }
 
+#endif