repo_name
string
dataset
string
owner
string
lang
string
func_name
string
code
string
docstring
string
url
string
sha
string
kurento
github_2023
Kurento
c
kms_rtp_endpoint_comedia_on_ssrc_active
static void kms_rtp_endpoint_comedia_on_ssrc_active(GObject *rtpsession, GObject *rtpsource, KmsRtpEndpoint *self) { GstStructure* source_stats = NULL; gchar *rtp_from = NULL; gchar *rtcp_from = NULL; GNetworkAddress *rtp_addr = NULL; GNetworkAddress *rtcp_addr = NULL; gboolean ok; guint ssrc; gboo...
/* Configure media SDP end */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/rtpendpoint/kmsrtpendpoint.c#L784-L878
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_rtp_endpoint_init
static void kms_rtp_endpoint_init (KmsRtpEndpoint * self) { self->priv = KMS_RTP_ENDPOINT_GET_PRIVATE (self); self->priv->sdes_keys = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) kms_ref_struct_unref); self->priv->comedia.rtp_conns = g_hash_table_new_full (NULL, NULL, g_o...
/* TODO: not add abs-send-time extmap */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/rtpendpoint/kmsrtpendpoint.c#L1160-L1177
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_rtp_session_post_constructor
static void kms_rtp_session_post_constructor (KmsRtpSession * self, KmsBaseSdpEndpoint * ep, guint id, KmsIRtpSessionManager * manager, gboolean use_ipv6) { KmsBaseRtpSession *base_rtp_session = KMS_BASE_RTP_SESSION (self); self->use_ipv6 = use_ipv6; KMS_BASE_RTP_SESSION_CLASS (kms_rtp_session_pare...
/* Connection management end */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/rtpendpoint/kmsrtpsession.c#L76-L87
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_srtp_session_post_constructor
static void kms_srtp_session_post_constructor (KmsSrtpSession * self, KmsBaseSdpEndpoint * ep, guint id, KmsIRtpSessionManager * manager, gboolean use_ipv6) { KmsBaseRtpSession *base_rtp_session = KMS_BASE_RTP_SESSION (self); self->use_ipv6 = use_ipv6; KMS_BASE_RTP_SESSION_CLASS (parent_class)->post_cons...
/* Connection management end */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/rtpendpoint/kmssrtpsession.c#L77-L87
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_ice_nice_agent_new_remote_candidate_full
static void kms_ice_nice_agent_new_remote_candidate_full (NiceAgent * agent, NiceCandidate * candidate, KmsIceNiceAgent * self) { gchar *stream_id_str = g_strdup_printf ("%u", candidate->stream_id); KmsIceCandidate *kms_candidate = kms_ice_nice_agent_create_candidate_from_nice (agent, candidate, ...
// ----------------------------------------------------------------------------
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmsiceniceagent.c#L135-L153
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_ice_nice_agent_nice_to_ice_state
static IceState kms_ice_nice_agent_nice_to_ice_state (NiceComponentState state) { switch (state) { case NICE_COMPONENT_STATE_DISCONNECTED: return ICE_STATE_DISCONNECTED; case NICE_COMPONENT_STATE_GATHERING: return ICE_STATE_GATHERING; case NICE_COMPONENT_STATE_CONNECTING: return ICE_STAT...
// ----------------------------------------------------------------------------
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmsiceniceagent.c#L199-L218
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_webrtc_base_connection_agent_add_net_addr
static void kms_webrtc_base_connection_agent_add_net_addr (const gchar * net_name, NiceAgent * agent) { NiceAddress *nice_address = nice_address_new (); gchar *ip_address = nice_interfaces_get_ip_for_interface ((gchar *)net_name); nice_address_set_from_string (nice_address, ip_address); nice_agent_add_loca...
/** * Add new local IP address to NiceAgent instance. */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtcbaseconnection.c#L253-L267
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
on_ice_candidate
static void on_ice_candidate (KmsWebrtcSession * sess, KmsIceCandidate * candidate, KmsWebrtcEndpoint * self) { KmsSdpSession *sdp_sess = KMS_SDP_SESSION (sess); GST_DEBUG_OBJECT (self, "[IceCandidateFound] local: '%s', stream_id: %s, component_id: %d, sdpMid: '%s', sdpMLineIndex: %u", kms_ice_cand...
/* Internal session management begin */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtcendpoint.c#L117-L134
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_webrtc_endpoint_create_media_handler
static void kms_webrtc_endpoint_create_media_handler (KmsBaseSdpEndpoint * base_sdp, const gchar * media, KmsSdpMediaHandler ** handler) { if (g_strcmp0 (media, "audio") == 0 || g_strcmp0 (media, "video") == 0) { *handler = KMS_SDP_MEDIA_HANDLER (kms_sdp_rtp_savpf_media_handler_new ()); } else if (g_strcmp0...
/* Internal session management end */ /* Media handler management begin */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtcendpoint.c#L424-L438
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_webrtc_endpoint_configure_media
static gboolean kms_webrtc_endpoint_configure_media (KmsBaseSdpEndpoint * base_sdp_endpoint, KmsSdpSession * sess, KmsSdpMediaHandler * handler, GstSDPMedia * media) { KmsWebrtcSession *webrtc_sess = KMS_WEBRTC_SESSION (sess); gboolean ret; /* Chain up */ ret = KMS_BASE_SDP_ENDPOINT_CLASS (kms_we...
/* Media handler management end */ /* Configure media SDP begin */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtcendpoint.c#L444-L465
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_webrtc_endpoint_start_transport_send
static void kms_webrtc_endpoint_start_transport_send (KmsBaseSdpEndpoint * base_sdp_endpoint, KmsSdpSession * sess, gboolean offerer) { KmsWebrtcSession *webrtc_sess = KMS_WEBRTC_SESSION (sess); /* Chain up */ KMS_BASE_SDP_ENDPOINT_CLASS (kms_webrtc_endpoint_parent_class)->start_transport_send (b...
/* Configure media SDP end */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtcendpoint.c#L469-L481
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_webrtc_endpoint_gather_candidates
static gboolean kms_webrtc_endpoint_gather_candidates (KmsWebrtcEndpoint * self, const gchar * sess_id) { KmsBaseSdpEndpoint *base_sdp_ep = KMS_BASE_SDP_ENDPOINT (self); KmsSdpSession *sess; KmsWebrtcSession *webrtc_sess; gboolean ret = TRUE; sess = kms_base_sdp_endpoint_get_session (base_sdp_ep, sess_id...
/* ICE candidates management begin */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtcendpoint.c#L485-L506
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_webrtc_endpoint_set_property
static void kms_webrtc_endpoint_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { KmsWebrtcEndpoint *self = KMS_WEBRTC_ENDPOINT (object); KMS_ELEMENT_LOCK (self); switch (prop_id) { case PROP_STUN_SERVER_IP: g_free (self->priv->stun_server_ip); self->...
/* ICE candidates management end */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtcendpoint.c#L539-L587
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
gst_media_add_remote_candidates
static void gst_media_add_remote_candidates (KmsWebrtcSession * self, guint index, const GstSDPMedia * media, KmsWebRtcBaseConnection * conn, const gchar * msg_ufrag, const gchar * msg_pwd) { KmsIceBaseAgent *agent = conn->agent; gchar *stream_id = conn->stream_id; const gchar *ufrag, *pwd, *mid; guint ...
/* Start Transport begin */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtcsession.c#L1045-L1097
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_webrtc_session_add_data_channels_stats
void kms_webrtc_session_add_data_channels_stats (KmsWebrtcSession * self, GstStructure * stats, const gchar * selector) { GstStructure *data_stats; const gchar *id; if (self->data_session == NULL || (selector != NULL && g_strcmp0 (selector, DATA_STREAM_NAME) != 0)) { return; } id = kms_uti...
/* Start Transport end */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtcsession.c#L1667-L1691
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
store_pending_dtls_buffer
static gboolean store_pending_dtls_buffer (GstBuffer **buffer, guint idx, gpointer user_data) { if (gst_buffer_is_dtls (*buffer)) { KmsWebrtcTransportSrcNice *self = KMS_WEBRTC_TRANSPORT_SRC_NICE (user_data); GST_DEBUG_OBJECT (self, "Storing DTLS buffer until ICE is CONNECTED"); self->priv->pending_buffe...
// Stores DTLS buffers for later use. // `buffer` is unref and set to NULL only if stored; otherwise left as-is.
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtctransportsrcnice.c#L85-L99
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
kms_webrtc_transport_src_nice_block_dtls_until_ice_connected
static GstPadProbeReturn kms_webrtc_transport_src_nice_block_dtls_until_ice_connected (GstPad *pad, GstPadProbeInfo *info, gpointer user_data) { KmsWebrtcTransportSrcNice *self = KMS_WEBRTC_TRANSPORT_SRC_NICE(user_data); GstPadProbeReturn ret = GST_PAD_PROBE_OK; KMS_WEBRTC_TRANSPORT_SRC_NICE_LOCK (self); if (s...
// Store DTLS buffers for later delivery when ICE gets to CONNECTED.
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/src/gst-plugins/webrtcendpoint/kmswebrtctransportsrcnice.c#L222-L261
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
bus_msg
static void bus_msg (GstBus * bus, GstMessage * msg, gpointer pipe) { switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_ERROR:{ gchar *error_file = g_strdup_printf ("error-%s", GST_OBJECT_NAME (pipe)); GST_ERROR ("Error: %" GST_PTR_FORMAT, msg); GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipe...
/* Temporaly disabled */
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/tests/check/element/dtls.c#L42-L68
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
bus_msg
static void bus_msg (GstBus * bus, GstMessage * msg, gpointer pipe) { switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_ERROR:{ GST_ERROR ("Error: %" GST_PTR_FORMAT, msg); GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipe), GST_DEBUG_GRAPH_SHOW_ALL, "error"); fail ("Error received on b...
// TODO: create a generic bus_msg
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/tests/check/element/rtpendpoint_audio.c#L102-L122
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
bus_msg
static void bus_msg (GstBus * bus, GstMessage * msg, gpointer pipe) { switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_ERROR:{ GST_ERROR ("Error: %" GST_PTR_FORMAT, msg); GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipe), GST_DEBUG_GRAPH_SHOW_ALL, "error"); fail ("Error received on b...
// TODO: create a generic bus_msg
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/tests/check/element/rtpendpoint_video.c#L41-L61
b04c741488b60a10692f08d01e87b8bb08ef0300
kurento
github_2023
Kurento
c
test_video_sendonly
static void test_video_sendonly (const gchar * video_enc_name, GstStaticCaps expected_caps, const gchar * pattern_sdp_sendonly_str, const gchar * pattern_sdp_recvonly_str, gboolean play_after_negotiation) { HandOffData *hod; GMainLoop *loop = g_main_loop_new (NULL, TRUE); GstSDPMessage *pattern_sdp, *offe...
// FIXME: if agnosticbin is used, the test fails
https://github.com/Kurento/kurento/blob/b04c741488b60a10692f08d01e87b8bb08ef0300/server/module-elements/tests/check/element/rtpendpoint_video.c#L105-L194
b04c741488b60a10692f08d01e87b8bb08ef0300
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
main
int main () { if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) return 1; ; return 0; }
/* includes end */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/CMake/CurlTests.c#L674-L681
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
my_ioctl
static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp) { intptr_t fd = (intptr_t)userp; (void)handle; /* not used in here */ switch(cmd) { case CURLIOCMD_RESTARTREAD: /* mr libcurl kindly asks as to rewind the read data stream to start */ if(-1 == lseek(fd, 0, SEEK_SET)) /* couldn't...
/* * This example shows a HTTP PUT operation with authentiction using "any" * type. It PUTs a file given as a command line argument to the URL also given * on the command line. * * Since libcurl 7.12.3, using "any" auth and POST/PUT requires a set ioctl * function. * * This example also uses its own read callba...
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/anyauthput.c#L74-L93
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
read_callback
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) { size_t retcode; curl_off_t nread; intptr_t fd = (intptr_t)stream; retcode = read(fd, ptr, size * nmemb); nread = (curl_off_t)retcode; fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T " bytes from file\n", n...
/* read callback function, fread() look alike */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/anyauthput.c#L96-L111
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
ssl_app_verify_callback
static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg) { sslctxparm * p = (sslctxparm *) arg; int ok; if (p->verbose > 2) BIO_printf(p->errorbio,"entering ssl_app_verify_callback\n"); if ((ok= X509_verify_cert(ctx)) && ctx->cert) { unsigned char * accessinfo ; if (p->verbose > 1) ...
/* This is an application verification call back, it does not perform any addition verification but tries to find a URL in the presented certificat. If found, this will become the URL to be used in the POST. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/curlx.c#L182-L212
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
sslctxfun
static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) { sslctxparm * p = (sslctxparm *) parm; SSL_CTX * ctx = (SSL_CTX *) sslctx ; if (!SSL_CTX_use_certificate(ctx,p->usercert)) { BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n"); goto err; } if (!SSL_CTX_use_PrivateKey(ctx,p->pk...
/* This is an example of an curl SSL initialisation call back. The callback sets: - a private key and certificate - a trusted ca certificate - a preferred cipherlist - an application verification callback (the function above) */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/curlx.c#L222-L256
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
multi_timer_cb
static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g) { DPRINT("%s %li\n", __PRETTY_FUNCTION__, timeout_ms); ev_timer_stop(g->loop, &g->timer_event); if (timeout_ms > 0) { double t = timeout_ms / 1000; ev_timer_init(&g->timer_event, timer_cb, t, 0.); ev_timer_start(g->loop, &g->t...
/* Update the event timer after curl_multi library calls */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L114-L126
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
mcode_or_die
static void mcode_or_die(const char *where, CURLMcode code) { if ( CURLM_OK != code ) { const char *s; switch ( code ) { case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break; case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; case CURLM_BAD_EASY_HANDLE: s="C...
/* Die if we get a bad CURLMcode somewhere */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L129-L153
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
check_multi_info
static void check_multi_info(GlobalInfo *g) { char *eff_url; CURLMsg *msg; int msgs_left; ConnInfo *conn; CURL *easy; CURLcode res; fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running); while ((msg = curl_multi_info_read(g->multi, &msgs_left))) { if (msg->msg == CURLMSG_DONE) { easy = msg->e...
/* Check for completed transfers, and remove their easy handles */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L158-L181
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
event_cb
static void event_cb(EV_P_ struct ev_io *w, int revents) { DPRINT("%s w %p revents %i\n", __PRETTY_FUNCTION__, w, revents); GlobalInfo *g = (GlobalInfo*) w->data; CURLMcode rc; int action = (revents&EV_READ?CURL_POLL_IN:0)| (revents&EV_WRITE?CURL_POLL_OUT:0); rc = curl_multi_socket_action(g->multi, w->f...
/* Called by libevent when we get action on a multi socket */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L186-L202
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
timer_cb
static void timer_cb(EV_P_ struct ev_timer *w, int revents) { DPRINT("%s w %p revents %i\n", __PRETTY_FUNCTION__, w, revents); GlobalInfo *g = (GlobalInfo *)w->data; CURLMcode rc; rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running); mcode_or_die("timer_cb: curl_multi_socket_a...
/* Called by libevent when our timeout expires */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L205-L215
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
remsock
static void remsock(SockInfo *f, GlobalInfo *g) { printf("%s \n", __PRETTY_FUNCTION__); if ( f ) { if ( f->evset ) ev_io_stop(g->loop, &f->ev); free(f); } }
/* Clean up the SockInfo structure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L218-L227
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
setsock
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g) { printf("%s \n", __PRETTY_FUNCTION__); int kind = (act&CURL_POLL_IN?EV_READ:0)|(act&CURL_POLL_OUT?EV_WRITE:0); f->sockfd = s; f->action = act; f->easy = e; if ( f->evset ) ev_io_stop(g->loop, &f->ev); ev_io_init(&f->ev...
/* Assign information to a SockInfo structure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L232-L247
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
addsock
static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g) { SockInfo *fdp = calloc(sizeof(SockInfo), 1); fdp->global = g; setsock(fdp, s, easy, action, g); curl_multi_assign(g->multi, s, fdp); }
/* Initialize a new SockInfo structure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L252-L259
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
sock_cb
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { DPRINT("%s e %p s %i what %i cbp %p sockp %p\n", __PRETTY_FUNCTION__, e, s, what, cbp, sockp); GlobalInfo *g = (GlobalInfo*) cbp; SockInfo *fdp = (SockInfo*) sockp; const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "R...
/* CURLMOPT_SOCKETFUNCTION */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L262-L292
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
write_cb
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; ConnInfo *conn = (ConnInfo*) data; (void)ptr; (void)conn; return realsize; }
/* CURLOPT_WRITEFUNCTION */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L296-L303
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
prog_cb
static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln) { ConnInfo *conn = (ConnInfo *)p; (void)ult; (void)uln; fprintf(MSG_OUT, "Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal); return 0; }
/* CURLOPT_PROGRESSFUNCTION */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L307-L316
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
new_conn
static void new_conn(char *url, GlobalInfo *g ) { ConnInfo *conn; CURLMcode rc; conn = calloc(1, sizeof(ConnInfo)); memset(conn, 0, sizeof(ConnInfo)); conn->error[0]='\0'; conn->easy = curl_easy_init(); if ( !conn->easy ) { fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n"); exit(2); } ...
/* Create a new easy handle, and add it to the global curl_multi */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L320-L356
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
fifo_cb
static void fifo_cb(EV_P_ struct ev_io *w, int revents) { char s[1024]; long int rv=0; int n=0; GlobalInfo *g = (GlobalInfo *)w->data; do { s[0]='\0'; rv=fscanf(g->input, "%1023s%n", s, &n); s[n]='\0'; if ( n && s[0] ) { new_conn(s,g); /* if we read a URL, go get it! */ } els...
/* This gets called whenever data is received from the fifo */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L359-L376
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
init_fifo
static int init_fifo (GlobalInfo *g) { struct stat st; static const char *fifo = "hiper.fifo"; curl_socket_t sockfd; fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo); if ( lstat (fifo, &st) == 0 ) { if ( (st.st_mode & S_IFMT) == S_IFREG ) { errno = EEXIST; perror("lstat"); e...
/* Create a named pipe and tell libevent to monitor it */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/evhiperfifo.c#L379-L413
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
write_callback
static size_t write_callback(char *buffer, size_t size, size_t nitems, void *userp) { char *newbuff; size_t rembuff; URL_FILE *url = (URL_FILE *)userp; size *= nitems; rembuff=url->buffer_len - url->buffer_pos; /* remaini...
/* curl calls this routine to get more data */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/fopen.c#L90-L121
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
fill_buffer
static int fill_buffer(URL_FILE *file, size_t want) { fd_set fdread; fd_set fdwrite; fd_set fdexcep; struct timeval timeout; int rc; /* only attempt to fill buffer if transactions still running and buffer * doesnt exceed required size already */ if((!file->still_running) || (file->buffer_pos > want...
/* use to attempt to fill the read buffer up to requested number of bytes */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/fopen.c#L124-L184
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
use_buffer
static int use_buffer(URL_FILE *file,int want) { /* sort out buffer */ if((file->buffer_pos - want) <=0) { /* ditch buffer - write will recreate */ if(file->buffer) free(file->buffer); file->buffer=NULL; file->buffer_pos=0; file->buffer_len=0; } else { /* move rest down make it av...
/* use to remove want bytes from the front of a files buffer */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/fopen.c#L187-L208
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
main
int main(int argc, char *argv[]) { URL_FILE *handle; FILE *outf; int nread; char buffer[256]; const char *url; if(argc < 2) url="http://192.168.7.3/testfile";/* default to testurl */ else url=argv[1];/* use passed url */ /* copy from url line by line with fgets */ outf=fopen("fgets.test","w...
/* Small main program to retrive from a url using fgets and fread saving the * output to two test files (note the fgets method will corrupt binary files if * they contain 0 chars */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/fopen.c#L434-L527
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
throw_away
static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data) { (void)ptr; (void)data; /* we are not interested in the headers itself, so we only return the size we would have saved ... */ return (size_t)(size * nmemb); }
/* * This is an example showing how to check a single file's size and mtime * from an FTP server. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ftpgetinfo.c#L32-L39
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
write_response
static size_t write_response(void *ptr, size_t size, size_t nmemb, void *data) { FILE *writehere = (FILE *)data; return fwrite(ptr, size, nmemb, writehere); }
/* * Similar to ftpget.c but this also stores the received response-lines * in a separate file using our own callback! * * This functionality was introduced in libcurl 7.9.3. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ftpgetresp.c#L33-L38
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
read_callback
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) { curl_off_t nread; /* in real-world cases, this would probably get this data differently as this fread() stuff is exactly what the library already would do by default internally */ size_t retcode = fread(ptr, size, nmemb, s...
/* NOTE: if you want this example to work on Windows with libcurl as a DLL, you MUST also provide a read callback with CURLOPT_READFUNCTION. Failing to do so will give you a crash since a DLL may not use the variable's memory when passed in to it from an app like this. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ftpupload.c#L52-L65
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
getcontentlengthfunc
size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream) { int r; long len = 0; /* _snscanf() is Win32 specific */ r = _snscanf(ptr, size * nmemb, "Content-Length: %ld\n", &len); if (r) /* Microsoft: we don't read the specs */ *((long *) stream) = len; return size * nmemb; }
/* parse headers for Content-Length */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ftpuploadresume.c#L48-L60
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
discardfunc
size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) { return size * nmemb; }
/* discard downloaded data */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ftpuploadresume.c#L63-L66
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
readfunc
size_t readfunc(void *ptr, size_t size, size_t nmemb, void *stream) { FILE *f = stream; size_t n; if (ferror(f)) return CURL_READFUNC_ABORT; n = fread(ptr, size, nmemb, f) * size; return n; }
/* read data to upload */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ftpuploadresume.c#L69-L80
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
mcode_or_die
static void mcode_or_die(const char *where, CURLMcode code) { if ( CURLM_OK != code ) { const char *s; switch (code) { case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break; case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; case CURLM_BAD_EASY_HANDL...
/* Die if we get a bad CURLMcode somewhere */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L103-L120
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
check_multi_info
static void check_multi_info(GlobalInfo *g) { char *eff_url; CURLMsg *msg; int msgs_left; ConnInfo *conn; CURL *easy; CURLcode res; MSG_OUT("REMAINING: %d\n", g->still_running); while ((msg = curl_multi_info_read(g->multi, &msgs_left))) { if (msg->msg == CURLMSG_DONE) { easy = msg->easy_handl...
/* Check for completed transfers, and remove their easy handles */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L125-L148
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
timer_cb
static gboolean timer_cb(gpointer data) { GlobalInfo *g = (GlobalInfo *)data; CURLMcode rc; rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running); mcode_or_die("timer_cb: curl_multi_socket_action", rc); check_multi_info(g); return FALSE; }
/* Called by glib when our timeout expires */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L153-L163
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
update_timeout_cb
static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp) { struct timeval timeout; GlobalInfo *g=(GlobalInfo *)userp; timeout.tv_sec = timeout_ms/1000; timeout.tv_usec = (timeout_ms%1000)*1000; MSG_OUT("*** update_timeout_cb %ld => %ld:%ld ***\n", timeout_ms, timeout.tv_sec, tim...
/* Update the event timer after curl_multi library calls */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L168-L180
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
event_cb
static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data) { GlobalInfo *g = (GlobalInfo*) data; CURLMcode rc; int fd=g_io_channel_unix_get_fd(ch); int action = (condition & G_IO_IN ? CURL_CSELECT_IN : 0) | (condition & G_IO_OUT ? CURL_CSELECT_OUT : 0); rc = curl_multi_socket_ac...
/* Called by glib when we get action on a multi socket */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L186-L207
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
remsock
static void remsock(SockInfo *f) { if (!f) { return; } if (f->ev) { g_source_remove(f->ev); } g_free(f); }
/* Clean up the SockInfo structure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L212-L217
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
setsock
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g) { GIOCondition kind = (act&CURL_POLL_IN?G_IO_IN:0)|(act&CURL_POLL_OUT?G_IO_OUT:0); f->sockfd = s; f->action = act; f->easy = e; if (f->ev) { g_source_remove(f->ev); } f->ev=g_io_add_watch(f->ch, kind, event_cb,g); }
/* Assign information to a SockInfo structure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L222-L233
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
addsock
static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g) { SockInfo *fdp = g_malloc0(sizeof(SockInfo)); fdp->global = g; fdp->ch=g_io_channel_unix_new(s); setsock(fdp, s, easy, action, g); curl_multi_assign(g->multi, s, fdp); }
/* Initialize a new SockInfo structure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L238-L246
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
sock_cb
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { GlobalInfo *g = (GlobalInfo*) cbp; SockInfo *fdp = (SockInfo*) sockp; static const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" }; MSG_OUT("socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if (what == CURL...
/* CURLMOPT_SOCKETFUNCTION */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L251-L275
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
write_cb
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; ConnInfo *conn = (ConnInfo*) data; (void)ptr; (void)conn; return realsize; }
/* CURLOPT_WRITEFUNCTION */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L280-L287
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
prog_cb
static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln) { ConnInfo *conn = (ConnInfo *)p; MSG_OUT("Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal); return 0; }
/* CURLOPT_PROGRESSFUNCTION */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L292-L297
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
new_conn
static void new_conn(char *url, GlobalInfo *g ) { ConnInfo *conn; CURLMcode rc; conn = g_malloc0(sizeof(ConnInfo)); conn->error[0]='\0'; conn->easy = curl_easy_init(); if (!conn->easy) { MSG_OUT("curl_easy_init() failed, exiting!\n"); exit(2); } conn->global = g; conn->url = g_strdup(url); ...
/* Create a new easy handle, and add it to the global curl_multi */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L302-L338
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
fifo_cb
static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data) { #define BUF_SIZE 1024 gsize len, tp; gchar *buf, *tmp, *all=NULL; GIOStatus rv; do { GError *err=NULL; rv = g_io_channel_read_line (ch,&buf,&len,&tp,&err); if ( buf ) { if (tp) { buf[tp]='\0'; } new_conn...
/* This gets called by glib whenever data is received from the fifo */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/ghiper.c#L342-L387
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
multi_timer_cb
static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g) { struct timeval timeout; (void)multi; /* unused */ timeout.tv_sec = timeout_ms/1000; timeout.tv_usec = (timeout_ms%1000)*1000; fprintf(MSG_OUT, "multi_timer_cb: Setting timeout to %ld ms\n", timeout_ms); evtimer_add(&g->timer_event, &...
/* Update the event timer after curl_multi library calls */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L106-L116
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
mcode_or_die
static void mcode_or_die(const char *where, CURLMcode code) { if ( CURLM_OK != code ) { const char *s; switch (code) { case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break; case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break; case CURLM_BAD_EASY_HANDL...
/* Die if we get a bad CURLMcode somewhere */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L119-L141
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
check_multi_info
static void check_multi_info(GlobalInfo *g) { char *eff_url; CURLMsg *msg; int msgs_left; ConnInfo *conn; CURL *easy; CURLcode res; fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running); while ((msg = curl_multi_info_read(g->multi, &msgs_left))) { if (msg->msg == CURLMSG_DONE) { easy = msg->e...
/* Check for completed transfers, and remove their easy handles */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L146-L169
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
event_cb
static void event_cb(int fd, short kind, void *userp) { GlobalInfo *g = (GlobalInfo*) userp; CURLMcode rc; int action = (kind & EV_READ ? CURL_CSELECT_IN : 0) | (kind & EV_WRITE ? CURL_CSELECT_OUT : 0); rc = curl_multi_socket_action(g->multi, fd, action, &g->still_running); mcode_or_die("event_cb: c...
/* Called by libevent when we get action on a multi socket */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L174-L193
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
timer_cb
static void timer_cb(int fd, short kind, void *userp) { GlobalInfo *g = (GlobalInfo *)userp; CURLMcode rc; (void)fd; (void)kind; rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running); mcode_or_die("timer_cb: curl_multi_socket_action", rc); ch...
/* Called by libevent when our timeout expires */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L198-L209
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
remsock
static void remsock(SockInfo *f) { if (f) { if (f->evset) event_del(&f->ev); free(f); } }
/* Clean up the SockInfo structure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L214-L221
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
setsock
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g) { int kind = (act&CURL_POLL_IN?EV_READ:0)|(act&CURL_POLL_OUT?EV_WRITE:0)|EV_PERSIST; f->sockfd = s; f->action = act; f->easy = e; if (f->evset) event_del(&f->ev); event_set(&f->ev, f->sockfd, kind, event_cb, g); f->e...
/* Assign information to a SockInfo structure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L226-L239
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
addsock
static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g) { SockInfo *fdp = calloc(sizeof(SockInfo), 1); fdp->global = g; setsock(fdp, s, easy, action, g); curl_multi_assign(g->multi, s, fdp); }
/* Initialize a new SockInfo structure */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L244-L250
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
sock_cb
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) { GlobalInfo *g = (GlobalInfo*) cbp; SockInfo *fdp = (SockInfo*) sockp; const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" }; fprintf(MSG_OUT, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); if (...
/* CURLMOPT_SOCKETFUNCTION */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L253-L278
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
write_cb
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) { size_t realsize = size * nmemb; ConnInfo *conn = (ConnInfo*) data; (void)ptr; (void)conn; return realsize; }
/* CURLOPT_WRITEFUNCTION */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L283-L290
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
prog_cb
static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln) { ConnInfo *conn = (ConnInfo *)p; (void)ult; (void)uln; fprintf(MSG_OUT, "Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal); return 0; }
/* CURLOPT_PROGRESSFUNCTION */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L294-L303
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
new_conn
static void new_conn(char *url, GlobalInfo *g ) { ConnInfo *conn; CURLMcode rc; conn = calloc(1, sizeof(ConnInfo)); memset(conn, 0, sizeof(ConnInfo)); conn->error[0]='\0'; conn->easy = curl_easy_init(); if (!conn->easy) { fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n"); exit(2); } co...
/* Create a new easy handle, and add it to the global curl_multi */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L307-L339
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
fifo_cb
static void fifo_cb(int fd, short event, void *arg) { char s[1024]; long int rv=0; int n=0; GlobalInfo *g = (GlobalInfo *)arg; (void)fd; /* unused */ (void)event; /* unused */ do { s[0]='\0'; rv=fscanf(g->input, "%1023s%n", s, &n); s[n]='\0'; if ( n && s[0] ) { new_conn(s,arg); /* ...
/* This gets called whenever data is received from the fifo */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L342-L359
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
init_fifo
static int init_fifo (GlobalInfo *g) { struct stat st; static const char *fifo = "hiper.fifo"; curl_socket_t sockfd; fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo); if (lstat (fifo, &st) == 0) { if ((st.st_mode & S_IFMT) == S_IFREG) { errno = EEXIST; perror("lstat"); exit (1); ...
/* Create a named pipe and tell libevent to monitor it */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/hiperfifo.c#L362-L392
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
write_cb
uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out) { uint r; r = size * nmemb; tidyBufAppend( out, in, r ); return(r); }
/* curl write callback, to fill tidy's input buffer... */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/htmltidy.c#L37-L43
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
dumpNode
void dumpNode(TidyDoc doc, TidyNode tnod, int indent ) { TidyNode child; for ( child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) { ctmbstr name = tidyNodeGetName( child ); if ( name ) { /* if it has a name, then it's an HTML tag ... */ TidyAttr attr; printf( "%*.*s%s ",...
/* Traverse the document tree */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/htmltidy.c#L46-L75
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
read_callback
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) { size_t retcode; curl_off_t nread; /* in real-world cases, this would probably get this data differently as this fread() stuff is exactly what the library already would do by default internally */ retcode = fread(ptr, si...
/* * This example shows a HTTP PUT operation. PUTs a file given as a command * line argument to the URL also given on the command line. * * This example also uses its own read callback. * * Here's an article on how to setup a PUT handler for Apache: * http://www.apacheweek.com/features/put */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/httpput.c#L39-L55
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
main
int main(void) { CURL *http_handle; CURLM *multi_handle; int still_running; /* keep number of running handles */ http_handle = curl_easy_init(); /* set the options (I left out a few, you'll get the point anyway) */ curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/"); curl_easy_setopt...
/* * Simply download a HTTP file. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/multi-debugcallback.c#L123-L205
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
main
int main(void) { CURL *http_handle; CURL *http_handle2; CURLM *multi_handle; int still_running; /* keep number of running handles */ http_handle = curl_easy_init(); http_handle2 = curl_easy_init(); /* set options */ curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/"); /* set opti...
/* * Simply download two HTTP files! */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/multi-double.c#L35-L119
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
main
int main(void) { CURL *http_handle; CURLM *multi_handle; int still_running; /* keep number of running handles */ http_handle = curl_easy_init(); /* set the options (I left out a few, you'll get the point anyway) */ curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/"); /* init a multi ...
/* * Simply download a HTTP file. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/multi-single.c#L37-L116
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
main
int main(int argc, char **argv) { pthread_t tid[NUMT]; int i; int error; /* Must initialize libcurl before any threads are started */ curl_global_init(CURL_GLOBAL_ALL); for(i=0; i< NUMT; i++) { error = pthread_create(&tid[i], NULL, /* default attributes please */ ...
/* int pthread_create(pthread_t *new_thread_ID, const pthread_attr_t *attr, void * (*start_func)(void *), void *arg); */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/multithread.c#L66-L93
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
rtsp_options
static void rtsp_options(CURL *curl, const char *uri) { CURLcode res = CURLE_OK; printf("\nRTSP: OPTIONS %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS); my_curl_easy_perform(curl); }
/* send RTSP OPTIONS request */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/rtsp.c#L71-L78
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
rtsp_describe
static void rtsp_describe(CURL *curl, const char *uri, const char *sdp_filename) { CURLcode res = CURLE_OK; FILE *sdp_fp = fopen(sdp_filename, "wt"); printf("\nRTSP: DESCRIBE %s\n", uri); if (sdp_fp == NULL) { fprintf(stderr, "Could not open '%s' for writing\n", sdp_filename); ...
/* send RTSP DESCRIBE request and write sdp response to a file */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/rtsp.c#L82-L102
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
rtsp_setup
static void rtsp_setup(CURL *curl, const char *uri, const char *transport) { CURLcode res = CURLE_OK; printf("\nRTSP: SETUP %s\n", uri); printf(" TRANSPORT %s\n", transport); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_TRANSPORT, transport); my_curl_e...
/* send RTSP SETUP request */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/rtsp.c#L105-L114
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
rtsp_play
static void rtsp_play(CURL *curl, const char *uri, const char *range) { CURLcode res = CURLE_OK; printf("\nRTSP: PLAY %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); my_curl_easy_setopt(curl, CURLOPT_RANGE, range); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY);...
/* send RTSP PLAY request */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/rtsp.c#L118-L126
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
rtsp_teardown
static void rtsp_teardown(CURL *curl, const char *uri) { CURLcode res = CURLE_OK; printf("\nRTSP: TEARDOWN %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_TEARDOWN); my_curl_easy_perform(curl); }
/* send RTSP TEARDOWN request */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/rtsp.c#L130-L136
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
get_sdp_filename
static void get_sdp_filename(const char *url, char *sdp_filename) { const char *s = strrchr(url, '/'); strcpy(sdp_filename, "video.sdp"); if (s != NULL) { s++; if (s[0] != '\0') { sprintf(sdp_filename, "%s.sdp", s); } } }
/* convert url into an sdp filename */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/rtsp.c#L140-L150
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
get_media_control_attribute
static void get_media_control_attribute(const char *sdp_filename, char *control) { int max_len = 256; char *s = malloc(max_len); FILE *sdp_fp = fopen(sdp_filename, "rt"); control[0] = '\0'; if (sdp_fp != NULL) { while (fgets(s, max_len - 2, sdp_fp) != NULL) { ...
/* scan sdp file for media control attribute */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/rtsp.c#L154-L168
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
main
int main(int argc, char * const argv[]) { #if 1 const char *transport = "RTP/AVP;unicast;client_port=1234-1235"; /* UDP */ #else const char *transport = "RTP/AVP/TCP;unicast;client_port=1234-1235"; /* TCP */ #endif const char *range = "0.000-"; int rc = EXIT_SUCCESS; char *base_name = NULL; printf("\nRTS...
/* main app */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/rtsp.c#L172-L271
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
wait_on_socket
static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms) { struct timeval tv; fd_set infd, outfd, errfd; int res; tv.tv_sec = timeout_ms / 1000; tv.tv_usec= (timeout_ms % 1000) * 1000; FD_ZERO(&infd); FD_ZERO(&outfd); FD_ZERO(&errfd); FD_SET(sockfd, &errfd); /* always check fo...
/* Auxiliary function that waits on the socket. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/sendrecv.c#L29-L56
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
main
int main(void) { int i; CURL *curl; CURLcode res; FILE *headerfile; const char *pPassphrase = NULL; static const char *pCertFile = "testcert.pem"; static const char *pCACertFile="cacert.pem"; const char *pKeyName; const char *pKeyType; const char *pEngine; #ifdef USE_ENGINE pKeyName = "rsa_te...
/* some requirements for this to work: 1. set pCertFile to the file with the client certificate 2. if the key is passphrase protected, set pPassphrase to the passphrase you use 3. if you are using a crypto engine: 3.1. set a #define USE_ENGINE 3.2. set pEngine to the name of the crypto engi...
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/docs/examples/simplessl.c#L44-L138
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_resolver_global_init
int Curl_resolver_global_init(void) { #ifdef CARES_HAVE_ARES_LIBRARY_INIT if(ares_library_init(ARES_LIB_INIT_ALL)) { return CURLE_FAILED_INIT; } #endif return CURLE_OK; }
/* * Curl_resolver_global_init() - the generic low-level asynchronous name * resolve API. Called from curl_global_init() to initialize global resolver * environment. Initializes ares library. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/asyn-ares.c#L103-L111
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_resolver_global_cleanup
void Curl_resolver_global_cleanup(void) { #ifdef CARES_HAVE_ARES_LIBRARY_CLEANUP ares_library_cleanup(); #endif }
/* * Curl_resolver_global_cleanup() * * Called from curl_global_cleanup() to destroy global resolver environment. * Deinitializes ares library. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/asyn-ares.c#L119-L124
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_resolver_init
CURLcode Curl_resolver_init(void **resolver) { int status = ares_init((ares_channel*)resolver); if(status != ARES_SUCCESS) { if(status == ARES_ENOMEM) return CURLE_OUT_OF_MEMORY; else return CURLE_FAILED_INIT; } return CURLE_OK; /* make sure that all other returns from this function should...
/* * Curl_resolver_init() * * Called from curl_easy_init() -> Curl_open() to initialize resolver * URL-state specific environment ('resolver' member of the UrlState * structure). Fills the passed pointer by the initialized ares_channel. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/asyn-ares.c#L133-L145
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_resolver_cleanup
void Curl_resolver_cleanup(void *resolver) { ares_destroy((ares_channel)resolver); }
/* * Curl_resolver_cleanup() * * Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver * URL-state specific environment ('resolver' member of the UrlState * structure). Destroys the ares channel. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/asyn-ares.c#L154-L157
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_resolver_duphandle
int Curl_resolver_duphandle(void **to, void *from) { /* Clone the ares channel for the new handle */ if(ARES_SUCCESS != ares_dup((ares_channel*)to,(ares_channel)from)) return CURLE_FAILED_INIT; return CURLE_OK; }
/* * Curl_resolver_duphandle() * * Called from curl_easy_duphandle() to duplicate resolver URL-state specific * environment ('resolver' member of the UrlState structure). Duplicates the * 'from' ares channel and passes the resulting channel to the 'to' pointer. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/asyn-ares.c#L166-L172
4389085c8ce35cff887a4cc18fc47d1133d89ffb
BigWorld-Engine-14.4.1
github_2023
v2v3v4
c
Curl_resolver_cancel
void Curl_resolver_cancel(struct connectdata *conn) { if(conn && conn->data && conn->data->state.resolver) ares_cancel((ares_channel)conn->data->state.resolver); destroy_async_data(&conn->async); }
/* * Cancel all possibly still on-going resolves for this connection. */
https://github.com/v2v3v4/BigWorld-Engine-14.4.1/blob/4389085c8ce35cff887a4cc18fc47d1133d89ffb/programming/bigworld/third_party/curl/lib/asyn-ares.c#L179-L184
4389085c8ce35cff887a4cc18fc47d1133d89ffb