Fossil SCM

Client must ignore SIGPIPE when writting to the HTTP socket.

drh 2007-08-01 13:50 trunk
Commit 0238e54ff352117c8ecfdce24b3918fd28a605e5
1 file changed +2
+2
--- src/http.c
+++ src/http.c
@@ -29,10 +29,11 @@
2929
#include <arpa/inet.h>
3030
#include <sys/types.h>
3131
#include <sys/socket.h>
3232
#include <netdb.h>
3333
#include <netinet/in.h>
34
+#include <signal.h>
3435
3536
/*
3637
** Persistent information about the HTTP connection.
3738
*/
3839
static FILE *pSocket = 0; /* The socket on which we talk to the server */
@@ -76,10 +77,11 @@
7677
}
7778
if( connect(s,(struct sockaddr*)&addr,sizeof(addr))<0 ){
7879
fossil_panic("cannot connect to host %s:%d", g.urlName, g.urlPort);
7980
}
8081
pSocket = fdopen(s,"r+");
82
+ signal(SIGPIPE, SIG_IGN);
8183
return 0;
8284
}
8385
8486
/*
8587
** Make a single attempt to talk to the server. Return TRUE on success
8688
--- src/http.c
+++ src/http.c
@@ -29,10 +29,11 @@
29 #include <arpa/inet.h>
30 #include <sys/types.h>
31 #include <sys/socket.h>
32 #include <netdb.h>
33 #include <netinet/in.h>
 
34
35 /*
36 ** Persistent information about the HTTP connection.
37 */
38 static FILE *pSocket = 0; /* The socket on which we talk to the server */
@@ -76,10 +77,11 @@
76 }
77 if( connect(s,(struct sockaddr*)&addr,sizeof(addr))<0 ){
78 fossil_panic("cannot connect to host %s:%d", g.urlName, g.urlPort);
79 }
80 pSocket = fdopen(s,"r+");
 
81 return 0;
82 }
83
84 /*
85 ** Make a single attempt to talk to the server. Return TRUE on success
86
--- src/http.c
+++ src/http.c
@@ -29,10 +29,11 @@
29 #include <arpa/inet.h>
30 #include <sys/types.h>
31 #include <sys/socket.h>
32 #include <netdb.h>
33 #include <netinet/in.h>
34 #include <signal.h>
35
36 /*
37 ** Persistent information about the HTTP connection.
38 */
39 static FILE *pSocket = 0; /* The socket on which we talk to the server */
@@ -76,10 +77,11 @@
77 }
78 if( connect(s,(struct sockaddr*)&addr,sizeof(addr))<0 ){
79 fossil_panic("cannot connect to host %s:%d", g.urlName, g.urlPort);
80 }
81 pSocket = fdopen(s,"r+");
82 signal(SIGPIPE, SIG_IGN);
83 return 0;
84 }
85
86 /*
87 ** Make a single attempt to talk to the server. Return TRUE on success
88

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button