Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Use IPv6 when available for "fossil sync". |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | ipv6-sync |
| Files: | files | file ages | folders |
| SHA1: |
3842742871f6b265c6027379dd33d3d2 |
| User & Date: | drh 2015-01-23 01:58:29.564 |
Context
|
2015-01-23
| ||
| 02:05 | Use IPv6 for "fossil sync" when available. ... (check-in: 1dbd4d0d0b user: drh tags: trunk) | |
| 01:58 | Use IPv6 when available for "fossil sync". ... (Closed-Leaf check-in: 3842742871 user: drh tags: ipv6-sync) | |
|
2015-01-22
| ||
| 23:45 | Enhance the table sorting javascript to support initial reverse-order sorting. Add table sorting to the user log. ... (check-in: 0cdec7d290 user: drh tags: trunk) | |
Changes
Changes to src/http_socket.c.
| ︙ | ︙ | |||
43 44 45 46 47 48 49 | /* ** There can only be a single socket connection open at a time. ** State information about that socket is stored in the following ** local variables: */ static int socketIsInit = 0; /* True after global initialization */ | < | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | /* ** There can only be a single socket connection open at a time. ** State information about that socket is stored in the following ** local variables: */ static int socketIsInit = 0; /* True after global initialization */ #if defined(_WIN32) static WSADATA socketInfo; /* Windows socket initialize data */ #endif static int iSocket = -1; /* The socket on which we talk to the server */ static char *socketErrMsg = 0; /* Text of most recent socket error */ |
| ︙ | ︙ | |||
104 105 106 107 108 109 110 |
if( socketIsInit ){
#if defined(_WIN32)
WSACleanup();
#endif
socket_clear_errmsg();
socketIsInit = 0;
}
| < | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
if( socketIsInit ){
#if defined(_WIN32)
WSACleanup();
#endif
socket_clear_errmsg();
socketIsInit = 0;
}
}
/*
** Close the currently open socket. If no socket is open, this routine
** is a no-op.
*/
void socket_close(void){
|
| ︙ | ︙ | |||
132 133 134 135 136 137 138 |
**
** pUrlDAta->name Name of the server. Ex: www.fossil-scm.org
** pUrlDAta->port TCP/IP port to use. Ex: 80
**
** Return the number of errors.
*/
int socket_open(UrlData *pUrlData){
| > > | > > < | > | > > | < < < < | | < < < < | | | < > > > | > | < < < < | < | | > | > | < > > > | | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
**
** pUrlDAta->name Name of the server. Ex: www.fossil-scm.org
** pUrlDAta->port TCP/IP port to use. Ex: 80
**
** Return the number of errors.
*/
int socket_open(UrlData *pUrlData){
int rc = 0;
struct addrinfo *ai = 0;
struct addrinfo hints;
char zPort[30];
char zRemote[NI_MAXHOST];
socket_global_init();
memset(&hints, 0, sizeof(struct addrinfo));
assert( iSocket<0 );
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
sqlite3_snprintf(sizeof(zPort),zPort,"%d", pUrlData->port);
rc = getaddrinfo(pUrlData->name, zPort, &hints, &ai);
if( rc ){
socket_set_errmsg("getaddrinfo() fails: %s", gai_strerror(rc));
goto end_socket_open;
}
rc = getnameinfo(ai->ai_addr, ai->ai_addrlen, zRemote, sizeof(zRemote),
0, 0, NI_NUMERICHOST);
if( rc ){
socket_set_errmsg("getnameinfo() failed: %s", gai_strerror(rc));
goto end_socket_open;
}
g.zIpAddr = mprintf("%s", zRemote);
iSocket = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if( iSocket<0 ){
socket_set_errmsg("cannot create a socket");
rc = 1;
goto end_socket_open;
}
if( connect(iSocket,ai->ai_addr,ai->ai_addrlen)<0 ){
socket_set_errmsg("cannot connect to host %s:%d", pUrlData->name,
pUrlData->port);
rc = 1;
goto end_socket_open;
}
#if !defined(_WIN32)
signal(SIGPIPE, SIG_IGN);
#endif
end_socket_open:
if( rc && iSocket>=0 ) socket_close();
if( ai ) freeaddrinfo(ai);
return rc;
}
/*
** Send content out over the open socket connection.
*/
size_t socket_send(void *NotUsed, void *pContent, size_t N){
size_t sent;
|
| ︙ | ︙ |
Changes to src/xfer.c.
| ︙ | ︙ | |||
1964 1965 1966 1967 1968 1969 1970 |
fossil_warning("*** time skew *** server is slow by %s",
db_timespan_name(-rSkew));
g.clockSkewSeen = 1;
}
fossil_force_newline();
fossil_print(
| | | | 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 |
fossil_warning("*** time skew *** server is slow by %s",
db_timespan_name(-rSkew));
g.clockSkewSeen = 1;
}
fossil_force_newline();
fossil_print(
"Total bytes sent: %lld received: %lld ip: %s\n",
nSent, nRcvd, g.zIpAddr);
transport_close(&g.url);
transport_global_shutdown(&g.url);
if( nErr && go==2 ){
db_multi_exec("DROP TABLE onremote");
manifest_crosslink_end(MC_PERMIT_HOOKS);
content_enable_dephantomize(1);
db_end_transaction(0);
|
| ︙ | ︙ |