mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
nss: give PR_INTERVAL_NO_WAIT instead of -1 to PR_Recv/PR_Send
Reported by: David Strauss Bug: http://curl.haxx.se/mail/lib-2013-05/0088.html
This commit is contained in:
parent
a45e3f93e4
commit
01a2abedd7
11
lib/nss.c
11
lib/nss.c
@ -1482,10 +1482,8 @@ static ssize_t nss_send(struct connectdata *conn, /* connection data */
|
|||||||
size_t len, /* amount to write */
|
size_t len, /* amount to write */
|
||||||
CURLcode *curlcode)
|
CURLcode *curlcode)
|
||||||
{
|
{
|
||||||
int rc;
|
ssize_t rc = PR_Send(conn->ssl[sockindex].handle, mem, (int)len, 0,
|
||||||
|
PR_INTERVAL_NO_WAIT);
|
||||||
rc = PR_Send(conn->ssl[sockindex].handle, mem, (int)len, 0, -1);
|
|
||||||
|
|
||||||
if(rc < 0) {
|
if(rc < 0) {
|
||||||
PRInt32 err = PR_GetError();
|
PRInt32 err = PR_GetError();
|
||||||
if(err == PR_WOULD_BLOCK_ERROR)
|
if(err == PR_WOULD_BLOCK_ERROR)
|
||||||
@ -1513,9 +1511,8 @@ static ssize_t nss_recv(struct connectdata * conn, /* connection data */
|
|||||||
size_t buffersize, /* max amount to read */
|
size_t buffersize, /* max amount to read */
|
||||||
CURLcode *curlcode)
|
CURLcode *curlcode)
|
||||||
{
|
{
|
||||||
ssize_t nread;
|
ssize_t nread = PR_Recv(conn->ssl[num].handle, buf, (int)buffersize, 0,
|
||||||
|
PR_INTERVAL_NO_WAIT);
|
||||||
nread = PR_Recv(conn->ssl[num].handle, buf, (int)buffersize, 0, -1);
|
|
||||||
if(nread < 0) {
|
if(nread < 0) {
|
||||||
/* failed SSL read */
|
/* failed SSL read */
|
||||||
PRInt32 err = PR_GetError();
|
PRInt32 err = PR_GetError();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user