Project

General

Profile

Actions

Bug #1097

closed
ŁM KD

WStreamResource under wthttpd

Bug #1097: WStreamResource under wthttpd

Added by Łukasz Matuszewski almost 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
12/13/2011
Due date:
% Done:

0%

Estimated time:

Description

It seems that WStreamResource does not work correctly under wthttpd. I have attached simplified version of my WStreamResource class.
Hope you will compile it and test it.


Files

mir_sp_paramselresource.cpp (13.4 KB) mir_sp_paramselresource.cpp Łukasz Matuszewski, 12/13/2011 01:45 PM
mir_sp_paramselresource.h (1.7 KB) mir_sp_paramselresource.h Łukasz Matuszewski, 12/13/2011 01:45 PM

KD Updated by Koen Deforche almost 15 years ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche

KD Updated by Koen Deforche almost 15 years ago Actions #2

  • Status changed from InProgress to Resolved
  • Target version set to 3.2.1

Hey,

There was indeed a regression in resource continuations.
This is fixed in git.

The following patch will also fix this:

diff --git a/src/Wt/WResource.C b/src/Wt/WResource.C
index 23ec176..04f0e49 100644
--- a/src/Wt/WResource.C
+++ b/src/Wt/WResource.C
@@ -128,6 +128,9 @@ void WResource::handle(WebRequest *webRequest, WebResponse *
   Http::Request request(*webRequest, continuation);
   Http::Response response(this, webResponse, continuation);

+  if (!continuation)
+    response.setStatus(200);
+
   handleRequest(request, response);

   if (!response.continuation_ || !response.continuation_->resource_) {

By the way, as you will notice, the HTML renderer implementation does not (yet) attempt to be efficient when laying out tables (or even in general): each time a column needs to be widened because of cell contents, it will cause the whole table to be re-layout. If you can't live with that, his should either be fixed, or you can work around it by imposing the column widths in the first row.

Regards,
koen

ŁM Updated by Łukasz Matuszewski almost 15 years ago Actions #3

Thanks again twice: for patch and suggestion...
I will have fixed widths in the first row.

ŁM Updated by Łukasz Matuszewski almost 15 years ago Actions #4

How can i impose the column widths in the first row ? Can you provide working example (which is faster) ? I tried some solutions but failed (still need loong time to produce PDF).

KD Updated by Koen Deforche almost 15 years ago Actions #5

Hey,

That was the theory indeed, in practice it turned out that widths were ignored.
Here is a patch that fixes that (also in git).

With this patch, css widths set on a table cells (td or th) will be taken into account.
e.g.

...

diff --git a/src/Wt/Render/Block.C b/src/Wt/Render/Block.C
index ddd2129..18575ea 100644
--- a/src/Wt/Render/Block.C
+++ b/src/Wt/Render/Block.C
@@ -1308,8 +1308,22 @@ void Block::layoutBlock(double& y, int& page, BlockList& 
        + cssPadding(Right, renderer.fontScale())
        + cssBorderWidth(Right, renderer.fontScale());

+      if (type_ == DomElement_TD || type_ == DomElement_TH) {
+       if (width < (maxX - minX))
+         width = maxX - minX;
+       /*
+        * A width set on a td or th should be considered as a desired
+        * width -- this cell should not try to consume excess width
+        */
+       canIncreaseWidth = false;
+      }
+
+      if (width > (maxX - minX))
+       throw PleaseWiden(width - (maxX - minX));
+
       AlignmentFlag hAlign = horizontalAlignment();
       switch (hAlign) {
+      case AlignJustify:
       case AlignLeft:
        maxX = minX + width;
        break;

KD Updated by Koen Deforche over 14 years ago Actions #6

  • Status changed from Resolved to Closed

Fixed in 3.2.1

Actions

Also available in: PDF Atom