---
name: "globus_gram_protocol_frame_reply"
section: "3"
platform: "linux"
package: "libglobus-gram-protocol-doc"
version: "13.6-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_gram_protocol_framing"
---

# globus\_gram\_protocol\_frame\_reply(3)

Message Framing - Message Framing.

Part of [globus\_gram\_protocol\_framing(3)](/globus_gram_protocol_framing/3.md).

## NAME

globus\_gram\_protocol\_framing - Message Framing

 \- Message Framing.

## SYNOPSIS

### Functions

int **globus\_gram\_protocol\_frame\_request** (const char \*url, const globus\_byte\_t \*msg, globus\_size\_t msgsize, globus\_byte\_t \*\*framedmsg, globus\_size\_t \*framedsize)\
 Create a HTTP-framed copy of a GRAM request.  int **globus\_gram\_protocol\_frame\_reply** (int code, const globus\_byte\_t \*msg, globus\_size\_t msgsize, globus\_byte\_t \*\*framedmsg, globus\_size\_t \*framedsize)\
 Create a HTTP-framed copy of a GRAM reply.

## Detailed Description

Message Framing.

The functions in this section frame a GRAM request, query, or reply message with HTTP headers compatible with the GRAM2 protocol parsers in GT2 GT3, and GT4.

These functions should be used when an application wants to control the way that the GRAM Protocol messages are sent, while still using the standard message formatting and framing routines. An alternative set of functions in the **Message I/O** section of the manual combine message framing with callback-driven I/O.

## Function Documentation

### int globus\_gram\_protocol\_frame\_reply (int code, const globus\_byte\_t \* msg, globus\_size\_t msgsize, globus\_byte\_t \*\* framedmsg, globus\_size\_t \* framedsize)

Create a HTTP-framed copy of a GRAM reply. The **globus\_gram\_protocol\_frame\_reply()** function adds HTTP 1.1 framing around the input message. The framed message includes HTTP headers relating the the status of the operation being replied to and the length of the message content. The framed message is returned by modifying *framedmsg* to point to a newly allocated string. The integer pointed to by the *framedsize* parameter is set to the length of this message.

**Parameters**

*code* The HTTP response code to send along with this reply. \
 *msg* A string containing the reply message content to be framed. \
 *msgsize* The length of the string pointed to by *msg*. \
 *framedmsg* An output parameter which will be set to a copy of the *msg* string with an HTTP reply frame around it. \
 *framedsize* An output parameter which will be set to the length of the framed reply string pointed to by *framedmsg*.

**Returns**

Upon success, **globus\_gram\_protocol\_frame\_reply()** will return GLOBUS\_SUCCESS and the *framedmsg* and *framedsize* parameters will be modified to point to the new framed message string and its length respectively. When this occurs, the caller is responsible for freeing the string pointed to by *framedmsg*. If an error occurs, its value will returned and the *framedmsg* and *framedsize* parameters will be uninitialized.

**Return values**

*GLOBUS\_SUCCESS* Success

### int globus\_gram\_protocol\_frame\_request (const char \* url, const globus\_byte\_t \* msg, globus\_size\_t msgsize, globus\_byte\_t \*\* framedmsg, globus\_size\_t \* framedsize)

Create a HTTP-framed copy of a GRAM request. The **globus\_gram\_protocol\_frame\_request()** function adds HTTP 1.1 framing around the input message. The framed message includes HTTP headers relating the the destination URL and the length of the message content. The framed message is returned by modifying *framedmsg* to point to a newly allocated string. The integer pointed to by the *framedsize* parameter is set to the length of this message.

**Parameters**

*url* The URL of the GRAM resource to contact. This is parsed and used to generate the HTTP POST operation destination and the Host HTTP header. \
 *msg* A string containing the message content to be framed. \
 *msgsize* The length of the string pointed to by *msg* \
 *framedmsg* An output parameter which will be set to a copy of the *msg* string with an HTTP frame around it. \
 *framedsize* An output parameter which will be set to the length of the framed message.

**Returns**

Upon success, **globus\_gram\_protocol\_frame\_request()** will return GLOBUS\_SUCCESS and the *framedmsg* and *framedsize* parameters will be modified to point to the new framed message string and its length respectively. When this occurs, the caller is responsible for freeing the string pointed to by *framedmsg*. If an error occurs, its value will returned and the *framedmsg* and *framedsize* parameters will be uninitialized.

**Return values**

*GLOBUS\_SUCCESS* Success \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_INVALID\_JOB\_CONTACT* Invalid job contact

## Author

Generated automatically by Doxygen for globus\_gram\_protocol from the source code.
