Project

General

Profile

Actions

Bug #1097

closed

WStreamResource under wthttpd

Added by Łukasz Matuszewski over 12 years ago. Updated about 12 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
Actions #1

Updated by Koen Deforche over 12 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
Actions #2

Updated by Koen Deforche over 12 years ago

  • 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

Actions #3

Updated by Łukasz Matuszewski over 12 years ago

Thanks again twice: for patch and suggestion...

I will have fixed widths in the first row.

Actions #4

Updated by Łukasz Matuszewski over 12 years ago

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).

Actions #5

Updated by Koen Deforche over 12 years ago

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;
Actions #6

Updated by Koen Deforche about 12 years ago

  • Status changed from Resolved to Closed

Fixed in 3.2.1

Actions

Also available in: Atom PDF