projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Include the Privoxy version in the output
[privoxy.git]
/
jbsockets.c
diff --git
a/jbsockets.c
b/jbsockets.c
index
45b57a9
..
d650dba
100644
(file)
--- a/
jbsockets.c
+++ b/
jbsockets.c
@@
-1,4
+1,4
@@
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.11
7 2012/10/17 18:01:34
fabiankeil Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.11
9 2012/10/23 10:17:36
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
@@
-83,7
+83,6
@@
const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.117 2012/10/17 18:01:34 fabia
#endif
#endif
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
#ifdef HAVE_POLL
#ifdef __GLIBC__
#include <sys/poll.h>
#ifdef HAVE_POLL
#ifdef __GLIBC__
#include <sys/poll.h>
@@
-91,7
+90,6
@@
const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.117 2012/10/17 18:01:34 fabia
#include <poll.h>
#endif /* def __GLIBC__ */
#endif /* HAVE_POLL */
#include <poll.h>
#endif /* def __GLIBC__ */
#endif /* HAVE_POLL */
-#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
#include "project.h"
#include "project.h"
@@
-742,6
+740,15
@@
void drain_and_close_socket(jb_socket fd)
{
char drainage[500];
{
char drainage[500];
+ if (!data_is_available(fd, 0))
+ {
+ /*
+ * If there is no data available right now, don't try
+ * to drain the socket as read_socket() could block.
+ */
+ break;
+ }
+
bytes_drained = read_socket(fd, drainage, sizeof(drainage));
if (bytes_drained < 0)
{
bytes_drained = read_socket(fd, drainage, sizeof(drainage));
if (bytes_drained < 0)
{
@@
-1423,7
+1430,6
@@
unsigned long resolve_hostname_to_ip(const char *host)
}
}
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
/*********************************************************************
*
* Function : socket_is_still_alive
/*********************************************************************
*
* Function : socket_is_still_alive
@@
-1477,7
+1483,6
@@
int socket_is_still_alive(jb_socket sfd)
return (no_data_waiting || (1 == recv(sfd, buf, 1, MSG_PEEK)));
}
return (no_data_waiting || (1 == recv(sfd, buf, 1, MSG_PEEK)));
}
-#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
/*
/*