.TH "globus_gram_protocol_framing" 3 "Mon Dec 14 2020" "Version 13.4" "globus_gram_protocol" \" -*- nroff -*- .ad l .nh .SH NAME globus_gram_protocol_framing \- Message Framing .PP \- Message Framing\&. .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "int \fBglobus_gram_protocol_frame_request\fP (const char *url, const globus_byte_t *msg, globus_size_t msgsize, globus_byte_t **framedmsg, globus_size_t *framedsize)" .br .RI "Create a HTTP-framed copy of a GRAM request\&. " .ti -1c .RI "int \fBglobus_gram_protocol_frame_reply\fP (int code, const globus_byte_t *msg, globus_size_t msgsize, globus_byte_t **framedmsg, globus_size_t *framedsize)" .br .RI "Create a HTTP-framed copy of a GRAM reply\&. " .in -1c .SH "Detailed Description" .PP 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\&. .PP 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 \fBMessage I/O\fP section of the manual combine message framing with callback-driven I/O\&. .SH "Function Documentation" .PP .SS "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)" .PP Create a HTTP-framed copy of a GRAM reply\&. The \fBglobus_gram_protocol_frame_reply()\fP 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 \fIframedmsg\fP to point to a newly allocated string\&. The integer pointed to by the \fIframedsize\fP parameter is set to the length of this message\&. .PP \fBParameters\fP .RS 4 \fIcode\fP The HTTP response code to send along with this reply\&. .br \fImsg\fP A string containing the reply message content to be framed\&. .br \fImsgsize\fP The length of the string pointed to by \fImsg\fP\&. .br \fIframedmsg\fP An output parameter which will be set to a copy of the \fImsg\fP string with an HTTP reply frame around it\&. .br \fIframedsize\fP An output parameter which will be set to the length of the framed reply string pointed to by \fIframedmsg\fP\&. .RE .PP \fBReturns\fP .RS 4 Upon success, \fBglobus_gram_protocol_frame_reply()\fP will return GLOBUS_SUCCESS and the \fIframedmsg\fP and \fIframedsize\fP 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 \fIframedmsg\fP\&. If an error occurs, its value will returned and the \fIframedmsg\fP and \fIframedsize\fP parameters will be uninitialized\&. .RE .PP \fBReturn values\fP .RS 4 \fIGLOBUS_SUCCESS\fP Success .RE .PP .SS "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)" .PP Create a HTTP-framed copy of a GRAM request\&. The \fBglobus_gram_protocol_frame_request()\fP 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 \fIframedmsg\fP to point to a newly allocated string\&. The integer pointed to by the \fIframedsize\fP parameter is set to the length of this message\&. .PP \fBParameters\fP .RS 4 \fIurl\fP 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\&. .br \fImsg\fP A string containing the message content to be framed\&. .br \fImsgsize\fP The length of the string pointed to by \fImsg\fP .br \fIframedmsg\fP An output parameter which will be set to a copy of the \fImsg\fP string with an HTTP frame around it\&. .br \fIframedsize\fP An output parameter which will be set to the length of the framed message\&. .RE .PP \fBReturns\fP .RS 4 Upon success, \fBglobus_gram_protocol_frame_request()\fP will return GLOBUS_SUCCESS and the \fIframedmsg\fP and \fIframedsize\fP 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 \fIframedmsg\fP\&. If an error occurs, its value will returned and the \fIframedmsg\fP and \fIframedsize\fP parameters will be uninitialized\&. .RE .PP \fBReturn values\fP .RS 4 \fIGLOBUS_SUCCESS\fP Success .br \fIGLOBUS_GRAM_PROTOCOL_ERROR_INVALID_JOB_CONTACT\fP Invalid job contact .RE .PP .SH "Author" .PP Generated automatically by Doxygen for globus_gram_protocol from the source code\&.