mirror of
				https://github.com/9001/copyparty.git
				synced 2025-11-03 13:33:13 +00:00 
			
		
		
		
	push queue/status info to server
This commit is contained in:
		@@ -964,6 +964,12 @@ quick outline of the up2k protocol, see [uploading](#uploading) for the web-clie
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
up2k has saved a few uploads from becoming corrupted in-transfer already; caught an android phone on wifi redhanded in wireshark with a bitflip, however bup with https would *probably* have noticed as well (thanks to tls also functioning as an integrity check)
 | 
					up2k has saved a few uploads from becoming corrupted in-transfer already; caught an android phone on wifi redhanded in wireshark with a bitflip, however bup with https would *probably* have noticed as well (thanks to tls also functioning as an integrity check)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					regarding the frequent server log message during uploads;  
 | 
				
			||||||
 | 
					`6.0M 106M/s 2.77G 102.9M/s n948 thank 4/0/3/1 10042/7198`
 | 
				
			||||||
 | 
					* this chunk was `6 MiB`, uploaded at `106 MiB/s`
 | 
				
			||||||
 | 
					* on this http connection, `2.77 GiB` transferred, `102.9 MiB/s` average, `948` chunks handled
 | 
				
			||||||
 | 
					* client says `4` uploads OK, `0` failed, `3` busy, `1` queued, `10042 MiB` total size, `7198 MiB` left
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## why chunk-hashes
 | 
					## why chunk-hashes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1127,8 +1127,10 @@ class HttpCli(object):
 | 
				
			|||||||
            except:
 | 
					            except:
 | 
				
			||||||
                self.log("failed to utime ({}, {})".format(fin_path, times))
 | 
					                self.log("failed to utime ({}, {})".format(fin_path, times))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        cinf = self.headers.get("x-up2k-stat", "")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        spd = self._spd(post_sz)
 | 
					        spd = self._spd(post_sz)
 | 
				
			||||||
        self.log("{} thank".format(spd))
 | 
					        self.log("{} thank {}".format(spd, cinf))
 | 
				
			||||||
        self.reply(b"thank")
 | 
					        self.reply(b"thank")
 | 
				
			||||||
        return True
 | 
					        return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1924,7 +1924,10 @@ function up2k_init(subtle) {
 | 
				
			|||||||
            tasker();
 | 
					            tasker();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        function do_send() {
 | 
					        function do_send() {
 | 
				
			||||||
            var xhr = new XMLHttpRequest();
 | 
					            var xhr = new XMLHttpRequest(),
 | 
				
			||||||
 | 
					                bfin = Math.floor(st.bytes.finished / 1024 / 1024),
 | 
				
			||||||
 | 
					                btot = Math.floor(st.bytes.total / 1024 / 1024);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            xhr.upload.onprogress = function (xev) {
 | 
					            xhr.upload.onprogress = function (xev) {
 | 
				
			||||||
                pvis.prog(t, npart, xev.loaded);
 | 
					                pvis.prog(t, npart, xev.loaded);
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
@@ -1944,6 +1947,8 @@ function up2k_init(subtle) {
 | 
				
			|||||||
            xhr.open('POST', t.purl, true);
 | 
					            xhr.open('POST', t.purl, true);
 | 
				
			||||||
            xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart]);
 | 
					            xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart]);
 | 
				
			||||||
            xhr.setRequestHeader("X-Up2k-Wark", t.wark);
 | 
					            xhr.setRequestHeader("X-Up2k-Wark", t.wark);
 | 
				
			||||||
 | 
					            xhr.setRequestHeader("X-Up2k-Stat", "{0}/{1}/{2}/{3} {4}/{5}".format(
 | 
				
			||||||
 | 
					                pvis.ctr.ok, pvis.ctr.ng, pvis.ctr.bz, pvis.ctr.q, btot, btot - bfin));
 | 
				
			||||||
            xhr.setRequestHeader('Content-Type', 'application/octet-stream');
 | 
					            xhr.setRequestHeader('Content-Type', 'application/octet-stream');
 | 
				
			||||||
            if (xhr.overrideMimeType)
 | 
					            if (xhr.overrideMimeType)
 | 
				
			||||||
                xhr.overrideMimeType('Content-Type', 'application/octet-stream');
 | 
					                xhr.overrideMimeType('Content-Type', 'application/octet-stream');
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user