diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2025-08-01 23:25:32 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2025-08-02 00:21:56 +0200 |
commit | 607e4acefeec5776dfff63090a79baef15c6c336 (patch) | |
tree | 3e5af4cd1889feda403e33e64ee0fd5d3874ab7f /src/IO/dpi.c | |
parent | 9bbd9981dedbb9d074733aab2ab7c27ac8245a7d (diff) |
Handle OpAbort from DPI CCC server side
When loading http://elpis.ws and then the issue 10, several images are
requested via the data: URL which in turn causes many calls to the DPI
datauri plugin, and it seems some may fail. When the DPI server fails to
reply, an OpAbort is received by the CCC, but is ignored when it comes
from the server side. This leaves the connection entry stale, and when
navigating backwards, an attempt to read a free chunk of memory causes a
crash.
Instead of ignoring the OpAbort, we handle it as if the CCC had received
an OpEnd event, which propagates the received operation to the chain and
then removes the connection.
Diffstat (limited to 'src/IO/dpi.c')
-rw-r--r-- | src/IO/dpi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/IO/dpi.c b/src/IO/dpi.c index 2d265b78..6729b011 100644 --- a/src/IO/dpi.c +++ b/src/IO/dpi.c @@ -2,6 +2,7 @@ * File: dpi.c * * Copyright (C) 2002-2007 Jorge Arellano Cid <jcid@dillo.org> + * Copyright (C) 2025 Rodrigo Arias Mallo <rodarima@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -713,8 +714,11 @@ void a_Dpi_ccc(int Op, int Branch, int Dir, ChainLink *Info, /* Data1 = dbuf */ Dpi_process_dbuf(IORead, Data1, Info->LocalKey); break; + case OpAbort: + MSG_WARN("Dpi server aborted the connection\n"); + /* fallthrough */ case OpEnd: - a_Chain_fcb(OpEnd, Info, NULL, NULL); + a_Chain_fcb(Op, Info, NULL, NULL); Dpi_conn_free(Info->LocalKey); dFree(Info); break; |