From: daurnimator Date: Mon, 19 Dec 2016 04:44:16 +0000 (+1100) Subject: Use coroutine friendly pcall X-Git-Tag: v1.2.0-rc1~56^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c5d2f1cdf3361bf6daab419f076a9b44b72b950;p=thirdparty%2Fknot-resolver.git Use coroutine friendly pcall --- diff --git a/modules/http/http.lua b/modules/http/http.lua index ee1cf9009..010f2062b 100644 --- a/modules/http/http.lua +++ b/modules/http/http.lua @@ -13,6 +13,7 @@ local cqueues = require('cqueues') local server = require('http.server') local headers = require('http.headers') local websocket = require('http.websocket') +local http_util = require "http.util" local x509, pkey = require('openssl.x509'), require('openssl.pkey') local has_mmdb, mmdb = pcall(require, 'mmdb') @@ -172,7 +173,7 @@ local function route(endpoints) ws:close() return else - local ok, err, reason = pcall(serve, h, stream) + local ok, err, reason = http_util.yieldable_pcall(serve, h, stream) if not ok or err then if err ~= '404' then log('[http] %s %s: %s (%s)', m, path, err or '500', reason)