More log message fixes.
authorJan Janak <jan@iptel.org>
Tue, 30 Mar 2004 16:20:04 +0000 (16:20 +0000)
committerJan Janak <jan@iptel.org>
Tue, 30 Mar 2004 16:20:04 +0000 (16:20 +0000)
modules/tm/t_fifo.c
modules/tm/t_hooks.c
modules/tm/t_lookup.c
modules/tm/t_msgbuilder.c
modules/tm/t_reply.c
modules/tm/t_stats.c
modules/tm/timer.c
modules/tm/tm.c
modules/tm/uac.c
modules/tm/uac_fifo.c
modules/tm/uac_unixsock.c

index 67063c5..50ade5a 100644 (file)
@@ -153,10 +153,10 @@ static int inline write_to_fifo(char *fifo, int cnt )
        if((fd_fifo = open(fifo,O_WRONLY | O_NONBLOCK)) == -1){
                switch(errno){
                        case ENXIO:
-                               LOG(L_ERR,"ERROR:tm:t_write_req: nobody listening on "
+                               LOG(L_ERR,"ERROR:tm:write_to_fifo: nobody listening on "
                                        " [%s] fifo for reading!\n",fifo);
                        default:
-                               LOG(L_ERR,"ERROR:tm:t_write_req: failed to open [%s] "
+                               LOG(L_ERR,"ERROR:tm:write_to_fifo: failed to open [%s] "
                                        "fifo : %s\n", fifo, strerror(errno));
                }
                goto error;
@@ -166,7 +166,7 @@ static int inline write_to_fifo(char *fifo, int cnt )
 repeat:
        if (writev(fd_fifo, (struct iovec*)lines_eol, 2*cnt)<0) {
                if (errno!=EINTR) {
-                       LOG(L_ERR, "ERROR:tm:t_write_req: writev failed: %s\n",
+                       LOG(L_ERR, "ERROR:tm:write_to_fifo: writev failed: %s\n",
                                strerror(errno));
                        close(fd_fifo);
                        goto error;
@@ -176,7 +176,7 @@ repeat:
        }
        close(fd_fifo);
 
-       DBG("DEBUG:tm:t_write_req: write completed\n");
+       DBG("DEBUG:tm:write_to_fifo: write completed\n");
        return 1; /* OK */
 
 error:
index 8ee56d1..868bca2 100644 (file)
@@ -88,7 +88,7 @@ inline int insert_tmcb(struct tmcb_head_list *cb_list, int types,
 
        /* build a new callback structure */
        if (!(cbp=shm_malloc( sizeof( struct tm_callback)))) {
-               LOG(L_ERR, "ERROR:tm:register_tmcb: out of shm. mem\n");
+               LOG(L_ERR, "ERROR:tm:insert_tmcb: out of shm. mem\n");
                return E_OUT_OF_MEM;
        }
 
index 955c1ad..0efbbf3 100644 (file)
@@ -163,11 +163,11 @@ void init_t() {global_msg_id=0; set_t(T_UNDEFINED);}
 static inline int parse_dlg( struct sip_msg *msg )
 {
        if (parse_headers(msg, HDR_FROM | HDR_CSEQ | HDR_TO, 0)==-1) {
-               LOG(L_ERR, "ERROR: tid_matching: From or Cseq or To invalid\n");
+               LOG(L_ERR, "ERROR: parse_dlg: From or Cseq or To invalid\n");
                return 0;
        }
        if (parse_from_header(msg)==-1) {
-               LOG(L_ERR, "ERROR: tid_matching: From broken\n");
+               LOG(L_ERR, "ERROR: parse_dlg: From broken\n");
                return 0;
        }
        /* To is automatically parsed through HDR_TO in parse bitmap,
@@ -308,7 +308,7 @@ static int matching_3261( struct sip_msg *p_msg, struct cell **trans,
                        if (!dlg_parsed) {
                                dlg_parsed=1;
                                if (!parse_dlg(p_msg)) {
-                                       LOG(L_ERR, "ERROR: tid_matching: dlg parsing failed\n");
+                                       LOG(L_ERR, "ERROR: matching_3261: dlg parsing failed\n");
                                        return 0;
                                }
                        }
@@ -536,7 +536,7 @@ struct cell* t_lookupOriginalT(  struct sip_msg* p_msg )
         * comparison of many header fields
         */
        if (!p_msg->via1) {
-               LOG(L_ERR, "ERROR: t_lookup_request: no via\n");
+               LOG(L_ERR, "ERROR: t_lookupOriginalT: no via\n");
                set_t(0);
                return 0;
        }
@@ -1007,7 +1007,7 @@ int t_newtran( struct sip_msg* p_msg )
 
 
        /* is T still up-to-date ? */
-       DBG("DEBUG: t_addifnew: msg id=%d , global msg id=%d ,"
+       DBG("DEBUG: t_newtran: msg id=%d , global msg id=%d ,"
                " T on entrance=%p\n",p_msg->id,global_msg_id,T);
 
        if ( T && T!=T_UNDEFINED  ) {
index 1843d05..e50ba23 100644 (file)
@@ -113,7 +113,7 @@ char *build_local(struct cell *Trans,unsigned int branch,
                &branch_str, 0, Trans->uac[branch].request.dst.proto, &hp );
        if (!via)
        {
-               LOG(L_ERR, "ERROR: t_build_and_send_CANCEL: "
+               LOG(L_ERR, "ERROR: build_local: "
                        "no via header got from builder\n");
                goto error;
        }
@@ -140,7 +140,7 @@ char *build_local(struct cell *Trans,unsigned int branch,
        cancel_buf=shm_malloc( *len+1 );
        if (!cancel_buf)
        {
-               LOG(L_ERR, "ERROR: t_build_and_send_CANCEL: cannot allocate memory\n");
+               LOG(L_ERR, "ERROR: build_local: cannot allocate memory\n");
                goto error01;
        }
        p = cancel_buf;
@@ -548,7 +548,7 @@ static inline int assemble_via(str* dest, struct cell* t, struct socket_info* so
        struct hostport hp;
 
        if (!t_calc_branch(t, branch, branch_buf, &len)) {
-               LOG(L_ERR, "ERROR: build_via: branch calculation failed\n");
+               LOG(L_ERR, "ERROR: assemble_via: branch calculation failed\n");
                return -1;
        }
        
@@ -562,7 +562,7 @@ static inline int assemble_via(str* dest, struct cell* t, struct socket_info* so
        set_hostport(&hp, 0);
        via = via_builder(&via_len, sock, &branch_str, 0, sock->proto, &hp);
        if (!via) {
-               LOG(L_ERR, "build_via: via building failed\n");
+               LOG(L_ERR, "assemble_via: via building failed\n");
                return -2;
        }
        
index 5983130..bc79464 100644 (file)
@@ -175,7 +175,7 @@ int unmatched_totag(struct cell *t, struct sip_msg *ack)
 
        if (parse_headers(ack, HDR_TO,0)==-1 || 
                                !ack->to ) {
-               LOG(L_ERR, "ERROR: ack_totag_set: To invalid\n");
+               LOG(L_ERR, "ERROR: unmatched_totag: To invalid\n");
                return 1;
        }
        tag=&get_to(ack)->tag_value;
@@ -268,7 +268,7 @@ static char *build_ack(struct sip_msg* rpl,struct cell *trans,int branch,
        str to;
 
     if (parse_headers(rpl,HDR_TO, 0)==-1 || !rpl->to ) {
-        LOG(L_ERR, "ERROR: t_build_ACK: "
+        LOG(L_ERR, "ERROR: build_ack: "
             "cannot generate a HBH ACK if key HFs in reply missing\n");
         return NULL;
     }
@@ -334,7 +334,7 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
 
        if (!buf)
        {
-               DBG("DEBUG: t_reply: response building failed\n");
+               DBG("DEBUG: _reply_light: response building failed\n");
                /* determine if there are some branches to be cancelled */
                if ( is_invite(trans) ) {
                        if (lock) LOCK_REPLIES( trans );
@@ -349,7 +349,7 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
        if (lock) LOCK_REPLIES( trans );
        if ( is_invite(trans) ) which_cancel(trans, &cancel_bitmap );
        if (trans->uas.status>=200) {
-               LOG( L_ERR, "ERROR: t_reply: can't generate %d reply"
+               LOG( L_ERR, "ERROR: _reply_light: can't generate %d reply"
                        " when a final %d was sent out\n", code, trans->uas.status);
                goto error2;
        }
@@ -363,7 +363,7 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
        rb->buffer = (char*)shm_resize( rb->buffer, buf_len );
        /* puts the reply's buffer to uas.response */
        if (! rb->buffer ) {
-                       LOG(L_ERR, "ERROR: t_reply: cannot allocate shmem buffer\n");
+                       LOG(L_ERR, "ERROR: _reply_light: cannot allocate shmem buffer\n");
                        goto error3;
        }
        update_local_tags(trans, bm, rb->buffer, buf);
@@ -402,14 +402,14 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
           not yet, don't try to retransmit
        */
        if (!trans->uas.response.dst.send_sock) {
-               LOG(L_ERR, "ERROR: _reply: no resolved dst to send reply to\n");
+               LOG(L_ERR, "ERROR: _reply_light: no resolved dst to send reply to\n");
        } else {
                SEND_PR_BUFFER( rb, buf, len );
                DBG("DEBUG: reply sent out. buf=%p: %.9s..., shmem=%p: %.9s\n", 
                        buf, buf, rb->buffer, rb->buffer );
        }
        pkg_free( buf ) ;
-       DBG("DEBUG: t_reply: finished\n");
+       DBG("DEBUG: _reply_light: finished\n");
        return 1;
 
 error3:
@@ -536,7 +536,7 @@ static inline int fake_req(struct sip_msg *faked_req,
        if (shmem_msg->body_lumps) {
                faked_req->body_lumps=dup_lump_list(shmem_msg->body_lumps);
                if (!faked_req->body_lumps) { /* non_empty->empty ... failure */
-                       LOG(L_ERR, "ERROR: on_negative_handlers: lump dup failed\n");
+                       LOG(L_ERR, "ERROR: fake_req: lump dup failed\n");
                        goto error02;
                }
        }
@@ -707,7 +707,7 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
        /* if final response sent out, allow only INVITE 2xx  */
        if ( Trans->uas.status >= 200 ) {
                if (inv_through) {
-                       DBG("DBG: t_should_relay: 200 INV after final sent\n");
+                       DBG("DBG: t_should_relay_response: 200 INV after final sent\n");
                        *should_store=0;
                        Trans->uac[branch].last_received=new_code;
                        *should_relay=branch;
@@ -734,7 +734,7 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
                }
                /* this looks however how a very strange status rewrite attempt;
                 * report on it */
-               LOG(L_ERR, "ERROR: t_should_relay: status rewrite by UAS: "
+               LOG(L_ERR, "ERROR: t_should_relay_response: status rewrite by UAS: "
                        "stored: %d, received: %d\n",
                        Trans->uac[branch].last_received, new_code );
                goto discard;
@@ -923,7 +923,7 @@ void cleanup_uac_timers( struct cell *t )
                reset_timer( &t->uac[i].request.retr_timer );
                reset_timer( &t->uac[i].request.fr_timer );
        }
-       DBG("DEBUG: cleanup_uacs: RETR/FR timers reset\n");
+       DBG("DEBUG: cleanup_uac_timers: RETR/FR timers reset\n");
 }
 
 static int store_reply( struct cell *trans, int branch, struct sip_msg *rpl)
@@ -1220,7 +1220,7 @@ int reply_received( struct sip_msg  *p_msg )
        msg_status=p_msg->REPLY_STATUS;
 
        uac=&t->uac[branch];
-       DBG("DEBUG: t_on_reply: org. status uas=%d, "
+       DBG("DEBUG: reply_received: org. status uas=%d, "
                "uac[%d]=%d local=%d is_invite=%d)\n",
                t->uas.status, branch, uac->last_received, 
                is_local(t), is_invite(t));
index f0e7366..1e8ecdf 100644 (file)
@@ -162,7 +162,7 @@ int init_tm_stats(void)
 
        tm_stats=shm_malloc(sizeof(struct t_stats));
        if (tm_stats==0) {
-               LOG(L_ERR, "ERROR: init_stats: no mem for stats\n");
+               LOG(L_ERR, "ERROR: init_tm_stats: no mem for stats\n");
                goto error0;
        }
        memset(tm_stats, 0, sizeof(struct t_stats) );
@@ -170,21 +170,21 @@ int init_tm_stats(void)
        size=sizeof(stat_counter)*process_count();
        tm_stats->s_waiting=shm_malloc(size);
        if (tm_stats->s_waiting==0) {
-               LOG(L_ERR, "ERROR: init_stats: no mem for stats\n");
+               LOG(L_ERR, "ERROR: init_tm_stats: no mem for stats\n");
                goto error1;
        }
        memset(tm_stats->s_waiting, 0, size );
 
        tm_stats->s_transactions=shm_malloc(size);
        if (tm_stats->s_transactions==0) {
-               LOG(L_ERR, "ERROR: init_stats: no mem for stats\n");
+               LOG(L_ERR, "ERROR: init_tm_stats: no mem for stats\n");
                goto error2;
        }
        memset(tm_stats->s_transactions, 0, size );
 
        tm_stats->s_client_transactions=shm_malloc(size);
        if (tm_stats->s_client_transactions==0) {
-               LOG(L_ERR, "ERROR: init_stats: no mem for stats\n");
+               LOG(L_ERR, "ERROR: init_tm_stats: no mem for stats\n");
                goto error3;
        }
        memset(tm_stats->s_client_transactions, 0, size );
index 1a661c8..4e3132d 100644 (file)
@@ -350,7 +350,7 @@ inline static void final_response_handler( struct timer_link *fr_tl )
        /* FR for local cancels.... */
        if (r_buf->activ_type==TYPE_LOCAL_CANCEL)
        {
-               DBG("DEBUG: FR_handler: stop retr for Local Cancel\n");
+               DBG("DEBUG: final_response_handler: stop retr for Local Cancel\n");
                return;
        }
 
@@ -359,7 +359,7 @@ inline static void final_response_handler( struct timer_link *fr_tl )
 #              ifdef EXTRA_DEBUG
                if (t->uas.request->REQ_METHOD!=METHOD_INVITE
                        || t->uas.status < 200 ) {
-                       LOG(L_ERR, "ERROR: FR timer: uknown type reply buffer\n");
+                       LOG(L_ERR, "ERROR: final_response_handler: uknown type reply buffer\n");
                        abort();
                }
 #              endif
@@ -393,12 +393,12 @@ inline static void final_response_handler( struct timer_link *fr_tl )
                && has_noisy_ctimer(t);
        if (silent) {
                UNLOCK_REPLIES(t);
-               DBG("DEBUG: FR_handler: transaction silently dropped (%p)\n",t);
+               DBG("DEBUG: final_response_handler: transaction silently dropped (%p)\n",t);
                put_on_wait( t );
                return;
        }
 
-       DBG("DEBUG: FR_handler:stop retr. and send CANCEL (%p)\n", t);
+       DBG("DEBUG: final_response_handler:stop retr. and send CANCEL (%p)\n", t);
        fake_reply(t, r_buf->branch, 408 );
 
        DBG("DEBUG: final_response_handler : done\n");
@@ -497,7 +497,7 @@ void unlink_timer_lists()
        /* unlink the timer lists */
        for( i=0; i<NR_OF_TIMER_LISTS ; i++ )
                reset_timer_list( i );
-       DBG("DEBUG: tm_shutdown : empting DELETE list\n");
+       DBG("DEBUG: unlink_timer_lists : empting DELETE list\n");
        /* deletes all cells from DELETE_LIST list 
           (they are no more accessible from enrys) */
        while (tl!=end) {
@@ -642,7 +642,7 @@ static void add_timer_unsafe( struct timer *timer_list, struct timer_link *tl,
                abort();
        }
 #endif
-       DBG("DEBUG: add_to_tail_of_timer[%d]: %p\n",timer_list->id,tl);
+       DBG("DEBUG: add_timer_unsafe[%d]: %p\n",timer_list->id,tl);
 }
 
 
index 8b5d6be..a8c0b59 100644 (file)
@@ -632,7 +632,7 @@ inline static int _w_t_forward_nonack(struct sip_msg* msg, char* proxy,
                }
                return t_forward_nonack(t, msg, ( struct proxy_l *) proxy, proto );
        } else {
-               DBG("DEBUG: t_forward_nonack: no transaction found\n");
+               DBG("DEBUG: forward_nonack: no transaction found\n");
                return -1;
        }
 }
@@ -773,7 +773,7 @@ inline static int _w_t_relay_to( struct sip_msg  *p_msg ,
                        return -1;
                }
                if (t_forward_nonack(t, p_msg, proxy, PROTO_NONE)<=0 ) {
-                       LOG(L_ERR, "ERROR: failure_route: t_relay_to failed\n");
+                       LOG(L_ERR, "ERROR: w_t_relay_to: t_relay_to failed\n");
                        return -1;
                }
                return 1;
index 5275e7a..765d921 100644 (file)
@@ -91,7 +91,7 @@ int uac_init(void)
         * on no matter the protocol */
        si=bind_address?bind_address:get_first_socket();
        if (si==0){
-               LOG(L_CRIT, "BUG: child_init_callid: null socket list\n");
+               LOG(L_CRIT, "BUG: uac_init: null socket list\n");
                return -1;
        }
 
@@ -320,7 +320,7 @@ int request(str* m, str* ruri, str* to, str* from, str* h, str* b, transaction_c
        generate_fromtag(&fromtag, &callid);
 
        if (new_dlg_uac(&callid, &fromtag, DEFAULT_CSEQ, from, to, &dialog) < 0) {
-               LOG(L_ERR, "req_outside(): Error while creating temorary dialog\n");
+               LOG(L_ERR, "request(): Error while creating temorary dialog\n");
                goto err;
        }
 
index f1db167..5ca49c6 100644 (file)
@@ -77,8 +77,8 @@ struct str_list {
  */
 static inline void fifo_uac_error(char *reply_fifo, int code, char *msg)
 {
-       LOG(L_ERR, "ERROR: fifo_uac: %s\n", msg ); 
-       fifo_reply(reply_fifo, "%d fifo_uac: %s", code, msg);
+       LOG(L_ERR, "ERROR: fifo_uac_error: %s\n", msg ); 
+       fifo_reply(reply_fifo, "%d fifo_uac_error: %s", code, msg);
 }
 
 
@@ -214,7 +214,7 @@ static inline struct str_list *new_str(char *s, int len, struct str_list **last,
        struct str_list *new;
        new=pkg_malloc(sizeof(struct str_list));
        if (!new) {
-               LOG(L_ERR, "ERROR: get_hfblock: not enough mem\n");
+               LOG(L_ERR, "ERROR: new_str: not enough mem\n");
                return 0;
        }
        new->s.s=s;
@@ -269,7 +269,7 @@ static char *get_hfblock(str *uri, struct hdr_field *hf, int *l, int proto)
                                                if (!sock_name) {
                                                        send_sock=uri2sock( uri, &to_su, proto );
                                                        if (!send_sock) {
-                                                               LOG(L_ERR, "ERROR: get_hf_block: send_sock failed\n");
+                                                               LOG(L_ERR, "ERROR: get_hfblock: send_sock failed\n");
                                                                goto error;
                                                        }
                                                        sock_name=&send_sock->address_str;
@@ -297,14 +297,14 @@ static char *get_hfblock(str *uri, struct hdr_field *hf, int *l, int proto)
                /* proceed to next header */
                /* new=new_str(CRLF, CRLF_LEN, &last, &total_len );
                if (!new) goto error; */
-               DBG("DEBUG: get_hf_block: one more hf processed\n");
+               DBG("DEBUG: get_hfblock: one more hf processed\n");
        } /* header loop */
 
 
        /* construct a single header block now */
        ret=pkg_malloc(total_len);
        if (!ret) {
-               LOG(L_ERR, "ERROR: get_hf_block no pkg mem for hf block\n");
+               LOG(L_ERR, "ERROR: get_hfblock no pkg mem for hf block\n");
                goto error;
        }
        i=sl.next;
@@ -498,13 +498,13 @@ static inline int print_uris(FILE* out, struct sip_msg* reply)
        
        dlg = (dlg_t*)shm_malloc(sizeof(dlg_t));
        if (!dlg) {
-               LOG(L_ERR, "print_routes(): No memory left\n");
+               LOG(L_ERR, "print_uris(): No memory left\n");
                return -1;
        }
 
        memset(dlg, 0, sizeof(dlg_t));
        if (dlg_response_uac(dlg, reply) < 0) {
-               LOG(L_ERR, "print_routes(): Error while creating dialog structure\n");
+               LOG(L_ERR, "print_uris(): Error while creating dialog structure\n");
                free_dlg(dlg);
                return -2;
        }
index 81b766f..cb5eb36 100644 (file)
@@ -155,7 +155,7 @@ static int get_body_lines(str* body, str* msg)
                unixsock_reply_send();
                return -1;
        }
-       DBG("get_body: %.*s\n", body->len,  ZSW(body->s));
+       DBG("get_body_lines: %.*s\n", body->len,  ZSW(body->s));
        return 0;
 }
 
@@ -296,7 +296,7 @@ static char *get_hfblock(str *uri, struct hdr_field *hf, int *l, int proto)
                                        if (!sock_name) {
                                                send_sock = uri2sock(uri, &to_su, proto);
                                                if (!send_sock) {
-                                                       LOG(L_ERR, "ERROR: get_hf_block: send_sock failed\n");
+                                                       LOG(L_ERR, "ERROR: get_hfblock: send_sock failed\n");
                                                        goto error;
                                                }
                                                sock_name = &send_sock->address_str;
@@ -317,13 +317,13 @@ static char *get_hfblock(str *uri, struct hdr_field *hf, int *l, int proto)
                                }
                        } /* possible substitute */
                } /* substitution loop */
-               DBG("get_hf_block: one more hf processed\n");
+               DBG("get_hfblock: one more hf processed\n");
        } /* header loop */
        
             /* construct a single header block now */
        ret = pkg_malloc(total_len);
        if (!ret) {
-               LOG(L_ERR, "get_hf_block: no pkg mem for hf block\n");
+               LOG(L_ERR, "get_hfblock: no pkg mem for hf block\n");
                goto error;
        }
        i = sl.next;