~ubuntu-branches/ubuntu/raring/curl/raring-updates

« back to all changes in this revision

Viewing changes to lib/sendf.c

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2011-11-13 21:07:32 UTC
  • mto: (3.6.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: package-import@ubuntu.com-20111113210732-bk5n25x2tu7aplur
Tags: upstream-7.22.0
ImportĀ upstreamĀ versionĀ 7.22.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "setup.h"
24
24
 
25
 
#include <stdio.h>
26
 
#include <stdarg.h>
27
 
#include <stdlib.h>
28
 
#include <errno.h>
29
 
 
30
25
#ifdef HAVE_SYS_SOCKET_H
31
26
#include <sys/socket.h> /* required for send() & recv() prototypes */
32
27
#endif
55
50
#define Curl_sec_read(a,b,c,d) -1
56
51
#endif
57
52
 
58
 
#include <string.h>
59
53
#include "curl_memory.h"
60
54
#include "strerror.h"
61
55
 
79
73
    return(size);
80
74
  }
81
75
 
82
 
  if(data->state.prev_block_had_trailing_cr == TRUE) {
 
76
  if(data->state.prev_block_had_trailing_cr) {
83
77
    /* The previous block of incoming data
84
78
       had a trailing CR, which was turned into a LF. */
85
79
    if(*startPtr == '\n') {
533
527
 * Returns a regular CURLcode value.
534
528
 */
535
529
CURLcode Curl_read(struct connectdata *conn, /* connection data */
536
 
              curl_socket_t sockfd,     /* read from this socket */
537
 
              char *buf,                /* store read data here */
538
 
              size_t sizerequested,     /* max amount to read */
539
 
              ssize_t *n)               /* amount bytes read */
 
530
                   curl_socket_t sockfd,     /* read from this socket */
 
531
                   char *buf,                /* store read data here */
 
532
                   size_t sizerequested,     /* max amount to read */
 
533
                   ssize_t *n)               /* amount bytes read */
540
534
{
541
535
  CURLcode curlcode = CURLE_RECV_ERROR;
542
536
  ssize_t nread = 0;
543
537
  size_t bytesfromsocket = 0;
544
538
  char *buffertofill = NULL;
545
 
  bool pipelining = (bool)(conn->data->multi &&
546
 
                     Curl_multi_canPipeline(conn->data->multi));
 
539
  bool pipelining = (conn->data->multi &&
 
540
                     Curl_multi_canPipeline(conn->data->multi)) ? TRUE : FALSE;
547
541
 
548
542
  /* Set 'num' to 0 or 1, depending on which socket that has been sent here.
549
543
     If it is the second socket, we set num to 1. Otherwise to 0. This lets