diff --git a/cf-testd/cf-testd.c b/cf-testd/cf-testd.c index f6f64c47ef..b796b2bff7 100644 --- a/cf-testd/cf-testd.c +++ b/cf-testd/cf-testd.c @@ -40,7 +40,6 @@ #include // ThreadLock #include #include // ERR_get_error -#include // PatchStreamServe #include // PolicyServerReadFile #include // PRINTSIZE #include // acl_Free @@ -417,15 +416,11 @@ static bool CFTestD_BusyLoop( break; } - /* cf-testd has no leech2 state; serve an empty patch so that the - * hub's GETPATCH request succeeds. */ - Log(LOG_LEVEL_INFO, "Serving empty leech2 patch"); - if (PatchStreamServe(ConnectionInfoSSL(conn->conn_info), "", 0)) - { - return true; - } - - break; + /* Serve the patch using the same enterprise code path as cf-serverd. + * In a pure core build the stub refuses; with the enterprise plugin + * loaded a real leech2 patch is served from the state directory. + * Keep the connection open on success. */ + return ServeLeech2Patch(conn, last_hash); } case PROTOCOL_COMMAND_BAD: default: