Differences From:
File
src/xfer.c
part of check-in
[ba837fd294]
- Add randomness in the form of a comment to each sync protocol request.
This will break older servers which do not understand comments. But comments
have been understood by servers for months now, so hopefully everybody has
upgraded.
by
drh on
2008-12-16 18:39:29.
[view]
To:
File
src/xfer.c
part of check-in
[737e76a69f]
- Refactor the HTTP client logic to make it much easier to add support for
"file:" and "https:" URLs on push, pull, sync, and clone.
by
drh on
2009-03-30 00:31:56.
[view]
@@ -849,29 +849,30 @@
** are pulled if pullFlag is true. A full sync occurs if both are
** true.
*/
void client_sync(
- int pushFlag, /* True to do a push (or a sync) */
- int pullFlag, /* True to do a pull (or a sync) */
- int cloneFlag, /* True if this is a clone */
- int configRcvMask, /* Receive these configuration items */
- int configSendMask /* Send these configuration items */
+ int pushFlag, /* True to do a push (or a sync) */
+ int pullFlag, /* True to do a pull (or a sync) */
+ int cloneFlag, /* True if this is a clone */
+ int configRcvMask, /* Receive these configuration items */
+ int configSendMask /* Send these configuration items */
){
- int go = 1; /* Loop until zero */
- const char *zSCode = db_get("server-code", "x");
- const char *zPCode = db_get("project-code", 0);
- int nCard = 0; /* Number of cards sent or received */
- int nCycle = 0; /* Number of round trips to the server */
+ int go = 1; /* Loop until zero */
+ int nCard = 0; /* Number of cards sent or received */
+ int nCycle = 0; /* Number of round trips to the server */
int size; /* Size of a config value */
int nFileSend = 0;
int origConfigRcvMask; /* Original value of configRcvMask */
int nFileRecv; /* Number of files received */
int mxPhantomReq = 200; /* Max number of phantoms to request per comm */
const char *zCookie; /* Server cookie */
- Blob send; /* Text we are sending to the server */
- Blob recv; /* Reply we got back from the server */
- Xfer xfer; /* Transfer data */
-
+ Blob send; /* Text we are sending to the server */
+ Blob recv; /* Reply we got back from the server */
+ Xfer xfer; /* Transfer data */
+ const char *zSCode = db_get("server-code", "x");
+ const char *zPCode = db_get("project-code", 0);
+
+ socket_global_init();
memset(&xfer, 0, sizeof(xfer));
xfer.pIn = &recv;
xfer.pOut = &send;
xfer.mxSend = db_get_int("max-upload", 250000);
@@ -1177,8 +1178,9 @@
if( xfer.nFileSent+xfer.nDeltaSent>0 ){
go = 1;
}
};
- http_close();
+ transport_close();
+ socket_global_shutdown();
db_multi_exec("DROP TABLE onremote");
db_end_transaction(0);
}