https://bugs.documentfoundation.org/show_bug.cgi?id=154628

Julien Nabet <serval2...@yahoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |michael.st...@allotropia.de

--- Comment #5 from Julien Nabet <serval2...@yahoo.fr> ---
Here are 2 bts retrieved from 1 click:
#0  http_dav_ucp::Content::open(com::sun::star::ucb::OpenCommandArgument3
const&,
com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment>
const&)
    (this=0x561e53e48450, rArg=..., xEnv=uno::Reference to
(CCommandEnvironmentHelper *) 0x561e548cce88) at
ucb/source/ucp/webdav-curl/webdavcontent.cxx:2201
#1  0x00007f6d984d4ad2 in
http_dav_ucp::Content::execute(com::sun::star::ucb::Command const&, int,
com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment>
const&)
    (this=0x561e53e48450, aCommand=..., Environment=uno::Reference to
(CCommandEnvironmentHelper *) 0x561e548cce88) at
ucb/source/ucp/webdav-curl/webdavcontent.cxx:539
#2  0x00007f6d984e726d in non-virtual thunk to
http_dav_ucp::Content::execute(com::sun::star::ucb::Command const&, int,
com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment>
const&) ()
    at /home/julien/lo/libreoffice/instdir/program/../program/libucpdav1.so
#3  0x00007f6dd9d51947 in
ucbhelper::Content_Impl::executeCommand(com::sun::star::ucb::Command const&)
(this=0x561e53be4150, rCommand=...) at ucbhelper/source/client/content.cxx:1264
#4  0x00007f6dd9d5480b in
ucbhelper::Content::openStream(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>
const&)
    (this=0x7ffe1b880810, rStream=uno::Reference to (io_stm::(anonymous
namespace)::OPipeImpl *) 0x561e546391c8) at
ucbhelper/source/client/content.cxx:825
#5  0x00007f6d9b6674e1 in
CSubmissionGet::submit(com::sun::star::uno::Reference<com::sun::star::task::XInteractionHandler>
const&)
    (this=0x561e4fc22880, aInteractionHandler=uno::Reference to
(svxform::FormController *) 0x561e53d71388) at
forms/source/xforms/submission/submission_get.cxx:84

+

#0  http_dav_ucp::Content::open(com::sun::star::ucb::OpenCommandArgument3
const&,
com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment>
const&)
    (this=0x561e53e48450, rArg=..., xEnv=uno::Reference to
(CCommandEnvironmentHelper *) 0x561e548cce88) at
ucb/source/ucp/webdav-curl/webdavcontent.cxx:2267
#1  0x00007f6d984d4ad2 in
http_dav_ucp::Content::execute(com::sun::star::ucb::Command const&, int,
com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment>
const&)
    (this=0x561e53e48450, aCommand=..., Environment=uno::Reference to
(CCommandEnvironmentHelper *) 0x561e548cce88) at
ucb/source/ucp/webdav-curl/webdavcontent.cxx:539
#2  0x00007f6d984e726d in non-virtual thunk to
http_dav_ucp::Content::execute(com::sun::star::ucb::Command const&, int,
com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment>
const&) ()
    at /home/julien/lo/libreoffice/instdir/program/../program/libucpdav1.so
#3  0x00007f6dd9d51947 in
ucbhelper::Content_Impl::executeCommand(com::sun::star::ucb::Command const&)
(this=0x561e53be4150, rCommand=...) at ucbhelper/source/client/content.cxx:1264
#4  0x00007f6dd9d53860 in ucbhelper::Content::openStream()
(this=0x7ffe1b880810) at ucbhelper/source/client/content.cxx:709
#5  0x00007f6d9b667593 in
CSubmissionGet::submit(com::sun::star::uno::Reference<com::sun::star::task::XInteractionHandler>
const&)
    (this=0x561e4fc22880, aInteractionHandler=uno::Reference to
(svxform::FormController *) 0x561e53d71388) at
forms/source/xforms/submission/submission_get.cxx:88

These 2 calls at frame 0 call a GET function.

The 2 different calls are from
forms/source/xforms/submission/submission_get.cxx
line 84 and 88
     83         css::uno::Reference< XOutputStream > aPipe(
css::io::Pipe::create(m_xContext), UNO_QUERY_THROW );
     84         if (!aContent.openStream(aPipe))
     85             return UNKNOWN_ERROR;
     86         // get reply
     87         try {
     88             m_aResultStream = aContent.openStream();
     89         } catch (const Exception&) {
     90             OSL_FAIL("Cannot open reply stream from content");
     91         }

So perhaps we may just avoid the first call and use this patch:

diff --git a/forms/source/xforms/submission/submission_get.cxx
b/forms/source/xforms/submission/submission_get.cxx
index ae630b504b0c..1ddcd529ef1a 100644
--- a/forms/source/xforms/submission/submission_get.cxx
+++ b/forms/source/xforms/submission/submission_get.cxx
@@ -24,7 +24,6 @@
 #include <rtl/strbuf.hxx>
 #include <osl/diagnose.h>
 #include <ucbhelper/content.hxx>
-#include <com/sun/star/io/Pipe.hpp>
 #include <com/sun/star/task/InteractionHandler.hpp>
 #include <comphelper/diagnose_ex.hxx>

@@ -80,9 +79,6 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const
css::uno::Reference<
         }
         OUString aQueryURL = OStringToOUString(aUTF8QueryURL,
RTL_TEXTENCODING_UTF8);
         ucbhelper::Content aContent(aQueryURL, aEnvironment, m_xContext);
-        css::uno::Reference< XOutputStream > aPipe(
css::io::Pipe::create(m_xContext), UNO_QUERY_THROW );
-        if (!aContent.openStream(aPipe))
-            return UNKNOWN_ERROR;
         // get reply
         try {
             m_aResultStream = aContent.openStream();

Michael: does it seem reasonable?

Robert: if the patch is ok, it would allow you to just use:
"IF ($_SERVER['REQUEST_METHOD'] == "GET")" in xmldata_get.php
Without this line, you'll have:
- 1 line for OPTIONS (which is called when clicking on the macro at least once
+  after some delay)
- 1 line for HEAD (which is called for each click as you already noticed)
so 2 (HEAD+GET) or 3 lines (OPTIONS+HEAD+GET) at each click.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to