############################################################################## # $Id: FAQ.txt,v 1.1 2004/01/08 02:27:35 schilz Exp $ # # Copyright (c) 2004 Dr. Thomas Schilz # # This file is part of MozPython. # # MozPython is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # MozPython is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with MozPython; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################## ------------------------------------------------------------------------------ Q: Why can't we use the "file" protocol to read .py files? A: In nsDocShell::DoURILoad POST data is only set up for http channels. So if we use "file" channels we have no way to access POST data. ------------------------------------------------------------------------------ Q: Is there no other way to access POST data? A: No. POST data is extracted in nsFormSubmission::SubmitTo (file content/html/content/src/nsFormSubmission.cpp) and the passed on to nsWebShell::OnLinkClickSync to nsDocShell::InternalLoad to nsDocShell::DoURILoad, where it's finally discarded if the channel for the protocol does not implement nsIHttpChannel. ------------------------------------------------------------------------------ Q: Why don't we use use an internal nsFileChannel instance instead of copying most of it's methods? A: nsFileChannel only accepts "file:..." URLs. If we change "cfh" to "file" for the nsFileChannel, then this scheme somehow leaks through. The result is that relative URLs are openend with the "file" protocol. ------------------------------------------------------------------------------ Q: What is the mpdlpxpc library needed for? A: PyToHTMLConv uses a static method of one of PyXPCOM's classes (Py_nsISupports::PyObjectFromInterface) in the _xpcom library. Since the names of class methods get mangled by the compiler it is not possible to find them with their normal name in a library dynamically loaded at runtime. mpdlpxpc is linked against _xpcom and contains a "extern C" function PyObjectFromInterface which simply calls the static class method. ------------------------------------------------------------------------------ Q: Why not link PyToHTMLConv against _xpcom? A: Then if PyXPCOM isn't installed on the system PyToHTMLCons will fail to load.