File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ static TDS_THREAD_PROC_DECLARE(fake_thread_proc, arg)
9999 perror ("accept" );
100100 exit (1 );
101101 }
102+ printf ("Got connection\n" );
102103 tds_mutex_lock (& mtx );
103104 fake_sock = sock ;
104105 tds_mutex_unlock (& mtx );
@@ -111,16 +112,20 @@ static TDS_THREAD_PROC_DECLARE(fake_thread_proc, arg)
111112 fd .events = POLLIN ;
112113 fd .revents = 0 ;
113114 if (poll (& fd , 1 , 30000 ) <= 0 ) {
114- fprintf (stderr , "poll: %d\n" , sock_errno );
115+ fprintf (stderr , "XXX poll: %d\n" , sock_errno );
115116 exit (1 );
116117 }
117118
118119 /* just read and discard */
119120 len = READSOCKET (sock , buf , sizeof (buf ));
120- if (len == 0 )
121+ if (len == 0 ) {
122+ printf ("No data\n" );
121123 break ;
122- if (len < 0 && sock_errno != TDSSOCK_EINPROGRESS )
124+ }
125+ if (len < 0 && sock_errno != TDSSOCK_EINPROGRESS ) {
126+ printf ("Read error %d\n" , sock_errno );
123127 break ;
128+ }
124129 }
125130 return TDS_THREAD_RESULT (0 );
126131}
@@ -194,6 +199,7 @@ main(void)
194199 odbc_disconnect ();
195200 tds_thread_join (fake_thread , NULL );
196201 tds_mutex_lock (& mtx );
202+ printf ("Closing socket\n" );
197203 CLOSESOCKET (fake_sock );
198204 tds_mutex_unlock (& mtx );
199205
You can’t perform that action at this time.
0 commit comments