about summary refs log tree commit diff stats
path: root/src/server
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-12 20:35:30 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-12 20:36:39 +0100
commita2eadfb39099b2e8bfd543f00d75b64916931959 (patch)
tree3df7afbb5a75ee51c1503b7961e940a3f37962a2 /src/server
parent8e6783a45fba48dd8f63fe7486e4691f05220b52 (diff)
downloadchawan-a2eadfb39099b2e8bfd543f00d75b64916931959.tar.gz
Add pager.externFilterSource
useful for filtering stuff through commands like rdrview
Diffstat (limited to 'src/server')
-rw-r--r--src/server/buffer.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index af857928..19a1407b 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -713,7 +713,7 @@ proc rewind(buffer: Buffer): bool =
   if buffer.loader.rewind(buffer.fd):
     return true
   let request = newRequest(buffer.url, fromcache = true)
-  let response = buffer.loader.doRequest(request, canredir = false)
+  let response = buffer.loader.doRequest(request)
   if response.body != nil:
     buffer.selector.unregister(buffer.fd)
     buffer.loader.unregistered.add(buffer.fd)
@@ -781,7 +781,8 @@ proc connect*(buffer: Buffer): ConnectResult {.proxy.} =
   var cookies: seq[Cookie]
   var referrerpolicy: Option[ReferrerPolicy]
   let request = source.request
-  let response = buffer.loader.doRequest(request, canredir = true)
+  request.canredir = true #TODO set somewhere else?
+  let response = buffer.loader.doRequest(request)
   if response.body == nil:
     return ConnectResult(
       code: response.res,
@@ -820,7 +821,7 @@ proc connect*(buffer: Buffer): ConnectResult {.proxy.} =
 # * connect2, telling loader to load at last (we block loader until then)
 # * redirectToFd, telling loader to load into the passed fd
 proc connect2*(buffer: Buffer) {.proxy.} =
-  if not buffer.source.request.fromcache:
+  if buffer.source.request.canredir:
     # Notify loader that we can proceed with loading the input stream.
     buffer.istream.swrite(false)
     buffer.istream.swrite(true)
@@ -856,7 +857,7 @@ proc readFromFd*(buffer: Buffer, url: URL, ishtml: bool) {.proxy.} =
     charset: buffer.source.charset
   )
   buffer.setHTML(ishtml)
-  let response = buffer.loader.doRequest(request, canredir = false)
+  let response = buffer.loader.doRequest(request)
   buffer.istream = response.body
   buffer.fd = int(response.body.source.getFd())
   buffer.selector.registerHandle(buffer.fd, {Read}, 0)