Fossil SCM

Better error messages when "sync" fails due to server problems. Ticket [bfb8427cdd5]

drh 2009-11-11 14:59 trunk
Commit 0690aa18a4aa3dfb6f055d486d278590f715a2cc
2 files changed +10 -2 +25 -20
+10 -2
--- src/http.c
+++ src/http.c
@@ -180,11 +180,16 @@
180180
closeConnection = 1;
181181
iLength = -1;
182182
while( (zLine = transport_receive_line())!=0 && zLine[0]!=0 ){
183183
if( strncasecmp(zLine, "http/1.", 7)==0 ){
184184
if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err;
185
- if( rc!=200 ) goto write_err;
185
+ if( rc!=200 ){
186
+ int ii;
187
+ for(ii=7; zLine[ii] && zLine[ii]!=' '; ii++){}
188
+ printf("ERROR. server says: %s\n", &zLine[ii]);
189
+ goto write_err;
190
+ }
186191
if( iHttpVersion==0 ){
187192
closeConnection = 1;
188193
}else{
189194
closeConnection = 0;
190195
}
@@ -204,11 +209,14 @@
204209
}
205210
206211
/*
207212
** Extract the reply payload that follows the header
208213
*/
209
- if( iLength<0 ) goto write_err;
214
+ if( iLength<0 ){
215
+ printf("ERROR. Server did not reply\n");
216
+ goto write_err;
217
+ }
210218
blob_zero(pReply);
211219
blob_resize(pReply, iLength);
212220
iLength = transport_receive(blob_buffer(pReply), iLength);
213221
blob_resize(pReply, iLength);
214222
if( g.fHttpTrace ){
215223
--- src/http.c
+++ src/http.c
@@ -180,11 +180,16 @@
180 closeConnection = 1;
181 iLength = -1;
182 while( (zLine = transport_receive_line())!=0 && zLine[0]!=0 ){
183 if( strncasecmp(zLine, "http/1.", 7)==0 ){
184 if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err;
185 if( rc!=200 ) goto write_err;
 
 
 
 
 
186 if( iHttpVersion==0 ){
187 closeConnection = 1;
188 }else{
189 closeConnection = 0;
190 }
@@ -204,11 +209,14 @@
204 }
205
206 /*
207 ** Extract the reply payload that follows the header
208 */
209 if( iLength<0 ) goto write_err;
 
 
 
210 blob_zero(pReply);
211 blob_resize(pReply, iLength);
212 iLength = transport_receive(blob_buffer(pReply), iLength);
213 blob_resize(pReply, iLength);
214 if( g.fHttpTrace ){
215
--- src/http.c
+++ src/http.c
@@ -180,11 +180,16 @@
180 closeConnection = 1;
181 iLength = -1;
182 while( (zLine = transport_receive_line())!=0 && zLine[0]!=0 ){
183 if( strncasecmp(zLine, "http/1.", 7)==0 ){
184 if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err;
185 if( rc!=200 ){
186 int ii;
187 for(ii=7; zLine[ii] && zLine[ii]!=' '; ii++){}
188 printf("ERROR. server says: %s\n", &zLine[ii]);
189 goto write_err;
190 }
191 if( iHttpVersion==0 ){
192 closeConnection = 1;
193 }else{
194 closeConnection = 0;
195 }
@@ -204,11 +209,14 @@
209 }
210
211 /*
212 ** Extract the reply payload that follows the header
213 */
214 if( iLength<0 ){
215 printf("ERROR. Server did not reply\n");
216 goto write_err;
217 }
218 blob_zero(pReply);
219 blob_resize(pReply, iLength);
220 iLength = transport_receive(blob_buffer(pReply), iLength);
221 blob_resize(pReply, iLength);
222 if( g.fHttpTrace ){
223
+25 -20
--- src/xfer.c
+++ src/xfer.c
@@ -922,11 +922,12 @@
922922
int cloneFlag, /* True if this is a clone */
923923
int configRcvMask, /* Receive these configuration items */
924924
int configSendMask /* Send these configuration items */
925925
){
926926
int go = 1; /* Loop until zero */
927
- int nCard = 0; /* Number of cards sent or received */
927
+ int nCardSent = 0; /* Number of cards sent */
928
+ int nCardRcvd = 0; /* Number of cards received */
928929
int nCycle = 0; /* Number of round trips to the server */
929930
int size; /* Size of a config value */
930931
int nFileSend = 0;
931932
int origConfigRcvMask; /* Original value of configRcvMask */
932933
int nFileRecv; /* Number of files received */
@@ -968,19 +969,19 @@
968969
*/
969970
if( cloneFlag ){
970971
blob_appendf(&send, "clone\n");
971972
pushFlag = 0;
972973
pullFlag = 0;
973
- nCard++;
974
+ nCardSent++;
974975
/* TBD: Request all transferable configuration values */
975976
}else if( pullFlag ){
976977
blob_appendf(&send, "pull %s %s\n", zSCode, zPCode);
977
- nCard++;
978
+ nCardSent++;
978979
}
979980
if( pushFlag ){
980981
blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
981
- nCard++;
982
+ nCardSent++;
982983
}
983984
manifest_crosslink_begin();
984985
printf(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas");
985986
986987
while( go ){
@@ -1001,21 +1002,21 @@
10011002
if( pullFlag || cloneFlag ){
10021003
request_phantoms(&xfer, mxPhantomReq);
10031004
}
10041005
if( pushFlag ){
10051006
send_unsent(&xfer);
1006
- nCard += send_unclustered(&xfer);
1007
+ nCardSent += send_unclustered(&xfer);
10071008
}
10081009
10091010
/* Send configuration parameter requests */
10101011
if( configRcvMask ){
10111012
const char *zName;
10121013
zName = configure_first_name(configRcvMask);
10131014
while( zName ){
10141015
blob_appendf(&send, "reqconfig %s\n", zName);
10151016
zName = configure_next_name(configRcvMask);
1016
- nCard++;
1017
+ nCardSent++;
10171018
}
10181019
if( configRcvMask & (CONFIGSET_USER|CONFIGSET_TKT) ){
10191020
configure_prepare_to_receive(0);
10201021
}
10211022
configRcvMask = 0;
@@ -1026,11 +1027,11 @@
10261027
const char *zName;
10271028
zName = configure_first_name(configSendMask);
10281029
while( zName ){
10291030
send_config_card(&xfer, zName);
10301031
zName = configure_next_name(configSendMask);
1031
- nCard++;
1032
+ nCardSent++;
10321033
}
10331034
configSendMask = 0;
10341035
}
10351036
10361037
/* Append randomness to the end of the message */
@@ -1039,13 +1040,14 @@
10391040
free(zRandomness);
10401041
10411042
/* Exchange messages with the server */
10421043
nFileSend = xfer.nFileSent + xfer.nDeltaSent;
10431044
printf(zValueFormat, "Send:",
1044
- blob_size(&send), nCard+xfer.nGimmeSent+xfer.nIGotSent,
1045
+ blob_size(&send), nCardSent+xfer.nGimmeSent+xfer.nIGotSent,
10451046
xfer.nFileSent, xfer.nDeltaSent);
1046
- nCard = 0;
1047
+ nCardSent = 0;
1048
+ nCardRcvd = 0;
10471049
xfer.nFileSent = 0;
10481050
xfer.nDeltaSent = 0;
10491051
xfer.nGimmeSent = 0;
10501052
fflush(stdout);
10511053
http_exchange(&send, &recv);
@@ -1054,25 +1056,25 @@
10541056
/* Begin constructing the next message (which might never be
10551057
** sent) by beginning with the pull or push cards
10561058
*/
10571059
if( pullFlag ){
10581060
blob_appendf(&send, "pull %s %s\n", zSCode, zPCode);
1059
- nCard++;
1061
+ nCardSent++;
10601062
}
10611063
if( pushFlag ){
10621064
blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
1063
- nCard++;
1065
+ nCardSent++;
10641066
}
10651067
10661068
/* Process the reply that came back from the server */
10671069
while( blob_line(&recv, &xfer.line) ){
10681070
if( blob_buffer(&xfer.line)[0]=='#' ){
10691071
continue;
10701072
}
10711073
xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken));
1072
- nCard++;
1073
- printf("\r%d", nCard);
1074
+ nCardRcvd++;
1075
+ printf("\r%d", nCardRcvd);
10741076
fflush(stdout);
10751077
10761078
/* file UUID SIZE \n CONTENT
10771079
** file UUID DELTASRC SIZE \n CONTENT
10781080
**
@@ -1138,11 +1140,11 @@
11381140
if( zPCode==0 ){
11391141
zPCode = mprintf("%b", &xfer.aToken[2]);
11401142
db_set("project-code", zPCode, 0);
11411143
}
11421144
blob_appendf(&send, "clone\n");
1143
- nCard++;
1145
+ nCardSent++;
11441146
}else
11451147
11461148
/* config NAME SIZE \n CONTENT
11471149
**
11481150
** Receive a configuration value from the server.
@@ -1178,11 +1180,11 @@
11781180
** presumably the operator trusts the server.
11791181
*/
11801182
db_multi_exec("%s", blob_str(&content));
11811183
}
11821184
}
1183
- nCard++;
1185
+ nCardSent++;
11841186
blob_reset(&content);
11851187
blob_seek(xfer.pIn, 1, BLOB_SEEK_CUR);
11861188
}else
11871189
11881190
@@ -1204,11 +1206,11 @@
12041206
** Print a message. Similar to "error" but does not stop processing
12051207
*/
12061208
if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){
12071209
char *zMsg = blob_terminate(&xfer.aToken[1]);
12081210
defossilize(zMsg);
1209
- printf("Server says: %s\n", zMsg);
1211
+ printf("\rServer says: %s\n", zMsg);
12101212
}else
12111213
12121214
/* error MESSAGE
12131215
**
12141216
** Report an error and abandon the sync session
@@ -1215,10 +1217,11 @@
12151217
*/
12161218
if( blob_eq(&xfer.aToken[0],"error") && xfer.nToken==2 ){
12171219
char *zMsg = blob_terminate(&xfer.aToken[1]);
12181220
defossilize(zMsg);
12191221
blob_appendf(&xfer.err, "server says: %s", zMsg);
1222
+ printf("Server Error: %s\n", zMsg);
12201223
}else
12211224
12221225
/* Unknown message */
12231226
{
12241227
if( blob_str(&xfer.aToken[0])[0]=='<' ){
@@ -1238,13 +1241,15 @@
12381241
}
12391242
if( origConfigRcvMask & (CONFIGSET_TKT|CONFIGSET_USER) ){
12401243
configure_finalize_receive();
12411244
}
12421245
origConfigRcvMask = 0;
1243
- printf(zValueFormat, "Received:",
1244
- blob_size(&recv), nCard,
1245
- xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile);
1246
+ if( nCardRcvd>0 ){
1247
+ printf(zValueFormat, "Received:",
1248
+ blob_size(&recv), nCardRcvd,
1249
+ xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile);
1250
+ }
12461251
blob_reset(&recv);
12471252
nCycle++;
12481253
go = 0;
12491254
12501255
/* If we received one or more files on the previous exchange but
@@ -1254,11 +1259,11 @@
12541259
if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){
12551260
go = 1;
12561261
mxPhantomReq = nFileRecv*2;
12571262
if( mxPhantomReq<200 ) mxPhantomReq = 200;
12581263
}
1259
- nCard = 0;
1264
+ nCardRcvd = 0;
12601265
xfer.nFileRcvd = 0;
12611266
xfer.nDeltaRcvd = 0;
12621267
xfer.nDanglingFile = 0;
12631268
12641269
/* If we have one or more files queued to send, then go
12651270
--- src/xfer.c
+++ src/xfer.c
@@ -922,11 +922,12 @@
922 int cloneFlag, /* True if this is a clone */
923 int configRcvMask, /* Receive these configuration items */
924 int configSendMask /* Send these configuration items */
925 ){
926 int go = 1; /* Loop until zero */
927 int nCard = 0; /* Number of cards sent or received */
 
928 int nCycle = 0; /* Number of round trips to the server */
929 int size; /* Size of a config value */
930 int nFileSend = 0;
931 int origConfigRcvMask; /* Original value of configRcvMask */
932 int nFileRecv; /* Number of files received */
@@ -968,19 +969,19 @@
968 */
969 if( cloneFlag ){
970 blob_appendf(&send, "clone\n");
971 pushFlag = 0;
972 pullFlag = 0;
973 nCard++;
974 /* TBD: Request all transferable configuration values */
975 }else if( pullFlag ){
976 blob_appendf(&send, "pull %s %s\n", zSCode, zPCode);
977 nCard++;
978 }
979 if( pushFlag ){
980 blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
981 nCard++;
982 }
983 manifest_crosslink_begin();
984 printf(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas");
985
986 while( go ){
@@ -1001,21 +1002,21 @@
1001 if( pullFlag || cloneFlag ){
1002 request_phantoms(&xfer, mxPhantomReq);
1003 }
1004 if( pushFlag ){
1005 send_unsent(&xfer);
1006 nCard += send_unclustered(&xfer);
1007 }
1008
1009 /* Send configuration parameter requests */
1010 if( configRcvMask ){
1011 const char *zName;
1012 zName = configure_first_name(configRcvMask);
1013 while( zName ){
1014 blob_appendf(&send, "reqconfig %s\n", zName);
1015 zName = configure_next_name(configRcvMask);
1016 nCard++;
1017 }
1018 if( configRcvMask & (CONFIGSET_USER|CONFIGSET_TKT) ){
1019 configure_prepare_to_receive(0);
1020 }
1021 configRcvMask = 0;
@@ -1026,11 +1027,11 @@
1026 const char *zName;
1027 zName = configure_first_name(configSendMask);
1028 while( zName ){
1029 send_config_card(&xfer, zName);
1030 zName = configure_next_name(configSendMask);
1031 nCard++;
1032 }
1033 configSendMask = 0;
1034 }
1035
1036 /* Append randomness to the end of the message */
@@ -1039,13 +1040,14 @@
1039 free(zRandomness);
1040
1041 /* Exchange messages with the server */
1042 nFileSend = xfer.nFileSent + xfer.nDeltaSent;
1043 printf(zValueFormat, "Send:",
1044 blob_size(&send), nCard+xfer.nGimmeSent+xfer.nIGotSent,
1045 xfer.nFileSent, xfer.nDeltaSent);
1046 nCard = 0;
 
1047 xfer.nFileSent = 0;
1048 xfer.nDeltaSent = 0;
1049 xfer.nGimmeSent = 0;
1050 fflush(stdout);
1051 http_exchange(&send, &recv);
@@ -1054,25 +1056,25 @@
1054 /* Begin constructing the next message (which might never be
1055 ** sent) by beginning with the pull or push cards
1056 */
1057 if( pullFlag ){
1058 blob_appendf(&send, "pull %s %s\n", zSCode, zPCode);
1059 nCard++;
1060 }
1061 if( pushFlag ){
1062 blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
1063 nCard++;
1064 }
1065
1066 /* Process the reply that came back from the server */
1067 while( blob_line(&recv, &xfer.line) ){
1068 if( blob_buffer(&xfer.line)[0]=='#' ){
1069 continue;
1070 }
1071 xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken));
1072 nCard++;
1073 printf("\r%d", nCard);
1074 fflush(stdout);
1075
1076 /* file UUID SIZE \n CONTENT
1077 ** file UUID DELTASRC SIZE \n CONTENT
1078 **
@@ -1138,11 +1140,11 @@
1138 if( zPCode==0 ){
1139 zPCode = mprintf("%b", &xfer.aToken[2]);
1140 db_set("project-code", zPCode, 0);
1141 }
1142 blob_appendf(&send, "clone\n");
1143 nCard++;
1144 }else
1145
1146 /* config NAME SIZE \n CONTENT
1147 **
1148 ** Receive a configuration value from the server.
@@ -1178,11 +1180,11 @@
1178 ** presumably the operator trusts the server.
1179 */
1180 db_multi_exec("%s", blob_str(&content));
1181 }
1182 }
1183 nCard++;
1184 blob_reset(&content);
1185 blob_seek(xfer.pIn, 1, BLOB_SEEK_CUR);
1186 }else
1187
1188
@@ -1204,11 +1206,11 @@
1204 ** Print a message. Similar to "error" but does not stop processing
1205 */
1206 if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){
1207 char *zMsg = blob_terminate(&xfer.aToken[1]);
1208 defossilize(zMsg);
1209 printf("Server says: %s\n", zMsg);
1210 }else
1211
1212 /* error MESSAGE
1213 **
1214 ** Report an error and abandon the sync session
@@ -1215,10 +1217,11 @@
1215 */
1216 if( blob_eq(&xfer.aToken[0],"error") && xfer.nToken==2 ){
1217 char *zMsg = blob_terminate(&xfer.aToken[1]);
1218 defossilize(zMsg);
1219 blob_appendf(&xfer.err, "server says: %s", zMsg);
 
1220 }else
1221
1222 /* Unknown message */
1223 {
1224 if( blob_str(&xfer.aToken[0])[0]=='<' ){
@@ -1238,13 +1241,15 @@
1238 }
1239 if( origConfigRcvMask & (CONFIGSET_TKT|CONFIGSET_USER) ){
1240 configure_finalize_receive();
1241 }
1242 origConfigRcvMask = 0;
1243 printf(zValueFormat, "Received:",
1244 blob_size(&recv), nCard,
1245 xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile);
 
 
1246 blob_reset(&recv);
1247 nCycle++;
1248 go = 0;
1249
1250 /* If we received one or more files on the previous exchange but
@@ -1254,11 +1259,11 @@
1254 if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){
1255 go = 1;
1256 mxPhantomReq = nFileRecv*2;
1257 if( mxPhantomReq<200 ) mxPhantomReq = 200;
1258 }
1259 nCard = 0;
1260 xfer.nFileRcvd = 0;
1261 xfer.nDeltaRcvd = 0;
1262 xfer.nDanglingFile = 0;
1263
1264 /* If we have one or more files queued to send, then go
1265
--- src/xfer.c
+++ src/xfer.c
@@ -922,11 +922,12 @@
922 int cloneFlag, /* True if this is a clone */
923 int configRcvMask, /* Receive these configuration items */
924 int configSendMask /* Send these configuration items */
925 ){
926 int go = 1; /* Loop until zero */
927 int nCardSent = 0; /* Number of cards sent */
928 int nCardRcvd = 0; /* Number of cards received */
929 int nCycle = 0; /* Number of round trips to the server */
930 int size; /* Size of a config value */
931 int nFileSend = 0;
932 int origConfigRcvMask; /* Original value of configRcvMask */
933 int nFileRecv; /* Number of files received */
@@ -968,19 +969,19 @@
969 */
970 if( cloneFlag ){
971 blob_appendf(&send, "clone\n");
972 pushFlag = 0;
973 pullFlag = 0;
974 nCardSent++;
975 /* TBD: Request all transferable configuration values */
976 }else if( pullFlag ){
977 blob_appendf(&send, "pull %s %s\n", zSCode, zPCode);
978 nCardSent++;
979 }
980 if( pushFlag ){
981 blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
982 nCardSent++;
983 }
984 manifest_crosslink_begin();
985 printf(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas");
986
987 while( go ){
@@ -1001,21 +1002,21 @@
1002 if( pullFlag || cloneFlag ){
1003 request_phantoms(&xfer, mxPhantomReq);
1004 }
1005 if( pushFlag ){
1006 send_unsent(&xfer);
1007 nCardSent += send_unclustered(&xfer);
1008 }
1009
1010 /* Send configuration parameter requests */
1011 if( configRcvMask ){
1012 const char *zName;
1013 zName = configure_first_name(configRcvMask);
1014 while( zName ){
1015 blob_appendf(&send, "reqconfig %s\n", zName);
1016 zName = configure_next_name(configRcvMask);
1017 nCardSent++;
1018 }
1019 if( configRcvMask & (CONFIGSET_USER|CONFIGSET_TKT) ){
1020 configure_prepare_to_receive(0);
1021 }
1022 configRcvMask = 0;
@@ -1026,11 +1027,11 @@
1027 const char *zName;
1028 zName = configure_first_name(configSendMask);
1029 while( zName ){
1030 send_config_card(&xfer, zName);
1031 zName = configure_next_name(configSendMask);
1032 nCardSent++;
1033 }
1034 configSendMask = 0;
1035 }
1036
1037 /* Append randomness to the end of the message */
@@ -1039,13 +1040,14 @@
1040 free(zRandomness);
1041
1042 /* Exchange messages with the server */
1043 nFileSend = xfer.nFileSent + xfer.nDeltaSent;
1044 printf(zValueFormat, "Send:",
1045 blob_size(&send), nCardSent+xfer.nGimmeSent+xfer.nIGotSent,
1046 xfer.nFileSent, xfer.nDeltaSent);
1047 nCardSent = 0;
1048 nCardRcvd = 0;
1049 xfer.nFileSent = 0;
1050 xfer.nDeltaSent = 0;
1051 xfer.nGimmeSent = 0;
1052 fflush(stdout);
1053 http_exchange(&send, &recv);
@@ -1054,25 +1056,25 @@
1056 /* Begin constructing the next message (which might never be
1057 ** sent) by beginning with the pull or push cards
1058 */
1059 if( pullFlag ){
1060 blob_appendf(&send, "pull %s %s\n", zSCode, zPCode);
1061 nCardSent++;
1062 }
1063 if( pushFlag ){
1064 blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
1065 nCardSent++;
1066 }
1067
1068 /* Process the reply that came back from the server */
1069 while( blob_line(&recv, &xfer.line) ){
1070 if( blob_buffer(&xfer.line)[0]=='#' ){
1071 continue;
1072 }
1073 xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken));
1074 nCardRcvd++;
1075 printf("\r%d", nCardRcvd);
1076 fflush(stdout);
1077
1078 /* file UUID SIZE \n CONTENT
1079 ** file UUID DELTASRC SIZE \n CONTENT
1080 **
@@ -1138,11 +1140,11 @@
1140 if( zPCode==0 ){
1141 zPCode = mprintf("%b", &xfer.aToken[2]);
1142 db_set("project-code", zPCode, 0);
1143 }
1144 blob_appendf(&send, "clone\n");
1145 nCardSent++;
1146 }else
1147
1148 /* config NAME SIZE \n CONTENT
1149 **
1150 ** Receive a configuration value from the server.
@@ -1178,11 +1180,11 @@
1180 ** presumably the operator trusts the server.
1181 */
1182 db_multi_exec("%s", blob_str(&content));
1183 }
1184 }
1185 nCardSent++;
1186 blob_reset(&content);
1187 blob_seek(xfer.pIn, 1, BLOB_SEEK_CUR);
1188 }else
1189
1190
@@ -1204,11 +1206,11 @@
1206 ** Print a message. Similar to "error" but does not stop processing
1207 */
1208 if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){
1209 char *zMsg = blob_terminate(&xfer.aToken[1]);
1210 defossilize(zMsg);
1211 printf("\rServer says: %s\n", zMsg);
1212 }else
1213
1214 /* error MESSAGE
1215 **
1216 ** Report an error and abandon the sync session
@@ -1215,10 +1217,11 @@
1217 */
1218 if( blob_eq(&xfer.aToken[0],"error") && xfer.nToken==2 ){
1219 char *zMsg = blob_terminate(&xfer.aToken[1]);
1220 defossilize(zMsg);
1221 blob_appendf(&xfer.err, "server says: %s", zMsg);
1222 printf("Server Error: %s\n", zMsg);
1223 }else
1224
1225 /* Unknown message */
1226 {
1227 if( blob_str(&xfer.aToken[0])[0]=='<' ){
@@ -1238,13 +1241,15 @@
1241 }
1242 if( origConfigRcvMask & (CONFIGSET_TKT|CONFIGSET_USER) ){
1243 configure_finalize_receive();
1244 }
1245 origConfigRcvMask = 0;
1246 if( nCardRcvd>0 ){
1247 printf(zValueFormat, "Received:",
1248 blob_size(&recv), nCardRcvd,
1249 xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile);
1250 }
1251 blob_reset(&recv);
1252 nCycle++;
1253 go = 0;
1254
1255 /* If we received one or more files on the previous exchange but
@@ -1254,11 +1259,11 @@
1259 if( (nFileRecv>0 || newPhantom) && db_exists("SELECT 1 FROM phantom") ){
1260 go = 1;
1261 mxPhantomReq = nFileRecv*2;
1262 if( mxPhantomReq<200 ) mxPhantomReq = 200;
1263 }
1264 nCardRcvd = 0;
1265 xfer.nFileRcvd = 0;
1266 xfer.nDeltaRcvd = 0;
1267 xfer.nDanglingFile = 0;
1268
1269 /* If we have one or more files queued to send, then go
1270

Keyboard Shortcuts

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