Git-Raw
view release on metacpan or search on metacpan
deps/libgit2/include/git2/sys/transport.h view on Meta::CPAN
git_smart_subtransport_stream *stream,
char *buffer,
size_t buf_size,
size_t *bytes_read);
/**
* Write data to the stream
*
* The implementation must write all data or return an error.
*/
int GIT_CALLBACK(write)(
git_smart_subtransport_stream *stream,
const char *buffer,
size_t len);
/** Free the stream */
void GIT_CALLBACK(free)(
git_smart_subtransport_stream *stream);
};
/**
* An implementation of a subtransport which carries data for the
* smart transport
*/
struct git_smart_subtransport {
/**
* Setup a subtransport stream for the requested action.
*/
int GIT_CALLBACK(action)(
git_smart_subtransport_stream **out,
git_smart_subtransport *transport,
const char *url,
git_smart_service_t action);
/**
* Close the subtransport.
*
* Subtransports are guaranteed a call to close() between
* calls to action(), except for the following two "natural" progressions
* of actions against a constant URL:
*
* - UPLOADPACK_LS -> UPLOADPACK
* - RECEIVEPACK_LS -> RECEIVEPACK
*/
int GIT_CALLBACK(close)(git_smart_subtransport *transport);
/** Free the subtransport */
void GIT_CALLBACK(free)(git_smart_subtransport *transport);
};
/** A function which creates a new subtransport for the smart transport */
typedef int GIT_CALLBACK(git_smart_subtransport_cb)(
git_smart_subtransport **out,
git_transport *owner,
void *param);
/**
* Definition for a "subtransport"
*
* The smart transport knows how to speak the git protocol, but it has no
* knowledge of how to establish a connection between it and another endpoint,
* or how to move data back and forth. For this, a subtransport interface is
* declared, and the smart transport delegates this work to the subtransports.
*
* Three subtransports are provided by libgit2: ssh, git, http(s).
*
* Subtransports can either be RPC = 0 (persistent connection) or RPC = 1
* (request/response). The smart transport handles the differences in its own
* logic. The git subtransport is RPC = 0, while http is RPC = 1.
*/
typedef struct git_smart_subtransport_definition {
/** The function to use to create the git_smart_subtransport */
git_smart_subtransport_cb callback;
/**
* True if the protocol is stateless; false otherwise. For example,
* http:// is stateless, but git:// is not.
*/
unsigned rpc;
/** User-specified parameter passed to the callback */
void *param;
} git_smart_subtransport_definition;
/* Smart transport subtransports that come with libgit2 */
/**
* Create an instance of the http subtransport.
*
* This subtransport also supports https.
*
* @param out The newly created subtransport
* @param owner The smart transport to own this subtransport
* @return 0 or an error code
*/
GIT_EXTERN(int) git_smart_subtransport_http(
git_smart_subtransport **out,
git_transport *owner,
void *param);
/**
* Create an instance of the git subtransport.
*
* @param out The newly created subtransport
* @param owner The smart transport to own this subtransport
* @return 0 or an error code
*/
GIT_EXTERN(int) git_smart_subtransport_git(
git_smart_subtransport **out,
git_transport *owner,
void *param);
/**
* Create an instance of the ssh subtransport.
*
* @param out The newly created subtransport
* @param owner The smart transport to own this subtransport
* @return 0 or an error code
*/
GIT_EXTERN(int) git_smart_subtransport_ssh(
git_smart_subtransport **out,
( run in 0.509 second using v1.01-cache-2.11-cpan-39bf76dae61 )