27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
+
|
#include "http.h"
#include <assert.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <signal.h>
/*
** Persistent information about the HTTP connection.
*/
static FILE *pSocket = 0; /* The socket on which we talk to the server */
/*
|
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
+
|
if( s<0 ){
fossil_panic("cannot create a socket");
}
if( connect(s,(struct sockaddr*)&addr,sizeof(addr))<0 ){
fossil_panic("cannot connect to host %s:%d", g.urlName, g.urlPort);
}
pSocket = fdopen(s,"r+");
signal(SIGPIPE, SIG_IGN);
return 0;
}
/*
** Make a single attempt to talk to the server. Return TRUE on success
** and FALSE on a failure.
**
|