Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/64059


Change subject: Fix memc usage
......................................................................

Fix memc usage

Code in Ib6e9cce4 has a possiblity to hang. Fix that.

Change-Id: Ic430094ea4a08d305e9ac0b27588a9294ff5fe30
---
M specials/SpecialCentralAutoLogin.php
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/59/64059/1

diff --git a/specials/SpecialCentralAutoLogin.php 
b/specials/SpecialCentralAutoLogin.php
index 6d89a13..ba4e365 100644
--- a/specials/SpecialCentralAutoLogin.php
+++ b/specials/SpecialCentralAutoLogin.php
@@ -102,10 +102,9 @@
                                'gu_id' => $gu_id,
                                'wikiid' => $wikiid,
                        );
-                       do {
-                               $token = MWCryptRand::generateHex( 32 );
-                               $key = CentralAuthUser::memcKey( 
'centralautologin-token', $token, $wikiid );
-                       } while ( !$wgMemc->add( $key, $memcData, 10 ) );
+                       $token = MWCryptRand::generateHex( 32 ) . dechex( 
$gu_id );
+                       $key = CentralAuthUser::memcKey( 
'centralautologin-token', $token, $wikiid );
+                       $wgMemc->add( $key, $memcData, 10 );
 
                        // Save memc token for L2
                        $this->getRequest()->setSessionData( 
'centralautologin-token', $token );

-- 
To view, visit https://gerrit.wikimedia.org/r/64059
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic430094ea4a08d305e9ac0b27588a9294ff5fe30
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to