diff options
author | Justin Clarke Casey | 2008-10-24 21:22:54 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-24 21:22:54 +0000 |
commit | 3340a579e72f1248bb092a705db068027e46ef75 (patch) | |
tree | de14319e2adc598dff0fd7557fc4f9d807ac55a2 /OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |
parent | un-double-flipped some double-flipped normals in circular path prim end caps (diff) | |
download | opensim-SC-3340a579e72f1248bb092a705db068027e46ef75.zip opensim-SC-3340a579e72f1248bb092a705db068027e46ef75.tar.gz opensim-SC-3340a579e72f1248bb092a705db068027e46ef75.tar.bz2 opensim-SC-3340a579e72f1248bb092a705db068027e46ef75.tar.xz |
* Stop creating a circuit if the client fails authentication (i.e. the region server wasn't told that it was coming)
* This moves authentication from the client thread (where failure was difficult to detect) to the particular thread handling that packet
* I've kept the authentication outside of the crucial clientCircuits lock (though any delay here is probably swamped by the other delays associated with login)
* Also added more to the unit test to ensure this doesn't regress
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 2e9af74..40b4a42 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -385,11 +385,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
385 | //Slave regions don't accept new clients | 385 | //Slave regions don't accept new clients |
386 | if (m_localScene.Region_Status != RegionStatus.SlaveScene) | 386 | if (m_localScene.Region_Status != RegionStatus.SlaveScene) |
387 | { | 387 | { |
388 | AuthenticateResponse sessionInfo; | ||
388 | bool isNewCircuit = false; | 389 | bool isNewCircuit = false; |
389 | 390 | ||
391 | if (!m_packetServer.IsClientAuthorized(useCircuit, m_circuitManager, out sessionInfo)) | ||
392 | { | ||
393 | m_log.WarnFormat( | ||
394 | "[CLIENT]: New user request denied to avatar {0} connecting with unauthorized circuit code {1} from {2}", | ||
395 | useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code, epSender); | ||
396 | |||
397 | return; | ||
398 | } | ||
399 | else | ||
400 | { | ||
401 | m_log.Info("[CLIENT]: Got authenticated connection from " + epSender); | ||
402 | } | ||
403 | |||
390 | lock (clientCircuits) | 404 | lock (clientCircuits) |
391 | { | 405 | { |
392 | if (!clientCircuits.ContainsKey(epSender)) | 406 | if (!clientCircuits.ContainsKey(epSender)) |
393 | { | 407 | { |
394 | m_log.DebugFormat( | 408 | m_log.DebugFormat( |
395 | "[CLIENT]: Adding new circuit for agent {0}, circuit code {1}", | 409 | "[CLIENT]: Adding new circuit for agent {0}, circuit code {1}", |
@@ -409,8 +423,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
409 | { | 423 | { |
410 | proxyCircuits[useCircuit.CircuitCode.Code] = epProxy; | 424 | proxyCircuits[useCircuit.CircuitCode.Code] = epProxy; |
411 | } | 425 | } |
412 | 426 | ||
413 | m_packetServer.AddNewClient(epSender, useCircuit, m_assetCache, m_circuitManager, epProxy); | 427 | m_packetServer.AddNewClient(epSender, useCircuit, m_assetCache, sessionInfo, epProxy); |
414 | } | 428 | } |
415 | } | 429 | } |
416 | 430 | ||
@@ -533,6 +547,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
533 | useCircuit.CircuitCode.Code = circuit.circuitcode; | 547 | useCircuit.CircuitCode.Code = circuit.circuitcode; |
534 | useCircuit.CircuitCode.ID = circuit.AgentID; | 548 | useCircuit.CircuitCode.ID = circuit.AgentID; |
535 | useCircuit.CircuitCode.SessionID = circuit.SessionID; | 549 | useCircuit.CircuitCode.SessionID = circuit.SessionID; |
550 | |||
551 | AuthenticateResponse sessionInfo; | ||
552 | |||
553 | if (!m_packetServer.IsClientAuthorized(useCircuit, m_circuitManager, out sessionInfo)) | ||
554 | { | ||
555 | m_log.WarnFormat( | ||
556 | "[CLIENT]: Restore request denied to avatar {0} connecting with unauthorized circuit code {1}", | ||
557 | useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); | ||
558 | |||
559 | return; | ||
560 | } | ||
536 | 561 | ||
537 | lock (clientCircuits) | 562 | lock (clientCircuits) |
538 | { | 563 | { |
@@ -562,7 +587,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
562 | } | 587 | } |
563 | } | 588 | } |
564 | 589 | ||
565 | m_packetServer.AddNewClient(userEP, useCircuit, m_assetCache, m_circuitManager, proxyEP); | 590 | m_packetServer.AddNewClient(userEP, useCircuit, m_assetCache, sessionInfo, proxyEP); |
566 | } | 591 | } |
567 | } | 592 | } |
568 | } | 593 | } |