You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
specifically at commit cd11bed (currently tip of master branch as of this writing).
Sometimes the server's reply of 65536 bytes fails on the first write. Other times it fails on the 2nd write.
To reproduce:
Run server:
jaten@rog ~/go/src/github.com/wolfssl/go-wolfssl/examples/server (master) $ rm httplike; go build httplike.go; ./httplike
Listening on localhost:11111
Client Succesfully Connected!
Client says : Can you hear me?^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
Client Succesfully Connected!
Client says : Can you hear me?^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^\
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
WolfSSL_write failed
jaten@rog ~/go/src/github.com/wolfssl/go-wolfssl/examples/server (master) $
In another terminal, run the client:
jaten@rog ~/go/src/github.com/wolfssl/go-wolfssl/examples/client (master) $ rm client; g\
o build client.go; ./client
# github.com/wolfssl/go-wolfssl
cgo-gcc-prolog: In function ‘_cgo_acb84add02d8_Cfunc_wolfSSL_Debugging_OFF’:
cgo-gcc-prolog:334:49: warning: unused variable ‘_cgo_a’ [-Wunused-variable]
Succesfully Connected!
Server reply was 5000000 bytes long
jaten@rog ~/go/src/github.com/wolfssl/go-wolfssl/examples/client (master) $ ./client
Succesfully Connected!
Server reply was 5000000 bytes long
jaten@rog ~/go/src/github.com/wolfssl/go-wolfssl/examples/client (master) $ ./client
Succesfully Connected!
Server reply was 5000000 bytes long
The text was updated successfully, but these errors were encountered:
After taking a look this, it looks like modifying client.go to read on a loop is all that's needed to get things working. Calling it once is all that was required for a simple TLS example, but for a connection where we're expecting a larger amount of data, the read should be called until no more bytes are able to be read, as shown below:
for {
buf := make([]byte, 5e6)
ret = wolfSSL.WolfSSL_read(ssl, buf, uintptr(len(buf)))
if ret == -1 {
fmt.Println(" wolfSSL_read failed ")
} else {
fmt.Printf("Server reply was %v bytes long and ret was %d\n", len(buf), ret)
}
if ret <= 0 {
break
}
}
See my fork here
https://github.com/glycerine/go-wolfssl
specifically at commit cd11bed (currently tip of master branch as of this writing).
Sometimes the server's reply of 65536 bytes fails on the first write. Other times it fails on the 2nd write.
To reproduce:
Run server:
In another terminal, run the client:
The text was updated successfully, but these errors were encountered: