y_socket: debug recevefrom

This commit is contained in:
2025-09-02 23:16:53 +02:00
parent 9649d317a6
commit 929eaa0776
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -33,9 +33,10 @@ void y_send_post_file_to_all_nodes(void *arg){
#endif #endif
int c_af; int c_af;
// char host[NI_MAXHOST], service[NI_MAXSERV]; // char host[NI_MAXHOST], service[NI_MAXSERV];
char buf_send[BUF_SIZE+1]; char buf_send[BUF_SIZE+1]={0};
int fd_file; int fd_file;
int retsprintf = sprintf(buf_send,"post file %s", filename ); 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 ){ 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); //memset(tempAddr, 0, BUF_SIZE+1);
@@ -78,7 +79,7 @@ void y_send_post_file_to_all_nodes(void *arg){
#endif #endif
}else{ }else{
#if TEMP_ADDR #if TEMP_ADDR
printf("debug: sending response to < %s >",tempAddr); printf("debug: sending %s to < %s >",buf_send,tempAddr);
#endif #endif
} }
} }
+1 -1
View File
@@ -365,7 +365,7 @@ void* y_socket_handler_(void *arg){
char filename[BUF_SIZE]; char filename[BUF_SIZE];
strcpy(filename, buf + 9); strcpy(filename, buf + 9);
printf("debug: receve_from_node : file: %s\n",filename);
receve_from_node(fds, filename, strlen(filename)); receve_from_node(fds, filename, strlen(filename));
/* /*
pthread_mutex_lock(sock->mut_go_on); pthread_mutex_lock(sock->mut_go_on);