Skip to content

vlib: io: Buffered IO, x.net -> net#6754

Merged
spytheman merged 31 commits intovlang:masterfrom
emily33901:io_reader
Nov 15, 2020
Merged

vlib: io: Buffered IO, x.net -> net#6754
spytheman merged 31 commits intovlang:masterfrom
emily33901:io_reader

Conversation

@emily33901
Copy link
Copy Markdown
Member

@emily33901 emily33901 commented Nov 5, 2020

The spiritual successor to #6299 This PR Adds buffered io and general purpose interfaces for reading, writing, and a simple buffered reader struct that can be fleshed out more when needed.

Also moves x.net -> net and fixes smtp, ftp, http, x.websocket, and everything else.

read_into is renamed to read to be inline with the Reader interface that itself uses the name from the Go reader interface. Since io.read_all() can now be used to read any bytes that a reader has I feel that this is fine

I think just the vweb test is busted but thats because it does some silly tcpconn opening stuff.

@spytheman spytheman force-pushed the io_reader branch 2 times, most recently from 6452db9 to 7d36a79 Compare November 5, 2020 18:45
@esquerbatua
Copy link
Copy Markdown
Contributor

Great job!

@medvednikov
Copy link
Copy Markdown
Member

>> webserver: started on http://127.0.0.1:12380/ , with maximum runtime of 5000 milliseconds.

/home/runner/work/v/v/vlib/vweb/tests/vweb_test.v:53: failed assert in function assert_common_headers
Source  : `received.starts_with('HTTP/1.1 200 OK\\r\\n')`

/home/runner/work/v/v/vlib/vweb/tests/vweb_test.v:74: failed assert in function test_a_simple_tcp_client_simple_route
Source  : `err == ''`
	 left value: net: socket error: 88 <= `err`
	right value:  <= `''`

/home/runner/work/v/v/vlib/vweb/tests/vweb_test.v:87: failed assert in function test_a_simple_tcp_client_html_page
Source  : `err == ''`
	 left value: net: socket error: 32 <= `err`
	right value:  <= `''`
V panic: net: socket error: 111```

@medvednikov
Copy link
Copy Markdown
Member

Great work @emily33901 !

Looking forward to merging this.

@medvednikov medvednikov reopened this Nov 10, 2020
@spytheman spytheman merged commit cd2a2ce into vlang:master Nov 15, 2020
@seven1240 seven1240 mentioned this pull request Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants