~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to lib/qssl.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-05-26 18:58:51 UTC
  • mfrom: (3.3.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090526185851-t1gun9nboi5kbd9u
Tags: 7.19.5-1ubuntu1
* Merge from Debian unstable (LP: #380281), remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* Fixes LP: #379477

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: qssl.c,v 1.13 2008-05-20 10:21:50 patrickm Exp $
 
21
 * $Id: qssl.c,v 1.17 2009-04-21 11:46:17 yangtse Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
27
27
#include <qsossl.h>
28
28
#include <errno.h>
29
29
#include <string.h>
 
30
#ifdef HAVE_LIMITS_H
 
31
#  include <limits.h>
 
32
#endif
30
33
 
31
34
#include <curl/curl.h>
32
35
#include "urldata.h"
35
38
#include "sslgen.h"
36
39
#include "connect.h" /* for the connect timeout */
37
40
#include "select.h"
38
 
#include "memory.h"
 
41
#include "curl_memory.h"
39
42
/* The last #include file should be: */
40
43
#include "memdebug.h"
41
44
 
419
422
  char error_buffer[120]; /* OpenSSL documents that this must be at
420
423
                             least 120 bytes long. */
421
424
  unsigned long sslerror;
 
425
  int buffsize;
422
426
  int nread;
423
427
 
424
 
  nread = SSL_Read(conn->ssl[num].handle, buf, (int) buffersize);
 
428
  buffsize = (buffersize > (size_t)INT_MAX) ? INT_MAX : (int)buffersize;
 
429
  nread = SSL_Read(conn->ssl[num].handle, buf, buffsize);
425
430
  *wouldblock = FALSE;
426
431
 
427
432
  if(nread < 0) {