-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tigran Mkrtchyan <[email protected]>
- Loading branch information
Showing
3 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Copyright (C) 2011-2023 dCache.org <[email protected]> | ||
* Copyright (C) 2011-2024 dCache.org <[email protected]> | ||
* | ||
* This file is part of xrootd4j. | ||
* | ||
|
@@ -27,6 +27,7 @@ | |
import static org.dcache.xrootd.protocol.XrootdProtocol.kXR_Unsupported; | ||
import static org.dcache.xrootd.protocol.XrootdProtocol.kXR_isDir; | ||
import static org.dcache.xrootd.protocol.XrootdProtocol.kXR_isDirectory; | ||
import static org.dcache.xrootd.protocol.XrootdProtocol.kXR_ok; | ||
import static org.dcache.xrootd.protocol.XrootdProtocol.kXR_other; | ||
import static org.dcache.xrootd.protocol.XrootdProtocol.kXR_readable; | ||
import static org.dcache.xrootd.protocol.XrootdProtocol.kXR_writable; | ||
|
@@ -63,6 +64,7 @@ | |
import org.dcache.xrootd.protocol.messages.OpenRequest; | ||
import org.dcache.xrootd.protocol.messages.OpenResponse; | ||
import org.dcache.xrootd.protocol.messages.PrepareRequest; | ||
import org.dcache.xrootd.protocol.messages.PrepareResponse; | ||
import org.dcache.xrootd.protocol.messages.QueryRequest; | ||
import org.dcache.xrootd.protocol.messages.QueryResponse; | ||
import org.dcache.xrootd.protocol.messages.ReadRequest; | ||
|
@@ -280,9 +282,9 @@ protected DirListResponse doOnDirList(ChannelHandlerContext context, | |
} | ||
|
||
@Override | ||
protected OkResponse<PrepareRequest> doOnPrepare(ChannelHandlerContext ctx, | ||
PrepareRequest msg) { | ||
return withOk(msg); | ||
protected PrepareResponse doOnPrepare(ChannelHandlerContext ctx, | ||
PrepareRequest msg) throws XrootdException { | ||
return new PrepareResponse(msg, kXR_ok, new byte[0]); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Copyright (C) 2011-2023 dCache.org <[email protected]> | ||
* Copyright (C) 2011-2024 dCache.org <[email protected]> | ||
* | ||
* This file is part of xrootd4j. | ||
* | ||
|
@@ -38,8 +38,8 @@ public class PrepareRequest extends AbstractXrootdRequest { | |
public PrepareRequest(ByteBuf buffer) { | ||
super(buffer, kXR_prepare); | ||
|
||
options = buffer.getUnsignedShort(4); | ||
priority = buffer.getUnsignedShort(5); | ||
options = buffer.getByte(4); | ||
priority = buffer.getByte(5); | ||
|
||
int plen = buffer.getInt(20); | ||
int end = 24 + plen; | ||
|
39 changes: 39 additions & 0 deletions
39
xrootd4j/src/main/java/org/dcache/xrootd/protocol/messages/PrepareResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright (C) 2011-2024 dCache.org <[email protected]> | ||
* | ||
* This file is part of xrootd4j. | ||
* | ||
* xrootd4j is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* Lesser General Public License as published by the Free Software Foundation, either version 3 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* xrootd4j is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License along with xrootd4j. If | ||
* not, see http://www.gnu.org/licenses/. | ||
*/ | ||
package org.dcache.xrootd.protocol.messages; | ||
|
||
import io.netty.buffer.ByteBuf; | ||
|
||
public class PrepareResponse extends AbstractXrootdResponse<PrepareRequest> { | ||
|
||
byte[] locator; | ||
|
||
public PrepareResponse(PrepareRequest request, int stat, byte[] locator) { | ||
super(request, stat); | ||
this.locator = locator; | ||
} | ||
|
||
@Override | ||
public int getDataLength() { | ||
return locator.length; | ||
} | ||
|
||
@Override | ||
protected void getBytes(ByteBuf buffer) { | ||
buffer.writeBytes(locator); | ||
} | ||
} |