forked from vieter-v/vieter
				
			Added some error messages; updated changelog
							parent
							
								
									9cc88e629f
								
							
						
					
					
						commit
						96416585bc
					
				
							
								
								
									
										14
									
								
								CHANGELOG.md
								
								
								
								
							
							
						
						
									
										14
									
								
								CHANGELOG.md
								
								
								
								
							|  | @ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | ||||||
| 
 | 
 | ||||||
| ## [Unreleased](https://git.rustybever.be/Chewing_Bever/vieter) | ## [Unreleased](https://git.rustybever.be/Chewing_Bever/vieter) | ||||||
| 
 | 
 | ||||||
|  | ## Added | ||||||
|  | 
 | ||||||
|  | * Very basic build system | ||||||
|  |     * Build is triggered by separate cron container | ||||||
|  |     * Packages build on cron container's system | ||||||
|  |     * Packages are always rebuilt, even if they haven't changed | ||||||
|  |     * Hardcoded planning of builds | ||||||
|  |     * Builds are sequential | ||||||
|  | 
 | ||||||
|  | ## Fixed | ||||||
|  | 
 | ||||||
|  | * Each package can now only have one version in the repository at once | ||||||
|  |   (required by Pacman) | ||||||
|  | 
 | ||||||
| ## [0.1.0](https://git.rustybever.be/Chewing_Bever/vieter/src/tag/0.1.0) | ## [0.1.0](https://git.rustybever.be/Chewing_Bever/vieter/src/tag/0.1.0) | ||||||
| 
 | 
 | ||||||
| ### Changed | ### Changed | ||||||
|  |  | ||||||
|  | @ -11,7 +11,7 @@ const buf_len = 1024 | ||||||
| 
 | 
 | ||||||
| fn send(req &string) ?http.Response { | fn send(req &string) ?http.Response { | ||||||
| 	// Open a connection to the socket | 	// Open a connection to the socket | ||||||
| 	mut s := unix.connect_stream(docker.socket) ? | 	mut s := unix.connect_stream(docker.socket) or { return error('Failed to connect to socket ${docker.socket}.') } | ||||||
| 
 | 
 | ||||||
| 	defer { | 	defer { | ||||||
| 		// This or is required because otherwise, the V compiler segfaults for | 		// This or is required because otherwise, the V compiler segfaults for | ||||||
|  | @ -21,7 +21,7 @@ fn send(req &string) ?http.Response { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// Write the request to the socket | 	// Write the request to the socket | ||||||
| 	s.write_string(req) ? | 	s.write_string(req) or { return error('Failed to write request to socket ${docker.socket}.') } | ||||||
| 
 | 
 | ||||||
| 	s.wait_for_write() ? | 	s.wait_for_write() ? | ||||||
| 
 | 
 | ||||||
|  | @ -30,7 +30,7 @@ fn send(req &string) ?http.Response { | ||||||
| 	mut res := []byte{} | 	mut res := []byte{} | ||||||
| 
 | 
 | ||||||
| 	for { | 	for { | ||||||
| 		c = s.read(mut buf) or { return error('Failed to read data from socket.') } | 		c = s.read(mut buf) or { return error('Failed to read data from socket ${docker.socket}.') } | ||||||
| 		res << buf[..c] | 		res << buf[..c] | ||||||
| 
 | 
 | ||||||
| 		if c < docker.buf_len { | 		if c < docker.buf_len { | ||||||
|  | @ -38,20 +38,22 @@ fn send(req &string) ?http.Response { | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// If the response isn't a chunked reply, we return early | 	// After reading the first part of the response, we parse it into an HTTP | ||||||
| 	parsed := http.parse_response(res.bytestr()) ? | 	// response. If it isn't chunked, we return early with the data. | ||||||
|  | 	parsed := http.parse_response(res.bytestr()) or { return error('Failed to parse HTTP response from socket ${docker.socket}.') } | ||||||
| 
 | 
 | ||||||
| 	if parsed.header.get(http.CommonHeader.transfer_encoding) or { '' } != 'chunked' { | 	if parsed.header.get(http.CommonHeader.transfer_encoding) or { '' } != 'chunked' { | ||||||
| 		return parsed | 		return parsed | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// We loop until we've encountered the end of the chunked response | 	// We loop until we've encountered the end of the chunked response | ||||||
|  | 	// A chunked HTTP response always ends with '0\r\n\r\n'. | ||||||
| 	for res.len < 5 || res#[-5..] != [byte(`0`), `\r`, `\n`, `\r`, `\n`] { | 	for res.len < 5 || res#[-5..] != [byte(`0`), `\r`, `\n`, `\r`, `\n`] { | ||||||
| 		// Wait for the server to respond | 		// Wait for the server to respond | ||||||
| 		s.wait_for_write() ? | 		s.wait_for_write() ? | ||||||
| 
 | 
 | ||||||
| 		for { | 		for { | ||||||
| 			c = s.read(mut buf) or { return error('Failed to read data from socket.') } | 			c = s.read(mut buf) or { return error('Failed to read data from socket ${docker.socket}.') } | ||||||
| 			res << buf[..c] | 			res << buf[..c] | ||||||
| 
 | 
 | ||||||
| 			if c < docker.buf_len { | 			if c < docker.buf_len { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue