[Libreoffice-commits] .: Branch 'libreoffice-3-3' - 3 commits - patches/dev300

Tor Lillqvist tml at kemper.freedesktop.org
Mon Feb 21 00:30:23 PST 2011


 patches/dev300/apply                           |    4 +-
 patches/dev300/webdav-locking-after-mav58.diff |   37 ++++++++++++++++++-------
 2 files changed, 29 insertions(+), 12 deletions(-)

New commits:
commit 1b6acec4eb7cb00e4c84869fcd76debf9473c843
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Mon Feb 21 10:24:02 2011 +0200

    Revert the desperate hacks, they did not help

diff --git a/patches/dev300/webdav-locking-after-mav58.diff b/patches/dev300/webdav-locking-after-mav58.diff
index 89dda80..2f0c461 100644
--- a/patches/dev300/webdav-locking-after-mav58.diff
+++ b/patches/dev300/webdav-locking-after-mav58.diff
@@ -25,85 +25,6 @@
  }
 --- ucb/source/ucp/webdav/NeonSession.cxx
 +++ ucb/source/ucp/webdav/NeonSession.cxx
-@@ -251,6 +251,30 @@
- #endif
- }
- 
-+typedef struct {
-+    rtl::OUString host;
-+    char *realm;
-+} HostAndRealm;
-+
-+typedef struct {
-+    char *name;
-+    char *password;
-+} NameAndPassword;
-+
-+struct hashHostAndRealm {
-+    size_t operator()( const HostAndRealm* p ) const
-+    {
-+        return (p->host.hashCode() ^ rtl_str_hashCode( p->realm ));
-+    }
-+};
-+
-+struct equalHostAndRealm {
-+    bool operator()( const HostAndRealm* p1, const HostAndRealm* p2 ) const
-+    {
-+        return (p1->host == p2->host) && (strcmp( p1->realm, p2->realm ) == 0);
-+    }
-+};
-+
- // -------------------------------------------------------------------
- extern "C" int NeonSession_NeonAuth( void *       inUserData,
- #ifdef NE_FEATURE_SSPI
-@@ -272,6 +272,9 @@
-  * cancel the request. (if non-zero, username and password are
-  * ignored.)  */
- 
-+    typedef std::hash_map< HostAndRealm*, NameAndPassword*, hashHostAndRealm, equalHostAndRealm > SavedAuthMap;
-+    static SavedAuthMap *saved_auth_map = new SavedAuthMap;
-+
-     NeonSession * theSession = static_cast< NeonSession * >( inUserData );
-     DAVAuthListener * pListener
-         = theSession->getRequestEnvironment().m_xAuthListener.get();
-@@ -388,6 +388,37 @@
-     strcpy( inoutPassWord, // #100211# - checked
-             rtl::OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ) );
- 
-+    // Extremely ugly hack, but what the heck...
-+    HostAndRealm* key = new HostAndRealm;
-+    key->host = theSession->getHostName();
-+    key->realm = strdup( inRealm );
-+    SavedAuthMap::const_iterator it = saved_auth_map->find( key );
-+    if ( inoutUserName[0] == '\0' && inoutPassWord[0] == '\0' )
-+    {
-+        if ( it != saved_auth_map->end() )
-+        {
-+            strcpy( inoutUserName, (*it).second->name );
-+            strcpy( inoutPassWord, (*it).second->password );
-+        }
-+        free( key->realm );
-+        delete key;
-+    }
-+    else if ( inoutUserName[0] != '\0' )
-+    {
-+        if ( it == saved_auth_map->end() )
-+        {
-+            NameAndPassword* value = new NameAndPassword;
-+            value->name = strdup( inoutUserName );
-+            value->password = strdup( inoutPassWord );
-+            (*saved_auth_map)[ key ] = value;
-+        }
-+        else
-+        {
-+            free( key->realm );
-+            delete key;
-+        }
-+    }
-+
-     return theRetVal;
- }
- 
 @@ -693,17 +693,17 @@
              // #122205# - libxml2 needs to be initialized once if used by
              // multithreaded programs like OOo.
commit 56b53f05754a1e996531363e5567c000f4979dc4
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Sat Feb 19 22:20:39 2011 +0200

    Move the WebDAV patches from NovellOnly to under Experimental

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 8a73895..0fef9f8 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -28,7 +28,7 @@ MacOSXCommon : Common, Defaults
 Win32Common : Common, Defaults, Win32Only, CliMonoCommon, CliComponent, NotDebian
 # Experimental sections
 Experimental: VBAUntested, ArkOnlyExperimental, \
-	      UnUsedButNotYetRemovedFromGit, \
+	      UnUsedButNotYetRemovedFromGit, WebDAV, \
 	      PostgreSQL, SELinux, \
 	      UnitBootstrap, RadioButtons, WWInProgress, \
 	      KDE4Experimental, MinGW, CalcExperimental, \
@@ -1367,7 +1367,7 @@ vba-import-xlsm.diff
 sfx2-pre-and-postprocess-during-save-load.diff, i#71939, flr
 
 
-[ NovellOnly ]
+[ WebDAV ]
 SectionOwner => tml
 SectionIssue => bnc#651977
 
commit 96efbfabb6dd6b3d89bef9d33358f4f0822dd7fd
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Sat Feb 19 22:15:28 2011 +0200

    More desperate attempts

diff --git a/patches/dev300/webdav-locking-after-mav58.diff b/patches/dev300/webdav-locking-after-mav58.diff
index 057459c..89dda80 100644
--- a/patches/dev300/webdav-locking-after-mav58.diff
+++ b/patches/dev300/webdav-locking-after-mav58.diff
@@ -9,8 +9,101 @@
  +
  +/* Define to be printf format string for off64_t */
  +#define NE_FMT_OFF64_T "lld"
+--- sfx2/source/doc/objstor.cxx
++++ sfx2/source/doc/objstor.cxx
+@@ -1405,7 +1405,10 @@
+         {}
+     }
+ 
+-    OSL_ENSURE( bResult, "Storage disconnecting has failed - affects performance!" );
++#if OSL_DEBUG_LEVEL > 0
++    if( !bResult )
++        fprintf( stderr, "Storage disconnecting has failed - affects performance!\n" );
++#endif
+ 
+     return bResult;
+ }
 --- ucb/source/ucp/webdav/NeonSession.cxx
 +++ ucb/source/ucp/webdav/NeonSession.cxx
+@@ -251,6 +251,30 @@
+ #endif
+ }
+ 
++typedef struct {
++    rtl::OUString host;
++    char *realm;
++} HostAndRealm;
++
++typedef struct {
++    char *name;
++    char *password;
++} NameAndPassword;
++
++struct hashHostAndRealm {
++    size_t operator()( const HostAndRealm* p ) const
++    {
++        return (p->host.hashCode() ^ rtl_str_hashCode( p->realm ));
++    }
++};
++
++struct equalHostAndRealm {
++    bool operator()( const HostAndRealm* p1, const HostAndRealm* p2 ) const
++    {
++        return (p1->host == p2->host) && (strcmp( p1->realm, p2->realm ) == 0);
++    }
++};
++
+ // -------------------------------------------------------------------
+ extern "C" int NeonSession_NeonAuth( void *       inUserData,
+ #ifdef NE_FEATURE_SSPI
+@@ -272,6 +272,9 @@
+  * cancel the request. (if non-zero, username and password are
+  * ignored.)  */
+ 
++    typedef std::hash_map< HostAndRealm*, NameAndPassword*, hashHostAndRealm, equalHostAndRealm > SavedAuthMap;
++    static SavedAuthMap *saved_auth_map = new SavedAuthMap;
++
+     NeonSession * theSession = static_cast< NeonSession * >( inUserData );
+     DAVAuthListener * pListener
+         = theSession->getRequestEnvironment().m_xAuthListener.get();
+@@ -388,6 +388,37 @@
+     strcpy( inoutPassWord, // #100211# - checked
+             rtl::OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ) );
+ 
++    // Extremely ugly hack, but what the heck...
++    HostAndRealm* key = new HostAndRealm;
++    key->host = theSession->getHostName();
++    key->realm = strdup( inRealm );
++    SavedAuthMap::const_iterator it = saved_auth_map->find( key );
++    if ( inoutUserName[0] == '\0' && inoutPassWord[0] == '\0' )
++    {
++        if ( it != saved_auth_map->end() )
++        {
++            strcpy( inoutUserName, (*it).second->name );
++            strcpy( inoutPassWord, (*it).second->password );
++        }
++        free( key->realm );
++        delete key;
++    }
++    else if ( inoutUserName[0] != '\0' )
++    {
++        if ( it == saved_auth_map->end() )
++        {
++            NameAndPassword* value = new NameAndPassword;
++            value->name = strdup( inoutUserName );
++            value->password = strdup( inoutPassWord );
++            (*saved_auth_map)[ key ] = value;
++        }
++        else
++        {
++            free( key->realm );
++            delete key;
++        }
++    }
++
+     return theRetVal;
+ }
+ 
 @@ -693,17 +693,17 @@
              // #122205# - libxml2 needs to be initialized once if used by
              // multithreaded programs like OOo.
@@ -31,24 +124,25 @@
                           );
  #endif
              m_bGlobalsInited = true;
-@@ -1489,6 +1489,16 @@
+@@ -1489,6 +1489,17 @@
  
      if ( theRetVal == NE_OK )
      {
 +        // If the server tells us it actually is using a timeout
 +        // slightly smaller than what we asked for, just
 +        // ask for the same timeout again next time.
-+        // Also, never let the timeout we ask for be really small.
++        // Also, never let the timeout we ask for be shorter
++        // than a minute.
 +        if ( theLock->timeout < rLock.Timeout &&
 +             rLock.Timeout - theLock->timeout < 10 )
 +            theLock->timeout = (long) rLock.Timeout;
-+        else if ( theLock->timeout < 10 )
-+            theLock->timeout = 10;
++        else if ( theLock->timeout < 60 )
++            theLock->timeout = 60;
 +
          m_aNeonLockStore.addLock( theLock,
                                    this,
                                    lastChanceToSendRefreshRequest(
-@@ -1539,10 +1539,18 @@
+@@ -1539,10 +1539,19 @@
      TimeValue startCall;
      osl_getSystemTime( &startCall );
  
@@ -58,16 +152,17 @@
  
      if ( theRetVal == NE_OK )
      {
++        // See comment above in the first LOCK()
 +        if ( theLock->timeout < old_timeout &&
 +             old_timeout - theLock->timeout < 10 )
 +            theLock->timeout = old_timeout;
-+        else if ( theLock->timeout < 10 )
-+            theLock->timeout = 10;
++        else if ( theLock->timeout < 60 )
++            theLock->timeout = 60;
 +
          m_aNeonLockStore.updateLock( theLock,
                                       lastChanceToSendRefreshRequest(
                                           startCall, theLock->timeout ) );
-@@ -1589,8 +1589,16 @@
+@@ -1589,8 +1589,17 @@
      TimeValue startCall;
      osl_getSystemTime( &startCall );
  
@@ -75,11 +170,12 @@
 +
      if ( ne_lock_refresh( m_pHttpSession, pLock ) == NE_OK )
      {
++        // See comment above in the first LOCK()
 +        if ( pLock->timeout < old_timeout &&
 +             old_timeout - pLock->timeout < 10 )
 +            pLock->timeout = old_timeout;
-+        else if ( pLock->timeout < 10 )
-+            pLock->timeout = 10;
++        else if ( pLock->timeout < 60 )
++            pLock->timeout = 60;
 +
          rlastChanceToSendRefreshRequest
              = lastChanceToSendRefreshRequest( startCall, pLock->timeout );


More information about the Libreoffice-commits mailing list