Skip to content

fixing the case where sent == 0 (#320) - #321

Merged
kazu-yamamoto merged 3 commits into
haskell:2.7from
kazu-yamamoto:sendall
May 29, 2018
Merged

kazu-yamamoto merged 3 commits into
haskell:2.7from
kazu-yamamoto:sendall

Conversation

@kazu-yamamoto

Copy link
Copy Markdown
Collaborator

This fixes #320.

@kazu-yamamoto
kazu-yamamoto requested review from Mistuke and eborden May 25, 2018 05:50

@Mistuke Mistuke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@Mistuke

Mistuke commented May 25, 2018

Copy link
Copy Markdown
Collaborator

although threadWaitWrite requires -threaded on Windows. Which I think wasn't a requirement before for network right? Not sure what a proper solution for the non-threaded case would be.

As a side note, I am currently almost done implementing a new I/O manager for Windows, which will land within the next two GHC releases. This moves everything to IOCP, at that time I will need to submit network patches for those bits.

The fd interface will still be available for a while though.

@kazu-yamamoto

Copy link
Copy Markdown
Collaborator Author

although threadWaitWrite requires -threaded on Windows. Which I think wasn't a requirement before for network right? Not sure what a proper solution for the non-threaded case would be.

Is threadWaitWrite harmful for non-threaded RTS on Windows?
If not, I would merge this PR as is.

@Mistuke

Mistuke commented May 28, 2018

Copy link
Copy Markdown
Collaborator

Yes, on the non-threaded RTS it's a hard error https://hackage.haskell.org/package/base-4.7.0.0/docs/src/Control-Concurrent.html#threadWaitWrite, so you wouldn't be able to use network anymore with the non-threaded rts.

@kazu-yamamoto

Copy link
Copy Markdown
Collaborator Author

@Mistuke I pushed one commit. Would you review this PR again.

@Mistuke Mistuke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the import of c_writev on Windows breaks the build, looks like you don't need it anyway so removing it should do.

other than that the changes look good.


import Network.Socket (Socket(..))
import qualified Network.Socket.ByteString as Socket
import Network.Socket.ByteString.Internal (c_writev, waitWhen0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c_writev doesn't exists for Windows.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. And done.

@Mistuke Mistuke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

kazu-yamamoto added a commit to kazu-yamamoto/network that referenced this pull request May 29, 2018
@kazu-yamamoto
kazu-yamamoto merged commit 3de0e8c into haskell:2.7 May 29, 2018
@kazu-yamamoto
kazu-yamamoto deleted the sendall branch May 29, 2018 00:58
@kazu-yamamoto

Copy link
Copy Markdown
Collaborator Author

Merged. Thanks!

@jaspervdj

Copy link
Copy Markdown
Member

I think this change caused jaspervdj/websockets#180, I'll see if I can put together a small test case.

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.

3 participants