Fossil SCM
Client must ignore SIGPIPE when writting to the HTTP socket.
Commit
0238e54ff352117c8ecfdce24b3918fd28a605e5
Parent
6dab6149b13f9fd…
1 file changed
+2
+2
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -29,10 +29,11 @@ | ||
| 29 | 29 | #include <arpa/inet.h> |
| 30 | 30 | #include <sys/types.h> |
| 31 | 31 | #include <sys/socket.h> |
| 32 | 32 | #include <netdb.h> |
| 33 | 33 | #include <netinet/in.h> |
| 34 | +#include <signal.h> | |
| 34 | 35 | |
| 35 | 36 | /* |
| 36 | 37 | ** Persistent information about the HTTP connection. |
| 37 | 38 | */ |
| 38 | 39 | static FILE *pSocket = 0; /* The socket on which we talk to the server */ |
| @@ -76,10 +77,11 @@ | ||
| 76 | 77 | } |
| 77 | 78 | if( connect(s,(struct sockaddr*)&addr,sizeof(addr))<0 ){ |
| 78 | 79 | fossil_panic("cannot connect to host %s:%d", g.urlName, g.urlPort); |
| 79 | 80 | } |
| 80 | 81 | pSocket = fdopen(s,"r+"); |
| 82 | + signal(SIGPIPE, SIG_IGN); | |
| 81 | 83 | return 0; |
| 82 | 84 | } |
| 83 | 85 | |
| 84 | 86 | /* |
| 85 | 87 | ** Make a single attempt to talk to the server. Return TRUE on success |
| 86 | 88 |
| --- 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 |