Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
schannel_recv: return the correct code
Bug: http://curl.haxx.se/bug/view.cgi?id=1462 Reported-by: Tae Hyoung Ahn
- Loading branch information
145c263
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the behavior of curl_easy_recv when there is no data to receive on the socket. Before this change, curl_easy_recv would return CURLE_AGAIN. Now it returns CURLE_OK with 0 bytes received, as if the socket has been closed.
145c263
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Do you have a suggested fix too?
145c263
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that it would have returned CURLE_AGAIN before. That only happens on SEC_E_INCOMPLETE_MESSAGE. But I guess a solution could be to add
*err = CURLE_AGAIN;
right after the newret = 0;
within the same condition. I will test it this week.145c263
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, I was talking about the resultant change in behavior to
curl_easy_recv
. This change also causesschannel_recv
to return0
with*err == CURLE_AGAIN
. The return of0
(and not-1
, as before) in turn causescurl_easy_recv
to returnCURLE_OK
instead of the expectedCURLE_AGAIN
.My proposed fix: