}
}
+#if 0
ProgressEnd(data);
+#endif
+ pgrsDone(data);
+
return URG_OK;
}
this is both more efficient than the former call to download() and
it avoids problems with select() and recv() on file descriptors
in Winsock */
+#if 0
ProgressInit (data, expected_size);
+#endif
+ if(expected_size != -1)
+ pgrsSetDownloadSize(data, expected_size);
+
while (1) {
nread = read(fd, buf, BUFSIZE-1);
return URG_WRITE_ERROR;
}
now = tvnow();
+ pgrsUpdate(data);
+#if 0
ProgressShow (data, bytecount, start, now, FALSE);
+#endif
}
now = tvnow();
+#if 0
ProgressShow (data, bytecount, start, now, TRUE);
+#endif
+ pgrsUpdate(data);
close(fd);
/* When we know we're uploading a specified file, we can get the file
size prior to the actual upload. */
+ pgrsSetUploadSize(data, data->infilesize);
+#if 0
ProgressInit(data, data->infilesize);
+#endif
result = Transfer(data, -1, -1, FALSE, NULL, /* no download */
data->secondarysocket, bytecountp);
if(result)
}
/* end of transfer */
+#if 0
ProgressEnd(data);
+#endif
+ pgrsDone(data);
/* shut down the socket to inform the server we're done */
sclose(data->secondarysocket);
sendf(data->firstsocket, data,
"Content-Length: %d\r\n",
postsize-2);
-
+
+ pgrsSetUploadSize(data, postsize);
+#if 0
ProgressInit(data, postsize);
+#endif
result = Transfer(data, data->firstsocket, -1, TRUE, &readbytecount,
data->firstsocket, &writebytecount);
else
sendf(data->firstsocket, data,
"\015\012");
-
+
+#if 0
ProgressInit(data, data->infilesize);
+#endif
+ pgrsSetUploadSize(data, data->infilesize);
result = Transfer(data, data->firstsocket, -1, TRUE, &readbytecount,
data->firstsocket, &writebytecount);
}
if(result)
return result;
-
+
+#if 0
ProgressEnd(data);
+#endif
+ pgrsDone(data);
+
} while (0); /* this is just a left-over from the multiple document download
attempts */