Changes in / [969:6808de455810:966:8862d9dece66] in freeDiameter
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/libfdcore.h
r968 r947 385 385 int fd_peer_get_state(struct peer_hdr *peer); 386 386 387 /*388 * FUNCTION: fd_peer_get_load_pending389 *390 * PARAMETERS:391 * peer : The peer which load to read392 *393 * DESCRIPTION:394 * Returns the current number of requests sent to this peer395 * that have not been answered yet. This is an empirical indication396 * of the workload of this peer.397 *398 * RETURN VALUE:399 * 0 : The load parameter has been updated. (it should have a positive value always)400 * !0 : An error occurred401 */402 int fd_peer_get_load_pending(struct peer_hdr *peer, int * load);403 404 387 /* 405 388 * FUNCTION: fd_peer_validate_register -
libfdcore/fdcore-internal.h
r938 r928 126 126 struct fd_list srs; /* requests ordered by hop-by-hop id */ 127 127 struct fd_list exp; /* requests that have a timeout set, ordered by timeout */ 128 int cnt; /* number of requests in the srs list */129 128 pthread_mutex_t mtx; /* mutex to protect these lists */ 130 129 pthread_cond_t cnd; /* cond var used by the thread that handles timeouts */ -
libfdcore/fdd.l
r969 r965 52 52 yylloc->first_column = yylloc->last_column + 1; \ 53 53 yylloc->last_column = yylloc->first_column + yyleng - 1; \ 54 fd_log_debug(\54 TRACE_ERROR( \ 55 55 "(%d:%d-%d:%d) matched rule %d, length=%d, txt='%s'\n", \ 56 56 yylloc->first_line, yylloc->first_column, \ -
libfdcore/fdd.y
r969 r965 323 323 { yyerror (&yylloc, conf, "Not enough memory"); YYERROR; } ); 324 324 sprintf(fname, DEFAULT_EXTENSIONS_PATH "/%s", bkp); 325 free(bkp); 325 326 fd = fopen(fname, "r"); 326 if (fd == NULL) { 327 free(fname); 328 fname = bkp; 329 } else { 330 free(bkp); 331 } 332 } 333 if (fd != NULL) { 327 } 328 if (fd == NULL) { 329 int ret = errno; 330 TRACE_ERROR("WARNING: Unable to open extension file %s for reading: %s\nLD_LIBRARY_PATH will be used.\n", fname, strerror(ret)); 331 } else { 334 332 fclose(fd); 335 } /* otherwise, LD_LIBRARY_PATH will be tested by dl_open. 336 This should not give any security issue, otherwise we can add an "else fail" here. */ 333 } 337 334 338 335 /* Try and open the configuration file (optional) */ -
libfdcore/p_sr.c
r938 r837 226 226 *req = NULL; 227 227 fd_list_insert_before(next, &sr->chain); 228 srlist->cnt++;229 228 srl_dump("Saved new request, ", &srlist->srs); 230 229 … … 282 281 /* Unlink */ 283 282 fd_list_unlink(&sr->chain); 284 srlist->cnt--;285 283 fd_list_unlink(&sr->expire); 286 284 *req = sr->req; … … 302 300 struct sentreq * sr = (struct sentreq *)(srlist->srs.next); 303 301 fd_list_unlink(&sr->chain); 304 srlist->cnt--;305 302 fd_list_unlink(&sr->expire); 306 303 if (fd_msg_is_routable(sr->req)) { -
libfdcore/peers.c
r968 r961 257 257 } 258 258 259 /* Return the value of srlist->cnt */260 int fd_peer_get_load_pending(struct peer_hdr *peer, int * load)261 {262 struct fd_peer * p = (struct fd_peer *)peer;263 TRACE_ENTRY("%p %p", peer, load);264 CHECK_PARAMS(CHECK_PEER(peer) && load);265 266 CHECK_POSIX( pthread_mutex_lock(&p->p_sr.mtx) );267 *load = p->p_sr.cnt;268 CHECK_POSIX( pthread_mutex_unlock(&p->p_sr.mtx) );269 270 return 0;271 }272 273 274 259 /* Destroy a structure once cleanups have been performed (fd_psm_abord, ...) */ 275 260 int fd_peer_free(struct fd_peer ** ptr) … … 410 395 } 411 396 412 fd_log_debug("> %s\t%s \t[%dsr]", STATE_STR(fd_peer_getstate(peer)), peer->p_hdr.info.pi_diamid, peer->p_sr.cnt);397 fd_log_debug("> %s\t%s", STATE_STR(fd_peer_getstate(peer)), peer->p_hdr.info.pi_diamid); 413 398 if (details > INFO) { 414 399 fd_log_debug("\t(rlm:%s)", peer->p_hdr.info.runtime.pir_realm ?: "<unknown>");
Note: See TracChangeset
for help on using the changeset viewer.