Giter Site home page Giter Site logo

Comments (5)

alrossi avatar alrossi commented on May 30, 2024

from xrootd4j.

paulmillar avatar paulmillar commented on May 30, 2024

Yes, that's why I created this issue, we need to go through all operations and identify which ones have a path and make sure we strip off any query-part.

I think we should also take this advantage of this opportunity to add unit tests for this. See StatRequestTest for one possible way of achieving this.

from xrootd4j.

alrossi avatar alrossi commented on May 30, 2024

Let me clarify something here.

First, there are already a set of requests:

DirListRequest
LocateRequest
MkDirRequest
OpenRequest
RmDirRequest
RmRequest
StatRequest

which sublcass PathRequest. When the message buffer is parsed in their constructors, it is already split on a the potential opaque delimiter ('?').

So we are already supporting queries on those requests.

The case of mv seems to be special, because two paths are involved.

The code for the the MvRequest thus is a one-off.

The issue seems to be in the assumption that only the target path can have the opaque (query) string (that is, it will follow the target path, not the source).

public MvRequest(ByteBuf buffer) {
        super(buffer, kXR_mv);

        int dlen = buffer.getInt(20);
        int end = 24 + dlen;

        int psep = buffer.indexOf(24, end, (byte)0x20);
        int osep = buffer.indexOf(psep, end, (byte)0x3f);

        if (psep == -1) {
            throw new IllegalArgumentException("kXR_mv needs two paths!");
        }

        if (osep > -1) {
            sourcePath = buffer.toString(24,
                                          psep - 24,
                                          US_ASCII);
            targetPath = buffer.toString(psep+1,
                                          osep - (psep + 1),
                                          US_ASCII);
            opaque = buffer.toString(osep + 1,
                                      end - (osep + 1),
                                      US_ASCII);
        } else {
            sourcePath = buffer.toString(24,
                                          psep - 24,
                                          US_ASCII);
            targetPath = buffer.toString(psep+1,
                                          end - (psep + 1),
                                          US_ASCII);
            opaque = null;
        }
    }

I don't believe we need, therefore, to fix a general problem, just this class.

from xrootd4j.

alrossi avatar alrossi commented on May 30, 2024

https://rb.dcache.org/r/11422/

needs more testing

I am not sure that xrdfs actually is sending the query part

from xrootd4j.

alrossi avatar alrossi commented on May 30, 2024

Testing complete, patch committed to master, with pull request for 3.3

#27

from xrootd4j.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.