You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2007/05/01 12:37:15 UTC

[jira] Closed: (MODPYTHON-180) publisher wrongly generating warning that there is 'nothing to publish'

     [ https://issues.apache.org/jira/browse/MODPYTHON-180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Graham Dumpleton closed MODPYTHON-180.
--------------------------------------


> publisher wrongly generating warning that there is 'nothing to publish'
> -----------------------------------------------------------------------
>
>                 Key: MODPYTHON-180
>                 URL: https://issues.apache.org/jira/browse/MODPYTHON-180
>             Project: mod_python
>          Issue Type: Bug
>          Components: publisher
>    Affects Versions: 3.3
>            Reporter: Graham Dumpleton
>         Assigned To: Graham Dumpleton
>             Fix For: 3.3
>
>
> Publisher handler contains the code:
>     # we log a message if nothing was published, it helps with debugging
>     if (not published) and (req.bytes_sent==0) and (req.next is None):
>         log=int(req.get_config().get("PythonDebug", 0))
>         if log:
>             req.log_error("mod_python.publisher: nothing to publish.")
> The idea is that if the publisher didn't generate any output and simply returned None, that a warning would be generated which might be noticed by a developer and thus be helpful to debugging problems.
> Problem is that "req.bytes_sent" is only actually non zero when data is flushed and actually written back to the client by Apache. It does not take into consideration any buffered data.
> In other words, if "req.write()" is used but second optional argument is always being set to 0 indicating that data should not be flushed, then publisher will wrongly say nothing actually got published.
> Because the PSP classes are no longer flushing data so that output filters like "CONTENT_LENGTH" will work, this will mean you will get this warning all the time when using code like:
>   from mod_python import apache, psp
>   def index(req):
>       page = psp.PSP(req, 'echo.psp')
>       page.run()
> Question is, is there a way to determine from Apache that there is buffered data. We don't really want to be adding another special flag in the mod_python request wrapper like req._content_type_set do we???

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.