[jcifs] Infinite loop of error messages
Christophe Bouthier
Christophe.Bouthier at inpl-nancy.fr
Wed Oct 4 13:54:37 GMT 2006
Michael B Allen a écrit :
> Actually from looking at the code I'm not sure it's an error for
> disconnect() to be called while in state 2 (run connected). I
> think I would just consider this to be not connected and modify
> jcifs.util.transport.Transport.java:disconnect() to be like:
>
> 193 public void disconnect( boolean hard ) throws IOException {
> 194 synchronized(setupDiscoLock) {
> 195 synchronized(this) {
> 196 switch (state) {
> 197 case 0: /* not connected - just return */
> 198 case 2:
> 199 return;
>
> Meaning add 'case 2:' so that if it's in state 2 it just ignores the
> disconnect() call since the transport isn't connected.
>
> Or, it might be better to do something like this:
>
> 193 public void disconnect( boolean hard ) throws IOException {
> 194 synchronized(setupDiscoLock) {
> 195 synchronized(this) {
> 196 switch (state) {
> 197 case 0: /* not connected - just return */
> 198 return;
> 199 case 2:
> 200 hard = true;
> 201 case 3: /* connected - go ahead and disconnect */
>
> Since the transport isn't really connected it should have any sessions
> open or anything. We can just do the disconnect routine but set hard =
> true to give it a quick action.
>
> Actually I would try the second change first.
>
> Mike
Ok, thanks a lot for your answer. I will try the second change and put
it on our portal. I will post feedback on the list.
Christophe Bouthier
CRI INPL
Nancy, France
More information about the jcifs
mailing list