@@ -89,7 +89,7 @@ int main()
8989 }
9090
9191 char * data , * sddata ;
92- int n , fd , res , size , sdsize ;
92+ int n , fd , res , size , sdsize , rs ;
9393 struct epoll_ctl_info epci = {epollfd , 0 , 0 };
9494 struct queue * rcqu = NULL , * sdqu = NULL ;
9595 queue_init (& rcqu , QUEUE_CAPACITY );
@@ -146,9 +146,8 @@ int main()
146146 continue ;
147147 }
148148 sdsize = queue_pop_no_copy (sdqu , & sddata );
149- log_trace ("main epoll loop: queue(%d): '%s'" , sdsize , sddata );
150- res = sendall (fd , sddata , & sdsize );
151- if (res != 0 ) {
149+ rs = sendall (fd , sddata , & sdsize );
150+ if (rs != 0 ) {
152151 log_error ("main epoll loop:: failed during sendall function" );
153152 if (fd_poll_del_and_close (& epci ) == -1 ) {
154153 perror ("epoll_ctl: recv 0" );
@@ -163,6 +162,7 @@ int main()
163162 continue ;
164163
165164 // Handle closing request received
165+ log_info ("main epoll loop:: closing connection" );
166166 if (fd_poll_del_and_close (& epci ) == -1 ) {
167167 perror ("epoll_ctl: recv 0" );
168168 exit (EXIT_FAILURE );
0 commit comments