If we fail to read the AuthRequest from an out of date client, don't stick a
fork in the proceedings, pass the partially initialized request on to the authenticator who will either get a version of 0 or an out of date version and reject them properly. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4640 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -21,8 +21,12 @@
|
|||||||
|
|
||||||
package com.threerings.presents.net;
|
package com.threerings.presents.net;
|
||||||
|
|
||||||
|
import java.io.EOFException;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
import com.threerings.io.ObjectInputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to authenticate with the server.
|
* Used to authenticate with the server.
|
||||||
*/
|
*/
|
||||||
@@ -88,6 +92,21 @@ public class AuthRequest extends UpstreamMessage
|
|||||||
", version=" + _version + "]";
|
", version=" + _version + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads our custom streamable fields.
|
||||||
|
*/
|
||||||
|
public void readObject (ObjectInputStream in)
|
||||||
|
throws IOException, ClassNotFoundException
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
in.defaultReadObject();
|
||||||
|
} catch (EOFException eofe) {
|
||||||
|
// if we fail here because the client is old, leave ourselves with a partially
|
||||||
|
// initialized set of credentials, which the server will generally cope with by telling
|
||||||
|
// the client it is out of date
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** The credentials associated with this auth request. */
|
/** The credentials associated with this auth request. */
|
||||||
protected Credentials _creds;
|
protected Credentials _creds;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user