Changeset 5980
- Timestamp:
- May 9, 2019 4:35:41 AM (5 years ago)
- Location:
- pjproject/trunk/pjlib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/pool.h
r5533 r5980 178 178 static void my_perror(const char *title, pj_status_t status) 179 179 { 180 char errmsg[PJ_ERR_MSG_SIZE]; 181 182 pj_strerror(status, errmsg, sizeof(errmsg)); 183 PJ_LOG(1,(THIS_FILE, "%s: %s [status=%d]", title, errmsg, status)); 180 PJ_PERROR(1,(THIS_FILE, status, title)); 184 181 } 185 182 -
pjproject/trunk/pjlib/src/pj/ioqueue_select.c
r5849 r5980 751 751 status = pj_sock_getsockname(old_sock, &local_addr, &addr_len); 752 752 if (status != PJ_SUCCESS) { 753 PJ_ LOG(5,(THIS_FILE, "Error get socket name %d", status));753 PJ_PERROR(5,(THIS_FILE, status, "Error get socket name")); 754 754 continue; 755 755 } … … 758 758 status = pj_sock_getpeername(old_sock, &rem_addr, &addr_len); 759 759 if (status != PJ_SUCCESS) { 760 PJ_ LOG(5,(THIS_FILE, "Error get peer name %d", status));760 PJ_PERROR(5,(THIS_FILE, status, "Error get peer name")); 761 761 } else { 762 762 flags |= HAS_PEER_ADDR; … … 767 767 status == PJ_STATUS_FROM_OS(EINVAL)) 768 768 { 769 PJ_ LOG(5,(THIS_FILE, "Error get qos param %d", status));769 PJ_PERROR(5,(THIS_FILE, status, "Error get qos param")); 770 770 continue; 771 771 } 772 772 773 773 if (status != PJ_SUCCESS) { 774 PJ_ LOG(5,(THIS_FILE, "Error get qos param %d", status));774 PJ_PERROR(5,(THIS_FILE, status, "Error get qos param")); 775 775 } else { 776 776 flags |= HAS_QOS; … … 782 782 status = pj_sock_close(old_sock); 783 783 if (status != PJ_SUCCESS) { 784 PJ_ LOG(5,(THIS_FILE, "Error closing socket %d", status));784 PJ_PERROR(5,(THIS_FILE, status, "Error closing socket")); 785 785 } 786 786 … … 792 792 &new_sock); 793 793 if (status != PJ_SUCCESS) { 794 PJ_ LOG(5,(THIS_FILE, "Error create socket %d", status));794 PJ_PERROR(5,(THIS_FILE, status, "Error create socket")); 795 795 continue; 796 796 } … … 805 805 status == PJ_STATUS_FROM_OS(EINVAL)) 806 806 { 807 PJ_LOG(5,(THIS_FILE, "Error set socket option %d", 808 status)); 807 PJ_PERROR(5,(THIS_FILE, status, "Error set socket option")); 809 808 continue; 810 809 } … … 826 825 status = pj_sock_set_qos_params(new_sock, &qos_params); 827 826 if (status == PJ_STATUS_FROM_OS(EINVAL)) { 828 PJ_ LOG(5,(THIS_FILE, "Error set qos param %d", status));827 PJ_PERROR(5,(THIS_FILE, status, "Error set qos param")); 829 828 continue; 830 829 } … … 834 833 status = pj_sock_connect(new_sock, &rem_addr, addr_len); 835 834 if (status != PJ_SUCCESS) { 836 PJ_ LOG(5,(THIS_FILE, "Error connect socket %d", status));835 PJ_PERROR(5,(THIS_FILE, status, "Error connect socket")); 837 836 continue; 838 837 } … … 889 888 890 889 h->fd = PJ_INVALID_SOCKET; 891 PJ_PERROR(1,(THIS_FILE, status, "Error replacing socket [%d]", status));890 PJ_PERROR(1,(THIS_FILE, status, "Error replacing socket %d", old_sock)); 892 891 pj_lock_release(h->ioqueue->lock); 893 892 return PJ_ESOCKETSTOP; -
pjproject/trunk/pjlib/src/pj/ssl_sock_imp_common.c
r5975 r5980 226 226 /* Handshake failed in accepting, destroy our self silently. */ 227 227 228 char errmsg[PJ_ERR_MSG_SIZE];229 228 char buf[PJ_INET6_ADDRSTRLEN+10]; 230 229 231 pj_strerror(status, errmsg, sizeof(errmsg)); 232 PJ_LOG(3,(ssock->pool->obj_name, "Handshake failed in accepting " 233 "%s: %s", 234 pj_sockaddr_print(&ssock->rem_addr, buf, sizeof(buf), 3), 235 errmsg)); 230 PJ_PERROR(3,(ssock->pool->obj_name, status, 231 "Handshake failed in accepting %s", 232 pj_sockaddr_print(&ssock->rem_addr, buf, 233 sizeof(buf), 3))); 236 234 237 235 if (ssock->param.cb.on_accept_complete2) { … … 251 249 if (ssock->param.timer_heap) { 252 250 pj_time_val interval = {0, PJ_SSL_SOCK_DELAYED_CLOSE_TIMEOUT}; 251 pj_status_t status1; 253 252 254 253 ssock->ssl_state = SSL_STATE_NULL; … … 261 260 ssock->timer.id = TIMER_CLOSE; 262 261 pj_time_val_normalize(&interval); 263 if (pj_timer_heap_schedule(ssock->param.timer_heap, 264 &ssock->timer, &interval) != 0) 265 { 266 PJ_LOG(3,(ssock->pool->obj_name, "Failed to schedule " 267 "a delayed close. Race condition may occur.")); 262 status1 = pj_timer_heap_schedule(ssock->param.timer_heap, 263 &ssock->timer, &interval); 264 if (status1 != PJ_SUCCESS) { 265 PJ_PERROR(3,(ssock->pool->obj_name, status, 266 "Failed to schedule a delayed close. " 267 "Race condition may occur.")); 268 268 ssock->timer.id = TIMER_NONE; 269 269 pj_ssl_sock_close(ssock); -
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r5941 r5980 804 804 status = GET_SSL_STATUS(ssock); 805 805 if (cert->CA_file.slen) { 806 PJ_ LOG(1,(ssock->pool->obj_name,807 808 806 PJ_PERROR(1,(ssock->pool->obj_name, status, 807 "Error loading CA list file '%s'", 808 cert->CA_file.ptr)); 809 809 } 810 810 if (cert->CA_path.slen) { 811 PJ_ LOG(1,(ssock->pool->obj_name,812 813 811 PJ_PERROR(1,(ssock->pool->obj_name, status, 812 "Error loading CA path '%s'", 813 cert->CA_path.ptr)); 814 814 } 815 815 SSL_CTX_free(ctx); … … 833 833 if(rc != 1) { 834 834 status = GET_SSL_STATUS(ssock); 835 PJ_LOG(1,(ssock->pool->obj_name, "Error loading certificate " 836 "chain file '%s'", cert->cert_file.ptr)); 835 PJ_PERROR(1,(ssock->pool->obj_name, status, 836 "Error loading certificate chain file '%s'", 837 cert->cert_file.ptr)); 837 838 SSL_CTX_free(ctx); 838 839 return status; … … 849 850 if(rc != 1) { 850 851 status = GET_SSL_STATUS(ssock); 851 PJ_LOG(1,(ssock->pool->obj_name, "Error adding private key " 852 "from '%s'", cert->privkey_file.ptr)); 852 PJ_PERROR(1,(ssock->pool->obj_name, status, 853 "Error adding private key from '%s'", 854 cert->privkey_file.ptr)); 853 855 SSL_CTX_free(ctx); 854 856 return status; … … 892 894 if (rc != 1) { 893 895 status = GET_SSL_STATUS(ssock); 894 PJ_ LOG(1, (ssock->pool->obj_name, "Error loading "895 "chain certificate from buffer"));896 PJ_PERROR(1,(ssock->pool->obj_name, status, 897 "Error loading chain certificate from buffer")); 896 898 X509_free(xcert); 897 899 BIO_free(cbio); … … 940 942 if (rc != 1) { 941 943 status = GET_SSL_STATUS(ssock); 942 PJ_ LOG(1, (ssock->pool->obj_name, "Error adding "943 "private key from buffer"));944 PJ_PERROR(1,(ssock->pool->obj_name, status, 945 "Error adding private key from buffer")); 944 946 EVP_PKEY_free(pkey); 945 947 BIO_free(kbio); … … 1004 1006 "Additional certificate '%s' loaded.", cf)); 1005 1007 } else { 1006 pj_perror(1,ssock->pool->obj_name, GET_SSL_STATUS(ssock),1007 "Error loading certificate file '%s'", cf);1008 PJ_PERROR(1,(ssock->pool->obj_name, GET_SSL_STATUS(ssock), 1009 "Error loading certificate file '%s'", cf)); 1008 1010 ERR_clear_error(); 1009 1011 } … … 1306 1308 static void set_entropy(pj_ssl_sock_t *ssock) 1307 1309 { 1308 int ret ;1310 int ret = 0; 1309 1311 1310 1312 switch (ssock->param.entropy_type) { … … 1324 1326 break; 1325 1327 case PJ_SSL_ENTROPY_NONE: 1326 default: 1327 return; 1328 default: 1328 1329 break; 1329 1330 } 1330 1331 1331 1332 if (ret < 0) { 1332 PJ_LOG(3, (ssock->pool->obj_name, "SSL failed to reseed with " 1333 "entropy type %d", 1334 ssock->param.entropy_type)); 1333 PJ_LOG(3, (ssock->pool->obj_name, 1334 "SSL failed to reseed with entropy type %d " 1335 "[native err=%d]", 1336 ssock->param.entropy_type, ret)); 1335 1337 } 1336 1338 }
Note: See TracChangeset
for help on using the changeset viewer.