From 929eaa0776c8d167a45a527052e4df7e25e16da7 Mon Sep 17 00:00:00 2001 From: fanasina Date: Tue, 2 Sep 2025 23:16:53 +0200 Subject: [PATCH] y_socket: debug recevefrom --- y_socket_t/src/y_socket_t/y_file_handler.c | 5 +++-- y_socket_t/src/y_socket_t/y_socket_t.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/y_socket_t/src/y_socket_t/y_file_handler.c b/y_socket_t/src/y_socket_t/y_file_handler.c index 39b9106..cfb71ec 100644 --- a/y_socket_t/src/y_socket_t/y_file_handler.c +++ b/y_socket_t/src/y_socket_t/y_file_handler.c @@ -33,9 +33,10 @@ void y_send_post_file_to_all_nodes(void *arg){ #endif int c_af; // char host[NI_MAXHOST], service[NI_MAXSERV]; - char buf_send[BUF_SIZE+1]; + char buf_send[BUF_SIZE+1]={0}; int fd_file; int retsprintf = sprintf(buf_send,"post file %s", filename ); + printf("debug: buf_send=%s, size=%d\n",buf_send, retsprintf); for(struct list_y_NODE_T *local_list_current = nodes->begin_list; local_list_current; local_list_current=local_list_current->next ){ //memset(tempAddr, 0, BUF_SIZE+1); @@ -78,7 +79,7 @@ void y_send_post_file_to_all_nodes(void *arg){ #endif }else{ #if TEMP_ADDR - printf("debug: sending response to < %s >",tempAddr); + printf("debug: sending %s to < %s >",buf_send,tempAddr); #endif } } diff --git a/y_socket_t/src/y_socket_t/y_socket_t.c b/y_socket_t/src/y_socket_t/y_socket_t.c index f986909..4a74623 100644 --- a/y_socket_t/src/y_socket_t/y_socket_t.c +++ b/y_socket_t/src/y_socket_t/y_socket_t.c @@ -365,7 +365,7 @@ void* y_socket_handler_(void *arg){ char filename[BUF_SIZE]; strcpy(filename, buf + 9); - + printf("debug: receve_from_node : file: %s\n",filename); receve_from_node(fds, filename, strlen(filename)); /* pthread_mutex_lock(sock->mut_go_on);