Bug #1097
closedWStreamResource under wthttpd
0%
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
Updated by Koen Deforche almost 13 years ago
- Status changed from New to InProgress
- Assignee set to Koen Deforche
Updated by Koen Deforche almost 13 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
Updated by Łukasz Matuszewski almost 13 years ago
Thanks again twice: for patch and suggestion...
I will have fixed widths in the first row.
Updated by Łukasz Matuszewski almost 13 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).
Updated by Koen Deforche almost 13 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;