Revision 1638
| trunk/nntpgrab_core/download_thread.c (revision 1638) | ||
|---|---|---|
| 364 | 364 | 
                  /* Guard against read timeouts */  | 
              
| 365 | 365 | 
                                  if (conn->last_activity_stamp + 30 < curr_time) {
                 | 
              
| 366 | 366 | 
                  /* No activity happened in the last 30 seconds, disconnect from the server */  | 
              
| 367 | 
                  disconnect_socket(&active_connections, &active_connection_polls, &num_active_connections, conn->poll_fd, DISCONNECT_NORMAL, NULL, __LINE__);  | 
              |
| 367 | 
                  disconnect_socket(&active_connections, &active_connection_polls, &num_active_connections, conn->poll_fd, DISCONNECT_READ_TIMEOUT, NULL, __LINE__);  | 
              |
| 368 | 368 | 
                   | 
              
| 369 | 369 | 
                  /* This socket is ready for re-use, so try again directly */  | 
              
| 370 | 370 | 
                  continue;  | 
              
| trunk/nntpgrab_core/nntpconnection.c (revision 1638) | ||
|---|---|---|
| 434 | 434 | 
                  conn->recv_buffer_length = 0;  | 
              
| 435 | 435 | 
                  }  | 
              
| 436 | 436 | 
                   | 
              
| 437 | 
                      if (!perform_recv(conn, &try_again) && (!try_again || conn->recv_buffer_length == 0)) {
                 | 
              |
| 438 | 
                  return FALSE;  | 
              |
| 437 | 
                  /* Only read from the socket when there's no newline in the buffer or when we need  | 
              |
| 438 | 
                  * to read raw data which is already buffered */  | 
              |
| 439 | 
                  if ((!read_line) ||  | 
              |
| 440 | 
                          (read_line && !strstr(conn->recv_buffer, "\n"))) {
                 | 
              |
| 441 | 
                   | 
              |
| 442 | 
                          if (!perform_recv(conn, &try_again) && (!try_again || conn->recv_buffer_length == 0)) {
                 | 
              |
| 443 | 
                  return FALSE;  | 
              |
| 444 | 
                  }  | 
              |
| 439 | 445 | 
                  }  | 
              
| 440 | 446 | 
                   | 
              
| 447 | 
                  g_return_val_if_fail(conn->recv_buffer_length > 0, FALSE);  | 
              |
| 448 | 
                   | 
              |
| 441 | 449 | 
                      if (read_line) {
                 | 
              
| 442 | 450 | 
                  char *newline = strstr(conn->recv_buffer, "\n");  | 
              
| 443 | 451 | 
                   | 
              
| trunk/ChangeLog (revision 1638) | ||
|---|---|---|
| 13 | 13 | 
                  This should also lower the possibility of the error message 'No hostname could be found for servername x' from occuring  | 
              
| 14 | 14 | 
                  - Automatically retry connecting to usenet servers when a connection error has occured  | 
              
| 15 | 15 | 
                  This should fix a bug where the download queue could hang when the network connection is unstable  | 
              
| 16 | 
                  - Very small files could get stuck in the download queue. Fixed  | 
              |
| 16 | 17 | 
                  - In a rare situation, the program could deadlock while trying to remove a file from the download queue. Fixed  | 
              
| 17 | 18 | 
                  - Really disable activating the automatic import on Mac OS X  | 
              
| 18 | 19 | 
                  - Don't use g_module_close() on Win32/Win64 as it causes a crash when the program is shut down  | 
              
| branches/nntpgrab-0.6/nntpgrab_core/download_thread.c (revision 1638) | ||
|---|---|---|
| 364 | 364 | 
                  /* Guard against read timeouts */  | 
              
| 365 | 365 | 
                                  if (conn->last_activity_stamp + 30 < curr_time) {
                 | 
              
| 366 | 366 | 
                  /* No activity happened in the last 30 seconds, disconnect from the server */  | 
              
| 367 | 
                  disconnect_socket(&active_connections, &active_connection_polls, &num_active_connections, conn->poll_fd, DISCONNECT_NORMAL, NULL, __LINE__);  | 
              |
| 367 | 
                  disconnect_socket(&active_connections, &active_connection_polls, &num_active_connections, conn->poll_fd, DISCONNECT_READ_TIMEOUT, NULL, __LINE__);  | 
              |
| 368 | 368 | 
                   | 
              
| 369 | 369 | 
                  /* This socket is ready for re-use, so try again directly */  | 
              
| 370 | 370 | 
                  continue;  | 
              
| branches/nntpgrab-0.6/nntpgrab_core/nntpconnection.c (revision 1638) | ||
|---|---|---|
| 432 | 432 | 
                  conn->recv_buffer_length = 0;  | 
              
| 433 | 433 | 
                  }  | 
              
| 434 | 434 | 
                   | 
              
| 435 | 
                      if (!perform_recv(conn, &try_again) && (!try_again || conn->recv_buffer_length == 0)) {
                 | 
              |
| 436 | 
                  return FALSE;  | 
              |
| 435 | 
                  /* Only read from the socket when there's no newline in the buffer or when we need  | 
              |
| 436 | 
                  * to read raw data which is already buffered */  | 
              |
| 437 | 
                  if ((!read_line) ||  | 
              |
| 438 | 
                          (read_line && !strstr(conn->recv_buffer, "\n"))) {
                 | 
              |
| 439 | 
                   | 
              |
| 440 | 
                          if (!perform_recv(conn, &try_again) && (!try_again || conn->recv_buffer_length == 0)) {
                 | 
              |
| 441 | 
                  return FALSE;  | 
              |
| 442 | 
                  }  | 
              |
| 437 | 443 | 
                  }  | 
              
| 438 | 444 | 
                   | 
              
| 445 | 
                  g_return_val_if_fail(conn->recv_buffer_length > 0, FALSE);  | 
              |
| 446 | 
                   | 
              |
| 439 | 447 | 
                      if (read_line) {
                 | 
              
| 440 | 448 | 
                  char *newline = strstr(conn->recv_buffer, "\n");  | 
              
| 441 | 449 | 
                   | 
              
| branches/nntpgrab-0.6/ChangeLog (revision 1638) | ||
|---|---|---|
| 13 | 13 | 
                  This should also lower the possibility of the error message 'No hostname could be found for servername x' from occuring  | 
              
| 14 | 14 | 
                  - Automatically retry connecting to usenet servers when a connection error has occured  | 
              
| 15 | 15 | 
                  This should fix a bug where the download queue could hang when the network connection is unstable  | 
              
| 16 | 
                  - Very small files could get stuck in the download queue. Fixed  | 
              |
| 16 | 17 | 
                  - In a rare situation, the program could deadlock while trying to remove a file from the download queue. Fixed  | 
              
| 17 | 18 | 
                  - Really disable activating the automatic import on Mac OS X  | 
              
| 18 | 19 | 
                  - Don't use g_module_close() on Win32/Win64 as it causes a crash when the program is shut down  | 
              
Also available in: Unified diff
NNTPGrab

