jacquayj / GoRODS

Golang binding for iRODS C API: An iRODS client library written in Golang + C
https://godoc.org/github.com/jjacquay712/GoRODS
BSD 3-Clause "New" or "Revised" License
17 stars 5 forks source link

Bad file descriptor in rcDisconnect for iRODS HTTP Mount example #25

Closed jasoncoposky closed 7 years ago

jasoncoposky commented 7 years ago

I receive this error when attempting the http mount example when attempting browser access via chrome:

rcConnect.cpp:269:rcDisconnect :  status [SYS_HEADER_WRITE_LEN_ERR]  errno [Bad file descriptor]

This is from a fresh pull on commit 1c7b78add6b13f059de9fd533db51f80e9de3dec with go1.7.3

jjacquay712 commented 7 years ago

Hi Jason,

Thanks for the bug report. I've resolved this issue by removing the Disconnect() call as a temporary fix, however I'll need to go back and figure out why that error is occurring in the first place. Will report back with a proper fix soon.

Thanks, John

jjacquay712 commented 7 years ago

It appears that this bug was introduced in 1c7b78a because Disconnect() was being called twice. Once by the ServeHTTP function, and also by Client.OpenCollection, after it's anonymous function was run.

The 1e9ae28 commit should provide the proper resolution. Thanks again for catching this issue.

John