---
name: "globus_gass_transfer_request"
section: "3"
platform: "linux"
package: "libglobus-gass-transfer-doc"
version: "9.4-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_gass_transfer_request"
---

# globus\_gass\_transfer\_request(3)

Request Handles - Request Handles.

## NAME

globus\_gass\_transfer\_request - Request Handles

 \- Request Handles.

## SYNOPSIS

### Data Structures

struct **globus\_gass\_transfer\_request\_t**\
 Request handle.

### Enumerations

enum **globus\_gass\_transfer\_request\_type\_t** { **GLOBUS\_GASS\_TRANSFER\_REQUEST\_TYPE\_INVALID**, **GLOBUS\_GASS\_TRANSFER\_REQUEST\_TYPE\_GET**, **GLOBUS\_GASS\_TRANSFER\_REQUEST\_TYPE\_PUT**, **GLOBUS\_GASS\_TRANSFER\_REQUEST\_TYPE\_APPEND** }\
 enum **globus\_gass\_transfer\_request\_status\_t** { **GLOBUS\_GASS\_TRANSFER\_REQUEST\_INVALID**, **GLOBUS\_GASS\_TRANSFER\_REQUEST\_STARTING**, **GLOBUS\_GASS\_TRANSFER\_REQUEST\_PENDING**, **GLOBUS\_GASS\_TRANSFER\_REQUEST\_FAILED**, **GLOBUS\_GASS\_TRANSFER\_REQUEST\_REFERRED**, **GLOBUS\_GASS\_TRANSFER\_REQUEST\_DENIED**, **GLOBUS\_GASS\_TRANSFER\_REQUEST\_DONE** }\

### Functions

**globus\_gass\_transfer\_request\_type\_t** **globus\_gass\_transfer\_request\_get\_type** (**globus\_gass\_transfer\_request\_t** request)\
 void \* **globus\_gass\_transfer\_request\_get\_user\_pointer** (**globus\_gass\_transfer\_request\_t** request)\
 int **globus\_gass\_transfer\_request\_set\_user\_pointer** (**globus\_gass\_transfer\_request\_t** request, void \*user\_pointer)\
 **globus\_gass\_transfer\_request\_status\_t** **globus\_gass\_transfer\_request\_get\_status** (**globus\_gass\_transfer\_request\_t** request)\
 int **globus\_gass\_transfer\_request\_get\_referral** (**globus\_gass\_transfer\_request\_t** request, globus\_gass\_transfer\_referral\_t \*referral)\
 char \* **globus\_gass\_transfer\_request\_get\_url** (**globus\_gass\_transfer\_request\_t** request)\
 globus\_size\_t **globus\_gass\_transfer\_request\_get\_length** (**globus\_gass\_transfer\_request\_t** request)\
 int **globus\_gass\_transfer\_request\_set\_type** (**globus\_gass\_transfer\_request\_t** request, **globus\_gass\_transfer\_request\_type\_t** type)\
 int **globus\_gass\_transfer\_request\_set\_url** (**globus\_gass\_transfer\_request\_t** request, char \*url)\
 void **globus\_gass\_transfer\_request\_set\_length** (**globus\_gass\_transfer\_request\_t** request, globus\_size\_t length)\
 int **globus\_gass\_transfer\_request\_get\_denial\_reason** (**globus\_gass\_transfer\_request\_t** request)\
 char \* **globus\_gass\_transfer\_request\_get\_denial\_message** (**globus\_gass\_transfer\_request\_t** request)\
 char \* **globus\_gass\_transfer\_request\_get\_subject** (**globus\_gass\_transfer\_request\_t** request)\
 int **globus\_gass\_transfer\_request\_destroy** (**globus\_gass\_transfer\_request\_t** request)\

## Detailed Description

Request Handles.

Request Handles

Request handles are used by the GASS Transfer API to associate operations with a single file transfer request. Specifically, they are used to register multiple byte range buffers with a file transfer request, and to query the state of a transfer in-progress.

To implement a server, the request handle is populated by the protocol module implementation. The server may use the functions in this section to determine information about what the client is requesting.

To implement a client, the request handle should be queried after the blocking call or initial callback has been invoked to determine if the request has been authorized or referred, and after EOF, to determine whether the request has completed successfully.

A request handle contains a pointer which may be used by the handler of the request to store a pointer to arbitrary application-specific data.

## Enumeration Type Documentation

### enum globus\_gass\_transfer\_request\_status\_t

Request Status

**Enumerator**

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_INVALID*

  *Handle is no longer valid*

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_STARTING*

  *Initial connection and authorization is not yet completed*

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_PENDING*

  *Request is authorized.*

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_FAILED*

  *Request failed due to protocol error or client or server aborting the request*

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_REFERRED*

  *Request can not be processed by this server, referred to another URL or URLs*

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_DENIED*

  *The server denied this request*

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_DONE*

  *All callbacks have completed*

### enum globus\_gass\_transfer\_request\_type\_t

*Type of operation associated with a request handle.*

**Enumerator**

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_TYPE\_INVALID*

  *Handle no longer valid*

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_TYPE\_GET*

  *A get request*

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_TYPE\_PUT*

  *A put request*

- *GLOBUS\_GASS\_TRANSFER\_REQUEST\_TYPE\_APPEND*

  *An append request*

## Function Documentation

### int globus\_gass\_transfer\_request\_destroy (globus\_gass\_transfer\_request\_t request)

*Destroy a request handle.*

*This function destroys the caller's reference to a request handle. It must be called for all request handles which are created by calling functions in the '@ref globus\_gass\_transfer\_client' or '@ref globus\_gass\_transfer\_server' sections of this manual. After calling the function, the caller must not attempt to use the request handle for any purpose.*

**Parameters**

*request The request to destroy.*

**Return values**

*GLOBUS\_SUCCESS The request handle reference was successfully destroyed.* \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_INVALID\_USE Either an invalid request handle or one which is actively being used was passed to this function as the request parameter.*

### char \* globus\_gass\_transfer\_request\_get\_denial\_message (globus\_gass\_transfer\_request\_t request)

*Get an string describing why a request was denied.*

*This function queries a request which was denied by a server to determine why it was denied. The denial reason will be expressed as a response string. The string must be freed by the caller.*

**Parameters**

*request A handle to the request to query.*

**Returns**

*A string indicating why the request was denied. If the request handle is invalid or the request was not denied, then this function returns GLOBUS\_NULL.*

**See also**

**globus\_gass\_transfer\_request\_get\_denial\_reason()**

### int globus\_gass\_transfer\_request\_get\_denial\_reason (globus\_gass\_transfer\_request\_t request)

*Get an integer code describing why the request was denied.*

*This function queries a request which was denied by a server to determine why it was denied. The denial reason will be expressed in a protocol-specific response code. Knowledge of the protocol is needed to understand this response.*

**Parameters**

*request A handle to the request to query.*

**Returns**

*A protocol-specific integer indicating why the request was denied. If the request handle is invalid or the request was not denied, then this function returns 0.*

**See also**

**globus\_gass\_transfer\_request\_get\_denial\_message()**

### globus\_size\_t globus\_gass\_transfer\_request\_get\_length (globus\_gass\_transfer\_request\_t request)

*Get the length of a file to be transferred using GASS.*

*This function queries the request handle to determine the amount of data that will be transferred to copy the URL. The length may be GLOBUS\_GASS\_TRANSFER\_LENGTH\_UNKNOWN if the sender can not determine the length before making or authorizing the request.*

**Parameters**

*request The request to query.*

**Returns**

*The length of the file located at the request's URL, or GLOBUS\_GASS\_TRANSFER\_LENGTH\_UNKNOWN if that cannot be determined.*

### int globus\_gass\_transfer\_request\_get\_referral (globus\_gass\_transfer\_request\_t request, globus\_gass\_transfer\_referral\_t \* referral)

*Extract referral information from a request handle.*

*This function queries the request handle to determine any referral information that it contains. This function should only be called on request handles in the GLOBUS\_GASS\_TRANSFER\_REQUEST\_REFERRED state. If no referral information is stored in the request handle, then the referral will be initialized to an empty referral. The referral must be destroyed by calling* **globus\_gass\_transfer\_referral\_destroy()** *by the caller.*

**Parameters**

*request The request handle to query.* \
 *referral A pointer to an uninitialized referral structure. It will be populated by calling this function.*

**Return values**

*GLOBUS\_SUCCESS The referral was successfully extracted from the request handle.* \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_NULL\_POINTER The referral pointer was GLOBUS\_NULL;*

### globus\_gass\_transfer\_request\_status\_t globus\_gass\_transfer\_request\_get\_status (globus\_gass\_transfer\_request\_t request)

*Check the status of a request.*

*This function queries a request to determine the status of the request. This function should be called after EOF has been reached, or after the initial get, put, or append has returned or had it's callback function called to determine if it is possible to proceed, or whether the file transfer was successfully processed.*

**Parameters**

*request The request handle to query.*

**Returns**

*A* **globus\_gass\_transfer\_request\_status\_t** *indicating the current status of the request.*

### char \* globus\_gass\_transfer\_request\_get\_subject (globus\_gass\_transfer\_request\_t request)

*Get the subject string associated with a request.*

*This function queries a request handle to determine the subject identity of the client who initiated the request. The string must not be freed by the caller.*

**Parameters**

*request A handle to the request to query.*

**Returns**

*A string containing the request initiator's subject identity. If the request handle is invalid or a credential was not used to initiate the request, this value will be GLOBUS\_NULL.*

### globus\_gass\_transfer\_request\_type\_t globus\_gass\_transfer\_request\_get\_type (globus\_gass\_transfer\_request\_t request)

*Determine the type of a request.*

*This function is used by GASS server implementations to discover what type of operation the client is requesting for an URL.*

**Parameters**

*request The request to query.*

**Returns**

*The* **type** *of the request.*

### char \* globus\_gass\_transfer\_request\_get\_url (globus\_gass\_transfer\_request\_t request)

*Get the URL from a request handle.*

*This function queries the request handle to determine the URL associated with the request. This function is intended to be useful to GASS server implementors.*

**Parameters**

*request The request handle to query.*

**Returns**

*A pointer to the URL, or GLOBUS\_NULL if the request handle is invalid. The string which is returned must not be freed by the caller. It may not be accessed after the request has been destroyed.*

### void \* globus\_gass\_transfer\_request\_get\_user\_pointer (globus\_gass\_transfer\_request\_t request)

*Get the user pointer associated with a request*

*This function extracts the user pointer from a request handle. The user-pointer may be used by the application which is generating or servicing the request to store a pointer to any application-specific piece of data.*

**Parameters**

*request The request to query.*

**Returns**

*The user pointer's value.*

### void globus\_gass\_transfer\_request\_set\_length (globus\_gass\_transfer\_request\_t request, globus\_size\_t length)

*Set the length of a transfer associated request handle.*

*This function modifies the given request handle so that it's length field is set to give length parameter.*

*This function must only be called by protocol modules when constructing a request handle when receiving the response to a get request. This function can only be called once per request handle.*

**Parameters**

*request A handle to the request to modify.* \
 *length The length of the file request.*

**Return values**

*GLOBUS\_SUCCESS The URL was set for the request handle.* \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_INVALID\_USE The request handle was invalid, or the URL had already been set.*

### int globus\_gass\_transfer\_request\_set\_type (globus\_gass\_transfer\_request\_t request, globus\_gass\_transfer\_request\_type\_t type)

*Set the type of a request.*

*This function modifies a request handle by setting the type of operation that it is being used for. This function may only be called once per handle, and only from a GASS protocol module implementation.*

**Parameters**

*request The request handle to modify.* \
 *type The type of operation that this request handle will be used for.*

**Return values**

*GLOBUS\_SUCCESS The request handle's type has been set.* \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_INVALID\_USE The request handle was invalid or it's type was already set. The request handle was not modified.*

**Note**

*Only GASS Protocol modules may call this function.*

### int globus\_gass\_transfer\_request\_set\_url (globus\_gass\_transfer\_request\_t request, char \* url)

*Set the URL to which a request handle refers.*

*This function modifies the given request handle so that it's URL field is set to string pointed to by url.*

*No copy is made of the string, so the caller must not free it. It must be allocated by calling one of the memory allocators in globus\_libc, as it will be freed when the request handle is destroyed.*

*This function must only be called by protocol modules when constructing a request handle when accepting a new request. This function can only be called once per request handle.*

**Parameters**

*request A handle to the request to modify.* \
 *url A string containing the URL that this request will be associated with.*

**Return values**

*GLOBUS\_SUCCESS The URL was set for the request handle.* \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_INVALID\_USE The request handle was invalid, or the URL had already been set.*

### int globus\_gass\_transfer\_request\_set\_user\_pointer (globus\_gass\_transfer\_request\_t request, void \* user\_pointer)

*Set the user pointer associated with a request handle.*

*This function sets the user pointer from a request handle. The user-pointer may be used by the application which is generating or servicing the request to store a pointer to any application-specific piece of data.*

**Parameters**

*request The request to modify.* \
 *user\_pointer The new value of the user pointer for the request.*

**Return values**

*GLOBUS\_SUCCES The user pointer's value was set.* \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_INVALID\_USE An invalid request handle was passed to this function*

## Author

*Generated automatically by Doxygen for globus\_gass\_transfer from the source code.*
