tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 352465171adece70a35f4e2ae39668244cdcdeaa
parent fbd30bf87867b86c257a5a8ae4e5b9d0255c6a3f
Author: Michael Froman <mfroman@mozilla.com>
Date:   Tue, 18 Nov 2025 17:44:39 +0000

Bug 2000353 - remove unused functions r=bwc,ng

Differential Revision: https://phabricator.services.mozilla.com/D272754

Diffstat:
Mdom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate_pair.c | 31-------------------------------
Mdom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate_pair.h | 1-
Mdom/media/webrtc/transport/third_party/nICEr/src/ice/ice_ctx.c | 117-------------------------------------------------------------------------------
Mdom/media/webrtc/transport/third_party/nICEr/src/ice/ice_ctx.h | 4----
Mdom/media/webrtc/transport/third_party/nICEr/src/ice/ice_media_stream.c | 58----------------------------------------------------------
Mdom/media/webrtc/transport/third_party/nICEr/src/ice/ice_media_stream.h | 2--
Mdom/media/webrtc/transport/third_party/nICEr/src/ice/ice_peer_ctx.c | 24------------------------
Mdom/media/webrtc/transport/third_party/nICEr/src/ice/ice_peer_ctx.h | 1-
Mdom/media/webrtc/transport/third_party/nICEr/src/stun/stun_client_ctx.c | 24------------------------
Mdom/media/webrtc/transport/third_party/nICEr/src/stun/stun_client_ctx.h | 2--
Mdom/media/webrtc/transport/third_party/nICEr/src/stun/stun_hint.c | 16----------------
Mdom/media/webrtc/transport/third_party/nICEr/src/stun/stun_hint.h | 1-
Mdom/media/webrtc/transport/third_party/nrappkit/src/event/async_timer.h | 6+-----
Mdom/media/webrtc/transport/third_party/nrappkit/src/event/async_wait.h | 5++---
Mdom/media/webrtc/transport/third_party/nrappkit/src/log/r_log.c | 75---------------------------------------------------------------------------
Mdom/media/webrtc/transport/third_party/nrappkit/src/log/r_log.h | 16----------------
Mdom/media/webrtc/transport/third_party/nrappkit/src/registry/registry.h | 1-
Mdom/media/webrtc/transport/third_party/nrappkit/src/registry/registrycb.c | 73-------------------------------------------------------------------------
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/hex.c | 37-------------------------------------
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/hex.h | 1-
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_assoc.c | 129-------------------------------------------------------------------------------
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_assoc.h | 3---
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_data.c | 54------------------------------------------------------
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_data.h | 4----
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_errors.c | 13-------------
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_errors.h | 2--
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_memory.c | 52----------------------------------------------------
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_memory.h | 4----
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_time.c | 20--------------------
Mdom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_time.h | 1-
30 files changed, 3 insertions(+), 774 deletions(-)

diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate_pair.c b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate_pair.c @@ -554,37 +554,6 @@ void nr_ice_candidate_pair_cancel(nr_ice_peer_ctx *pctx,nr_ice_cand_pair *pair, } } -int nr_ice_candidate_pair_select(nr_ice_cand_pair *pair) - { - int r,_status; - - if(!pair){ - r_log(LOG_ICE,LOG_ERR,"ICE-PAIR: No pair chosen"); - ABORT(R_BAD_ARGS); - } - - if(pair->state!=NR_ICE_PAIR_STATE_SUCCEEDED){ - r_log(LOG_ICE,LOG_ERR,"ICE-PEER(%s)/CAND-PAIR(%s): tried to install non-succeeded pair, ignoring: %s",pair->pctx->label,pair->codeword,pair->as_string); - } - else{ - /* Ok, they chose one */ - /* 1. Send a new request with nominated. Do it as a scheduled - event to avoid reentrancy issues. Only do this if it hasn't - happened already (though this shouldn't happen.) - */ - if(!pair->restart_nominated_cb_timer) - NR_ASYNC_TIMER_SET(0,nr_ice_candidate_pair_restart_stun_nominated_cb,pair,&pair->restart_nominated_cb_timer); - - /* 2. Tell ourselves this pair is ready */ - if(r=nr_ice_component_nominated_pair(pair->remote->component, pair)) - ABORT(r); - } - - _status=0; - abort: - return(_status); - } - void nr_ice_candidate_pair_set_state(nr_ice_peer_ctx *pctx, nr_ice_cand_pair *pair, int state) { r_log(LOG_ICE,LOG_INFO,"ICE-PEER(%s)/CAND-PAIR(%s): setting pair to state %s: %s", diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate_pair.h b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_candidate_pair.h @@ -89,7 +89,6 @@ int nr_ice_candidate_pair_start(nr_ice_peer_ctx *pctx, nr_ice_cand_pair *pair); void nr_ice_candidate_pair_set_state(nr_ice_peer_ctx *pctx, nr_ice_cand_pair *pair, int state); void nr_ice_candidate_pair_dump_state(nr_ice_cand_pair *pair, int log_level); void nr_ice_candidate_pair_cancel(nr_ice_peer_ctx *pctx,nr_ice_cand_pair *pair, int move_to_wait_state); -int nr_ice_candidate_pair_select(nr_ice_cand_pair *pair); int nr_ice_candidate_pair_do_triggered_check(nr_ice_peer_ctx *pctx, nr_ice_cand_pair *pair, int force); void nr_ice_candidate_pair_insert(nr_ice_cand_pair_head *head,nr_ice_cand_pair *pair); int nr_ice_candidate_pair_trigger_check_append(nr_ice_cand_pair_head *head,nr_ice_cand_pair *pair); diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_ctx.c b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_ctx.c @@ -58,7 +58,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. int LOG_ICE = 0; -static int nr_ice_random_string(char *str, int len); static int nr_ice_fetch_stun_servers(int ct, nr_ice_stun_server **out); #ifdef USE_TURN static int nr_ice_fetch_turn_servers(int ct, nr_ice_turn_server **out); @@ -168,31 +167,6 @@ int nr_ice_ctx_set_turn_servers(nr_ice_ctx *ctx,nr_ice_turn_server *servers,int return(_status); } -int nr_ice_ctx_copy_turn_servers(nr_ice_ctx *ctx, nr_ice_turn_server *servers, int ct) - { - int _status, i, r; - - if (r = nr_ice_ctx_set_turn_servers(ctx, servers, ct)) { - ABORT(r); - } - - // make copies of the username and password so they aren't freed twice - for (i = 0; i < ct; ++i) { - if (!(ctx->turn_servers_cfg[i].username = r_strdup(servers[i].username))) { - ABORT(R_NO_MEMORY); - } - if (r = r_data_create(&ctx->turn_servers_cfg[i].password, - servers[i].password->data, - servers[i].password->len)) { - ABORT(r); - } - } - - _status=0; - abort: - return(_status); - } - static int nr_ice_ctx_set_local_addrs(nr_ice_ctx *ctx,nr_local_addr *addrs,int ct) { int _status,i,r; @@ -956,28 +930,6 @@ int nr_ice_get_global_attributes(nr_ice_ctx *ctx,char ***attrsp, int *attrctp) return(0); } -static int nr_ice_random_string(char *str, int len) - { - unsigned char bytes[100]; - size_t needed; - int r,_status; - - if(len%2) ABORT(R_BAD_ARGS); - needed=len/2; - - if(needed>sizeof(bytes)) ABORT(R_BAD_ARGS); - - if(r=nr_crypto_random_bytes(bytes,needed)) - ABORT(r); - - if(r=nr_bin2hex(bytes,needed,(unsigned char *)str)) - ABORT(r); - - _status=0; - abort: - return(_status); - } - /* This is incredibly annoying: we now have a datagram but we don't know which peer it's from, and we need to be able to tell the API user. So, offer it to each peer and if one bites, assume @@ -1041,38 +993,6 @@ int nr_ice_ctx_remember_id(nr_ice_ctx *ctx, nr_stun_message *msg) } -/* Clean up some of the resources (mostly file descriptors) used - by candidates we didn't choose. Note that this still leaves - a fair amount of non-system stuff floating around. This gets - cleaned up when you destroy the ICE ctx */ -int nr_ice_ctx_finalize(nr_ice_ctx *ctx, nr_ice_peer_ctx *pctx) - { - nr_ice_media_stream *lstr,*rstr; - - r_log(LOG_ICE,LOG_DEBUG,"Finalizing ICE ctx %s, peer=%s",ctx->label,pctx->label); - /* - First find the peer stream, if any - */ - lstr=STAILQ_FIRST(&ctx->streams); - while(lstr){ - rstr=STAILQ_FIRST(&pctx->peer_streams); - - while(rstr){ - if(rstr->local_stream==lstr) - break; - - rstr=STAILQ_NEXT(rstr,entry); - } - - nr_ice_media_stream_finalize(lstr,rstr); - - lstr=STAILQ_NEXT(lstr,entry); - } - - return(0); - } - - int nr_ice_ctx_set_trickle_cb(nr_ice_ctx *ctx, nr_ice_trickle_candidate_cb cb, void *cb_arg) { ctx->trickle_cb = cb; @@ -1099,40 +1019,3 @@ int nr_ice_ctx_hide_candidate(nr_ice_ctx *ctx, nr_ice_candidate *cand) return 0; } -int nr_ice_get_new_ice_ufrag(char** ufrag) - { - int r,_status; - char buf[ICE_UFRAG_LEN+1]; - - if(r=nr_ice_random_string(buf,ICE_UFRAG_LEN)) - ABORT(r); - if(!(*ufrag=r_strdup(buf))) - ABORT(r); - - _status=0; - abort: - if(_status) { - RFREE(*ufrag); - *ufrag = 0; - } - return(_status); - } - -int nr_ice_get_new_ice_pwd(char** pwd) - { - int r,_status; - char buf[ICE_PWD_LEN+1]; - - if(r=nr_ice_random_string(buf,ICE_PWD_LEN)) - ABORT(r); - if(!(*pwd=r_strdup(buf))) - ABORT(r); - - _status=0; - abort: - if(_status) { - RFREE(*pwd); - *pwd = 0; - } - return(_status); - } diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_ctx.h b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_ctx.h @@ -182,17 +182,13 @@ int nr_ice_get_global_attributes(nr_ice_ctx *ctx,char ***attrsp, int *attrctp); int nr_ice_ctx_deliver_packet(nr_ice_ctx *ctx, nr_ice_component *comp, nr_transport_addr *source_addr, UCHAR *data, int len); int nr_ice_ctx_is_known_id(nr_ice_ctx *ctx, UCHAR id[12]); int nr_ice_ctx_remember_id(nr_ice_ctx *ctx, nr_stun_message *msg); -int nr_ice_ctx_finalize(nr_ice_ctx *ctx, nr_ice_peer_ctx *pctx); int nr_ice_ctx_set_stun_servers(nr_ice_ctx *ctx,nr_ice_stun_server *servers, int ct); int nr_ice_ctx_set_turn_servers(nr_ice_ctx *ctx,nr_ice_turn_server *servers, int ct); -int nr_ice_ctx_copy_turn_servers(nr_ice_ctx *ctx, nr_ice_turn_server *servers, int ct); int nr_ice_ctx_set_resolver(nr_ice_ctx *ctx, nr_resolver *resolver); int nr_ice_ctx_set_interface_prioritizer(nr_ice_ctx *ctx, nr_interface_prioritizer *prioritizer); void nr_ice_ctx_set_socket_factory(nr_ice_ctx *ctx, nr_socket_factory *factory); int nr_ice_ctx_set_trickle_cb(nr_ice_ctx *ctx, nr_ice_trickle_candidate_cb cb, void *cb_arg); int nr_ice_ctx_hide_candidate(nr_ice_ctx *ctx, nr_ice_candidate *cand); -int nr_ice_get_new_ice_ufrag(char** ufrag); -int nr_ice_get_new_ice_pwd(char** pwd); #define NR_ICE_MAX_ATTRIBUTE_SIZE 256 diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_media_stream.c b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_media_stream.c @@ -855,36 +855,6 @@ void nr_ice_media_stream_component_failed(nr_ice_media_stream *stream,nr_ice_com nr_ice_peer_ctx_check_if_connected(stream->pctx); } -int nr_ice_media_stream_get_best_candidate(nr_ice_media_stream *str, int component, nr_ice_candidate **candp) - { - nr_ice_candidate *cand; - nr_ice_candidate *best_cand=0; - nr_ice_component *comp; - int r,_status; - - if(r=nr_ice_media_stream_find_component(str,component,&comp)) - ABORT(r); - - cand=TAILQ_FIRST(&comp->candidates); - while(cand){ - if(cand->state==NR_ICE_CAND_STATE_INITIALIZED){ - if(!best_cand || (cand->priority>best_cand->priority)) - best_cand=cand; - - } - cand=TAILQ_NEXT(cand,entry_comp); - } - - if(!best_cand) - ABORT(R_NOT_FOUND); - - *candp=best_cand; - - _status=0; - abort: - return(_status); - } - /* OK, we have the stream the user created, but that reflects the base ICE ctx, not the peer_ctx. So, find the related stream in the pctx, @@ -974,34 +944,6 @@ int nr_ice_media_stream_get_active(nr_ice_peer_ctx *pctx, nr_ice_media_stream *s return(_status); } -int nr_ice_media_stream_addrs(nr_ice_peer_ctx *pctx, nr_ice_media_stream *str, int component, nr_transport_addr *local, nr_transport_addr *remote) - { - int r,_status; - nr_ice_component *comp; - - /* First find the peer component */ - if(r=nr_ice_peer_ctx_find_component(pctx, str, component, &comp)) - ABORT(r); - - /* Do we have an active pair yet? We should... */ - if(!comp->active) - ABORT(R_BAD_ARGS); - - /* Use the socket on our local side */ - if(r=nr_socket_getaddr(comp->active->local->osock,local)) - ABORT(r); - - /* Use the address on the remote side */ - if(r=nr_transport_addr_copy(remote,&comp->active->remote->addr)) - ABORT(r); - - _status=0; - abort: - return(_status); - } - - - int nr_ice_media_stream_finalize(nr_ice_media_stream *lstr,nr_ice_media_stream *rstr) { nr_ice_component *lcomp,*rcomp; diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_media_stream.h b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_media_stream.h @@ -127,12 +127,10 @@ int nr_ice_media_stream_set_state(nr_ice_media_stream *str, int state); void nr_ice_media_stream_stop_checking(nr_ice_media_stream *str); void nr_ice_media_stream_set_obsolete(nr_ice_media_stream *str); int nr_ice_media_stream_is_done_gathering(nr_ice_media_stream *str); -int nr_ice_media_stream_get_best_candidate(nr_ice_media_stream *str, int component, nr_ice_candidate **candp); int nr_ice_media_stream_send(nr_ice_peer_ctx *pctx, nr_ice_media_stream *str, int component, UCHAR *data, int len); int nr_ice_media_stream_get_active(nr_ice_peer_ctx *pctx, nr_ice_media_stream *str, int component, nr_ice_candidate **local, nr_ice_candidate **remote); int nr_ice_media_stream_find_component(nr_ice_media_stream *str, int comp_id, nr_ice_component **compp); int nr_ice_media_stream_find_pair(nr_ice_media_stream *str, nr_ice_candidate *local, nr_ice_candidate *remote, nr_ice_cand_pair **pair); -int nr_ice_media_stream_addrs(nr_ice_peer_ctx *pctx, nr_ice_media_stream *str, int component, nr_transport_addr *local, nr_transport_addr *remote); int nr_ice_peer_ctx_parse_media_stream_attribute(nr_ice_peer_ctx *pctx, nr_ice_media_stream *stream, char *attr); int nr_ice_media_stream_get_consent_status(nr_ice_media_stream *stream, int component_id, int *can_send, struct timeval *ts); diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_peer_ctx.c b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_peer_ctx.c @@ -462,30 +462,6 @@ int nr_ice_peer_ctx_pair_new_trickle_candidate(nr_ice_ctx *ctx, nr_ice_peer_ctx return _status; } -int nr_ice_peer_ctx_disable_component(nr_ice_peer_ctx *pctx, nr_ice_media_stream *lstream, int component_id) - { - int r, _status; - nr_ice_media_stream *pstream; - nr_ice_component *component; - - if ((r=nr_ice_peer_ctx_find_pstream(pctx, lstream, &pstream))) - ABORT(r); - - /* We shouldn't be calling this after we have started pairing */ - if (pstream->ice_state != NR_ICE_MEDIA_STREAM_UNPAIRED) - ABORT(R_FAILED); - - if ((r=nr_ice_media_stream_find_component(pstream, component_id, - &component))) - ABORT(r); - - component->state = NR_ICE_COMPONENT_DISABLED; - - _status=0; - abort: - return(_status); - } - void nr_ice_peer_ctx_destroy(nr_ice_peer_ctx** pctxp) { if (!pctxp || !*pctxp) return; diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_peer_ctx.h b/dom/media/webrtc/transport/third_party/nICEr/src/ice/ice_peer_ctx.h @@ -90,7 +90,6 @@ int nr_ice_peer_ctx_log_state(nr_ice_peer_ctx *pctx); void nr_ice_peer_ctx_check_if_connected(nr_ice_peer_ctx *pctx); int nr_ice_peer_ctx_find_component(nr_ice_peer_ctx *pctx, nr_ice_media_stream *str, int component_id, nr_ice_component **compp); int nr_ice_peer_ctx_deliver_packet_maybe(nr_ice_peer_ctx *pctx, nr_ice_component *comp, nr_transport_addr *source_addr, UCHAR *data, int len); -int nr_ice_peer_ctx_disable_component(nr_ice_peer_ctx *pctx, nr_ice_media_stream *lstream, int component_id); int nr_ice_peer_ctx_pair_new_trickle_candidate(nr_ice_ctx *ctx, nr_ice_peer_ctx *pctx, nr_ice_candidate *cand); void nr_ice_peer_ctx_switch_controlling_role(nr_ice_peer_ctx *pctx); diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/stun/stun_client_ctx.c b/dom/media/webrtc/transport/third_party/nICEr/src/stun/stun_client_ctx.c @@ -157,30 +157,6 @@ int nr_stun_client_start(nr_stun_client_ctx *ctx, int mode, NR_async_cb finished return(_status); } - int nr_stun_client_restart(nr_stun_client_ctx* ctx, - const nr_transport_addr* peer_addr) { - int r,_status; - int mode; - NR_async_cb finished_cb; - void *cb_arg; - if (ctx->state != NR_STUN_CLIENT_STATE_RUNNING) - ABORT(R_NOT_PERMITTED); - - mode = ctx->mode; - finished_cb = ctx->finished_cb; - cb_arg = ctx->cb_arg; - - nr_stun_client_reset(ctx); - nr_transport_addr_copy(&ctx->peer_addr, peer_addr); - - if (r=nr_stun_client_start(ctx, mode, finished_cb, cb_arg)) - ABORT(r); - - _status=0; - abort: - return(_status); - } - int nr_stun_client_reset(nr_stun_client_ctx *ctx) { diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/stun/stun_client_ctx.h b/dom/media/webrtc/transport/third_party/nICEr/src/stun/stun_client_ctx.h @@ -194,8 +194,6 @@ int nr_stun_client_ctx_create(char* label, nr_socket* sock, nr_transport_addr* peer, UINT4 RTO, int flags, nr_stun_client_ctx** ctxp); int nr_stun_client_start(nr_stun_client_ctx *ctx, int mode, NR_async_cb finished_cb, void *cb_arg); -int nr_stun_client_restart(nr_stun_client_ctx* ctx, - const nr_transport_addr* peer_addr); int nr_stun_client_force_retransmit(nr_stun_client_ctx *ctx); int nr_stun_client_reset(nr_stun_client_ctx *ctx); int nr_stun_client_ctx_destroy(nr_stun_client_ctx **ctxp); diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/stun/stun_hint.c b/dom/media/webrtc/transport/third_party/nICEr/src/stun/stun_hint.c @@ -211,22 +211,6 @@ nr_is_stun_response_message(UCHAR *buf, size_t len) } int -nr_has_stun_cookie(UCHAR *buf, size_t len) -{ - static UINT4 cookie; - - cookie = htonl(NR_STUN_MAGIC_COOKIE); - - if (sizeof(nr_stun_message_header) > len) - return 0; - - if (memcmp(&cookie, &buf[4], sizeof(UINT4))) - return 0; - - return 1; -} - -int nr_stun_message_length(UCHAR *buf, int buf_len, int *msg_len) { nr_stun_message_header *hdr; diff --git a/dom/media/webrtc/transport/third_party/nICEr/src/stun/stun_hint.h b/dom/media/webrtc/transport/third_party/nICEr/src/stun/stun_hint.h @@ -38,7 +38,6 @@ int nr_is_stun_message(UCHAR *buf, size_t len); int nr_is_stun_request_message(UCHAR *buf, size_t len); int nr_is_stun_response_message(UCHAR *buf, size_t len); int nr_is_stun_indication_message(UCHAR *buf, size_t len); -int nr_has_stun_cookie(UCHAR *buf, size_t len); int nr_stun_message_length(UCHAR *buf, int len, int *length); #endif diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/event/async_timer.h b/dom/media/webrtc/transport/third_party/nrappkit/src/event/async_timer.h @@ -40,13 +40,9 @@ #ifndef _async_timer_h #define _async_timer_h - -int NR_async_timer_init(void); +// These are defined in dom/media/webrtc/transport/nr_timer.cpp int NR_async_timer_set(int delay_ms,NR_async_cb cb,void *cb_arg,char *function,int line,void **handle); int NR_async_timer_cancel(void *handle); -int NR_async_timer_update_time(struct timeval *tv); -int NR_async_timer_next_timeout(int *delay_ms); -int NR_async_timer_sanity_check_for_cb_deleted(NR_async_cb cb,void *cb_arg); #define NR_ASYNC_TIMER_SET(d,c,a,hp) NR_async_timer_set(d,c,a,(char *)__FUNCTION__,__LINE__,hp) diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/event/async_wait.h b/dom/media/webrtc/transport/third_party/nrappkit/src/event/async_wait.h @@ -51,13 +51,12 @@ typedef void (*NR_async_cb)(NR_SOCKET resource,int how,void *arg); #define NR_ASYNC_WAIT_WRITE 1 -int NR_async_wait_init(void); +// These are defined in dom/media/webrtc/transport/nr_socket_prsock.cpp int NR_async_wait(NR_SOCKET sock, int how, NR_async_cb cb,void *cb_arg, char *function,int line); int NR_async_cancel(NR_SOCKET sock,int how); +// defined in dom/media/webrtc/transport/nr_timer.cpp int NR_async_schedule(NR_async_cb cb,void *arg,char *function,int line); -int NR_async_event_wait(int *eventsp); -int NR_async_event_wait2(int *eventsp,struct timeval *tv); #ifdef NR_DEBUG_ASYNC diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/log/r_log.c b/dom/media/webrtc/transport/third_party/nrappkit/src/log/r_log.c @@ -225,15 +225,6 @@ int r_log_register(char *facility_name,int *log_facility) return(_status); } -int r_log_facility(int facility,char **typename) - { - if(facility >= 0 && facility < log_type_ct){ - *typename=log_types[facility].facility_name; - return(0); - } - return(R_NOT_FOUND); - } - static int r_log_get_reg_level(NR_registry name, int *out) { char level[32]; @@ -391,72 +382,6 @@ int noop_vlog(int facility,int level,const char *format,va_list ap) return(0); } -int r_log_e(int facility,int level,const char *format,...) - { - va_list ap; - - va_start(ap,format); - r_vlog_e(facility,level,format,ap); - va_end(ap); - - return(0); - } - -int r_vlog_e(int facility,int level,const char *format,va_list ap) - { - char log_fmt_buf[MAX_ERROR_STRING_SIZE]; - if(r_logging(facility,level)) { - int formatlen = strlen(format); - - if(formatlen+2 > MAX_ERROR_STRING_SIZE) - return(1); - - strncpy(log_fmt_buf, format, formatlen); - strcpy(&log_fmt_buf[formatlen], ": "); - snprintf(&log_fmt_buf[formatlen+2], MAX_ERROR_STRING_SIZE - formatlen - 2, "%s", -#ifdef WIN32 - strerror(WSAGetLastError())); -#else - strerror(errno)); -#endif - log_fmt_buf[MAX_ERROR_STRING_SIZE-1]=0; - - r_vlog(facility,level,log_fmt_buf,ap); - } - return(0); - } - -int r_log_nr(int facility,int level,int r,const char *format,...) - { - va_list ap; - - va_start(ap,format); - r_vlog_nr(facility,level,r,format,ap); - va_end(ap); - - return(0); - } - -int r_vlog_nr(int facility,int level,int r,const char *format,va_list ap) - { - char log_fmt_buf[MAX_ERROR_STRING_SIZE]; - if(r_logging(facility,level)) { - int formatlen = strlen(format); - - if(formatlen+2 > MAX_ERROR_STRING_SIZE) - return(1); - strncpy(log_fmt_buf, format, formatlen); - strcpy(&log_fmt_buf[formatlen], ": "); - snprintf(&log_fmt_buf[formatlen+2], MAX_ERROR_STRING_SIZE - formatlen - 2, "%s", - nr_strerror(r)); - - log_fmt_buf[MAX_ERROR_STRING_SIZE-1]=0; - - r_vlog(facility,level,log_fmt_buf,ap); - } - return(0); - } - static int r_logging_dest(int dest_index, int facility, int level) { int thresh; diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/log/r_log.h b/dom/media/webrtc/transport/third_party/nrappkit/src/log/r_log.h @@ -55,23 +55,7 @@ int r_log(int facility,int level,const char *fmt,...) int r_vlog(int facility,int level,const char *fmt,va_list ap); int r_dump(int facility,int level,char *name,char *data,int len); -int r_log_e(int facility,int level,const char *fmt,...) -#ifdef __GNUC__ - __attribute__ ((format (printf, 3, 4))) -#endif -; - -int r_vlog_e(int facility,int level,const char *fmt,va_list ap); -int r_log_nr(int facility,int level,int r,const char *fmt,...) -#ifdef __GNUC__ - __attribute__ ((format (printf, 4, 5))) -#endif -; - -int r_vlog_nr(int facility,int level,int r,const char *fmt,va_list ap); - int r_log_register(char *tipename,int *facility); -int r_log_facility(int facility,char **tipename); int r_logging(int facility, int level); int r_log_init(void); diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/registry/registry.h b/dom/media/webrtc/transport/third_party/nrappkit/src/registry/registry.h @@ -114,7 +114,6 @@ int NR_reg_alloc_string(NR_registry name, char **data); #define NR_REG_CB_ACTION_DELETE (1<<2) #define NR_REG_CB_ACTION_FINAL (1<<6) int NR_reg_register_callback(NR_registry name, char action, void (*cb)(void *cb_arg, char action, NR_registry name), void *cb_arg); -int NR_reg_unregister_callback(NR_registry name, char action, void (*cb)(void *cb_arg, char action, NR_registry name)); int NR_reg_make_registry(NR_registry parent, char *child, NR_registry out); diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/registry/registrycb.c b/dom/media/webrtc/transport/third_party/nrappkit/src/registry/registrycb.c @@ -77,7 +77,6 @@ static int compute_cb_id(void *cb, char action, unsigned char cb_id[SIZEOF_CB_ID static int nr_reg_info_free(void *ptr); static int nr_reg_raise_event_recurse(char *name, char *tmp, int action); static int nr_reg_register_callback(NR_registry name, char action, void (*cb)(void *cb_arg, char action, NR_registry name), void *cb_arg); -static int nr_reg_unregister_callback(char *name, char action, void (*cb)(void *cb_arg, char action, NR_registry name)); int nr_reg_cb_init() @@ -188,55 +187,6 @@ nr_reg_register_callback(NR_registry name, char action, void (*cb)(void *cb_arg, } int -nr_reg_unregister_callback(char *name, char action, void (*cb)(void *cb_arg, char action, NR_registry name)) -{ - int r, _status; - r_assoc *assoc = 0; - int size; - unsigned char cb_id[SIZEOF_CB_ID]; - - if (name == 0 || cb == 0) - ABORT(R_BAD_ARGS); - - if (nr_registry_callbacks == 0) - ABORT(R_FAILED); - - if ((r=nr_reg_is_valid(name))) - ABORT(r); - - if ((r=nr_reg_validate_action(action))) - ABORT(r); - - if ((r=r_assoc_fetch(nr_registry_callbacks, name, strlen(name)+1, (void*)&assoc))) { - if (r != R_NOT_FOUND) - ABORT(r); - } - else { - if ((r=compute_cb_id(cb, action, cb_id))) - ABORT(r); - - if ((r=r_assoc_delete(assoc, (char*)cb_id, SIZEOF_CB_ID))) { - if (r != R_NOT_FOUND) - ABORT(r); - } - - if ((r=r_assoc_num_elements(assoc, &size))) - ABORT(r); - - if (size == 0) { - if ((r=r_assoc_delete(nr_registry_callbacks, name, strlen(name)+1))) - ABORT(r); - } - } - - _status=0; - abort: - r_log(NR_LOG_REGISTRY, LOG_DEBUG, "unregister callback %p on '%s' for '%s' %s", cb, name, nr_reg_action_name(action), (_status ? "FAILED" : "succeeded")); - - return(_status); -} - -int compute_cb_id(void *cb, char action, unsigned char cb_id[SIZEOF_CB_ID]) { /* callbacks are identified by the pointer to the cb function plus @@ -415,26 +365,3 @@ NR_reg_register_callback(NR_registry name, char action, void (*cb)(void *cb_arg, abort: return(_status); } - -int -NR_reg_unregister_callback(NR_registry name, char action, void (*cb)(void *cb_arg, char action, NR_registry name)) -{ - int r, _status; - size_t i; - - for (i = 0; i < sizeof(CB_ACTIONS); ++i) { - if (action & CB_ACTIONS[i]) { - if ((r=nr_reg_unregister_callback(name, CB_ACTIONS[i], cb))) - ABORT(r); - - action &= ~(CB_ACTIONS[i]); - } - } - - if (action) - ABORT(R_BAD_ARGS); - - _status=0; - abort: - return(_status); -} diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/hex.c b/dom/media/webrtc/transport/third_party/nrappkit/src/util/hex.c @@ -45,8 +45,6 @@ static char bin2hex_map[][3] = { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff" }; -static int hex2bin_map[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 /* '0' */, 1 /* '1' */, 2 /* '2' */, 3 /* '3' */, 4 /* '4' */, 5 /* '5' */, 6 /* '6' */, 7 /* '7' */, 8 /* '8' */, 9 /* '9' */, -1, -1, -1, -1, -1, -1, -1, 10 /* 'A' */, 11 /* 'B' */, 12 /* 'C' */, 13 /* 'D' */, 14 /* 'E' */, 15 /* 'F' */, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10 /* 'a' */, 11 /* 'b' */, 12 /* 'c' */, 13 /* 'd' */, 14 /* 'e' */, 15 /* 'f' */, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; - int nr_nbin2hex(UCHAR *bin, size_t binlen, char hex[], size_t size, size_t *len) { @@ -72,38 +70,3 @@ nr_nbin2hex(UCHAR *bin, size_t binlen, char hex[], size_t size, size_t *len) abort: return(_status); } - - -int -nr_nhex2bin(char *hex, size_t hexlen, UCHAR bin[], size_t size, size_t *len) -{ - int _status; - size_t binlen; - int h1; - int h2; - size_t i; - - if (hexlen % 2) - ABORT(R_BAD_ARGS); - - binlen = hexlen/2; - - if (size < binlen) - ABORT(R_BAD_ARGS); - - for (i = 0; i < binlen; ++i) { - h1 = hex2bin_map[(int)*hex++]; - h2 = hex2bin_map[(int)*hex++]; - - if (h1 == -1 || h2 == -1) - ABORT(R_BAD_ARGS); - - bin[i] = (h1 << 4) | h2; - } - - *len = binlen; - - _status=0; - abort: - return(_status); -} diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/hex.h b/dom/media/webrtc/transport/third_party/nrappkit/src/util/hex.h @@ -41,7 +41,6 @@ #define _hex_h int nr_nbin2hex(UCHAR *bin, size_t binlen, char hex[], size_t size, size_t *len); -int nr_nhex2bin(char *hex, size_t hexlen, UCHAR bin[], size_t size, size_t *len); #endif diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_assoc.c b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_assoc.c @@ -117,7 +117,6 @@ struct r_assoc_ { static int destroy_assoc_chain(r_assoc_el *chain); static int r_assoc_fetch_bucket(r_assoc *assoc, char *key,int len,r_assoc_el **bucketp); -static int copy_assoc_chain(r_assoc_el **knewp, r_assoc_el *old); int r_assoc_create( r_assoc **assocp, @@ -185,56 +184,6 @@ static int destroy_assoc_chain(r_assoc_el *chain) return(0); } -static int copy_assoc_chain(r_assoc_el **knewp, r_assoc_el *old) - { - r_assoc_el *knew = 0, *ptr = 0, *tmp = 0; - int r,_status; - - ptr=0; /* Pacify GCC's uninitialized warning. - It's not correct */ - if(!old) { - *knewp=0; - return(0); - } - for(;old;old=old->next){ - if(!(tmp=(r_assoc_el *)RCALLOC(sizeof(r_assoc_el)))) - ABORT(R_NO_MEMORY); - - if(!knew){ - knew=tmp; - ptr=knew; - } - else{ - ptr->next=tmp; - tmp->prev=ptr; - ptr=tmp; - } - - ptr->destroy=old->destroy; - ptr->copy=old->copy; - - if(old->copy){ - if(r=old->copy(&ptr->data,old->data)) - ABORT(r); - } - else - ptr->data=old->data; - - if(!(ptr->key=(char *)RMALLOC(old->key_len))) - ABORT(R_NO_MEMORY); - memcpy(ptr->key,old->key,ptr->key_len=old->key_len); - } - - *knewp=knew; - - _status=0; - abort: - if(_status){ - destroy_assoc_chain(knew); - } - return(_status); - } - static int r_assoc_fetch_bucket( r_assoc *assoc, char *key, @@ -329,70 +278,6 @@ int r_assoc_insert( return(_status); } -int r_assoc_delete(r_assoc *assoc, char *key, int len) - { - int r; - r_assoc_el *bucket = 0; - UINT4 hash_value; - - if(r=r_assoc_fetch_bucket(assoc,key,len,&bucket)){ - if(r!=R_NOT_FOUND) - ERETURN(r); - return(r); - } - - /* Now remove the element from the hash chain */ - if(bucket->prev){ - bucket->prev->next=bucket->next; - } - else { - hash_value=assoc->hash_func(key,len,assoc->bits); - assoc->chains[hash_value]=bucket->next; - } - - if(bucket->next) - bucket->next->prev=bucket->prev; - - /* Remove the data */ - if(bucket->destroy) - bucket->destroy(bucket->data); - - RFREE(bucket->key); - RFREE(bucket); - assoc->num_elements--; - - return(0); - } - -int r_assoc_copy(r_assoc **knewp, r_assoc *old) - { - int r,_status,i; - r_assoc *knew = 0; - - if(!(knew=(r_assoc *)RCALLOC(sizeof(r_assoc)))) - ABORT(R_NO_MEMORY); - knew->size=old->size; - knew->bits=old->bits; - knew->hash_func=old->hash_func; - - if(!(knew->chains=(r_assoc_el **)RCALLOC(sizeof(r_assoc_el)*old->size))) - ABORT(R_NO_MEMORY); - for(i=0;i<knew->size;i++){ - if(r=copy_assoc_chain(knew->chains+i,old->chains[i])) - ABORT(r); - } - knew->num_elements=old->num_elements; - - *knewp=knew; - - _status=0; - abort: - if(_status){ - r_assoc_destroy(&knew); - } - return(_status); - } - int r_assoc_num_elements(r_assoc *assoc,int *sizep) { *sizep=assoc->num_elements; @@ -485,20 +370,6 @@ int r_assoc_iter_delete(r_assoc_iterator *iter) } -/*This is a hack from AMS. Supposedly, it's pretty good for strings, even - though it doesn't take into account all the data*/ -int r_assoc_simple_hash_compute(char *key, int len, int bits) - { - UINT4 h=0; - - h=key[0] +(key[len-1] * len); - - h &= (1<<bits) - 1; - - return(h); - } - - int r_crc32(char *data,int len,UINT4 *crcval); int r_assoc_crc32_hash_compute(char *data, int len, int bits) diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_assoc.h b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_assoc.h @@ -100,11 +100,8 @@ int r_assoc_insert(r_assoc *assoc,char *key,int len, #define R_ASSOC_NEW 0x2 int r_assoc_fetch(r_assoc *assoc,char *key, int len, void **value); -int r_assoc_delete(r_assoc *assoc,char *key, int len); -int r_assoc_copy(r_assoc **knew,r_assoc *old); int r_assoc_destroy(r_assoc **assocp); -int r_assoc_simple_hash_compute(char *key, int len,int bits); int r_assoc_crc32_hash_compute(char *key, int len,int bits); /*We need iterators, but I haven't written them yet*/ diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_data.c b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_data.c @@ -109,20 +109,6 @@ int r_data_create(Data **dp, const UCHAR *d, size_t l) return(_status); } - -int r_data_alloc_mem(Data *d, size_t l) - { - int _status; - - if(!(d->data=(UCHAR *)RMALLOC(l))) - ABORT(R_NO_MEMORY); - d->len=l; - - _status=0; - abort: - return(_status); - } - int r_data_alloc(Data **dp, size_t l) { Data *d_=0; @@ -169,37 +155,6 @@ int r_data_destroy(Data **dp) return(0); } -int r_data_destroy_v(void *v) - { - Data *d = 0; - - if(!v) - return(0); - - d=(Data *)v; - r_data_zfree(d); - - RFREE(d); - - return(0); - } - -int r_data_destroy_vp(void **v) - { - Data *d = 0; - - if(!v || !*v) - return(0); - - d=(Data *)*v; - r_data_zfree(d); - - *v=0; - RFREE(d); - - return(0); - } - int r_data_copy(Data *dst, Data *src) { if(!(dst->data=(UCHAR *)RMALLOC(src->len))) @@ -218,12 +173,3 @@ int r_data_zfree(Data *d) RFREE(d->data); return(0); } - -int r_data_compare(Data *d1, Data *d2) - { - if(d1->len<d2->len) - return(-1); - if(d2->len<d1->len) - return(-1); - return(memcmp(d1->data,d2->data,d1->len)); - } diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_data.h b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_data.h @@ -92,13 +92,9 @@ typedef struct Data_ { int r_data_create(Data **dp,const UCHAR *d,size_t l); int r_data_alloc(Data **dp, size_t l); int r_data_make(Data *dp, const UCHAR *d,size_t l); -int r_data_alloc_mem(Data *d,size_t l); int r_data_destroy(Data **dp); -int r_data_destroy_v(void *v); -int r_data_destroy_vp(void **vp); int r_data_copy(Data *dst,Data *src); int r_data_zfree(Data *d); -int r_data_compare(Data *d1,Data *d2); #define INIT_DATA(a,b,c) (a).data=b; (a).len=c #define ATTACH_DATA(a,b) (a).data=b; (a).len=sizeof(b) diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_errors.c b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_errors.c @@ -91,19 +91,6 @@ static struct { char *str; } errors[] = NR_ERROR_MAPPING; -int nr_verr_exit(char *fmt,...) - { - va_list ap; - - va_start(ap,fmt); - vfprintf(stderr,fmt,ap); - - if (fmt[0] != '\0' && fmt[strlen(fmt)-1] != '\n') - fprintf(stderr,"\n"); - - exit(1); - } - char * nr_strerror(int errnum) { diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_errors.h b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_errors.h @@ -118,8 +118,6 @@ { R_RETRY, "Retry may be possible" },\ } -int nr_verr_exit(char *fmt,...); - char *nr_strerror(int errnum); int nr_strerror_r(int errnum, char *strerrbuf, size_t buflen); diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_memory.c b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_memory.c @@ -115,33 +115,6 @@ void r_free(void *ptr) free(chunk); } -void *r_realloc(void *ptr, size_t size) - { - r_malloc_chunk *chunk = 0, *nchunk = 0; - size_t total; - - if(!ptr) return(r_malloc(255,size)); - - chunk=(r_malloc_chunk *)GET_CHUNK_ADDR_FROM_MEM_ADDR(ptr); -#ifdef SANITY_CHECKS - assert(chunk->hdr==HDR_FLAG); -#endif - - total=size + sizeof(r_malloc_chunk); - - if(!(nchunk=realloc(chunk,total))) - return(0); - - mem_usage-=CHUNK_SIZE(nchunk->size); - mem_stats[nchunk->type]-=nchunk->size; - - nchunk->size=size; - mem_usage+=CHUNK_SIZE(nchunk->size); - mem_stats[nchunk->type]+=nchunk->size; - - return(nchunk->memory); - } - char *r_strdup(const char *str) { int len; @@ -160,28 +133,3 @@ char *r_strdup(const char *str) return(nstr); } -int r_mem_get_usage(UINT4 *usagep) - { - *usagep=mem_usage; - - return(0); - } - -int r_memory_dump_stats() - { - int i; - - printf("Total memory usage: %d\n",mem_usage); - printf("Memory usage by bucket\n"); - for(i=0;i<256;i++){ - if(mem_stats[i]){ - printf("%d\t%d\n",i,mem_stats[i]); - } - } - return(0); - } - -void *r_malloc_compat(size_t size) - { - return(r_malloc(255,size)); - } diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_memory.h b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_memory.h @@ -45,13 +45,9 @@ #include "r_types.h" void *r_malloc(int type, size_t size); -void *r_malloc_compat(size_t size); void *r_calloc(int type,size_t number,size_t size); void r_free (void *ptr); -void *r_realloc(void *ptr,size_t size); char *r_strdup(const char *str); -int r_mem_get_usage(UINT4 *usage); -int r_memory_dump_stats(void); #ifdef NO_MALLOC_REPLACE diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_time.c b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_time.c @@ -113,26 +113,6 @@ int r_timeval_diff( return(0); } -int r_timeval_add(struct timeval *t1, struct timeval *t2, struct timeval *sum) - { - long tv_sec,tv_usec,d; - - tv_sec=t1->tv_sec + t2->tv_sec; - - d=t1->tv_usec + t2->tv_usec; - if(d>1000000){ - tv_sec++; - tv_usec=d-1000000; - } - else{ - tv_usec=d; - } - - sum->tv_sec=tv_sec; - sum->tv_usec=tv_usec; - - return(0); - } int r_timeval_cmp(struct timeval *t1, struct timeval *t2) { diff --git a/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_time.h b/dom/media/webrtc/transport/third_party/nrappkit/src/util/libekr/r_time.h @@ -92,7 +92,6 @@ #endif int r_timeval_diff(struct timeval *t1,struct timeval *t0, struct timeval *diff); -int r_timeval_add(struct timeval *t1,struct timeval *t2, struct timeval *sum); int r_timeval_cmp(struct timeval *t1,struct timeval *t2); UINT8 r_timeval2int(struct timeval *tv);