~ubuntu-branches/ubuntu/natty/curl/natty-security

« back to all changes in this revision

Viewing changes to lib/getinfo.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2010-06-20 13:56:28 UTC
  • mfrom: (3.4.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100620135628-e30tp9jldq6hq985
Tags: 7.21.0-1ubuntu1
* Merge from debian unstable.  Remaining changes: LP: #596334
  - Keep build deps in main:
    - Drop build dependencies: stunnel, libssh2-1-dev
    - Add build-dependency on openssh-server
    - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2010, 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: getinfo.c,v 1.68 2009-04-21 11:46:16 yangtse Exp $
22
21
 ***************************************************************************/
23
22
 
24
23
#include "setup.h"
67
66
  info->header_size = 0;
68
67
  info->request_size = 0;
69
68
  info->numconnects = 0;
 
69
 
 
70
  info->ip[0] = 0;
 
71
  info->port = 0;
 
72
  info->localip[0] = 0;
 
73
  info->localport = 0;
 
74
 
70
75
  return CURLE_OK;
71
76
}
72
77
 
225
230
    /* Return the ip address of the most recent (primary) connection */
226
231
    *param_charp = data->info.ip;
227
232
    break;
 
233
  case CURLINFO_PRIMARY_PORT:
 
234
    /* Return the (remote) port of the most recent (primary) connection */
 
235
    *param_longp = data->info.port;
 
236
    break;
 
237
  case CURLINFO_LOCAL_IP:
 
238
    /* Return the source/local ip address of the most recent (primary)
 
239
       connection */
 
240
    *param_charp = data->info.localip;
 
241
    break;
 
242
  case CURLINFO_LOCAL_PORT:
 
243
    /* Return the local port of the most recent (primary) connection */
 
244
    *param_longp = data->info.localport;
 
245
    break;
228
246
  case CURLINFO_CERTINFO:
229
247
    /* Return the a pointer to the certinfo struct. Not really an slist
230
248
       pointer but we can pretend it is here */
235
253
    /* return if the condition prevented the document to get transfered */
236
254
    *param_longp = data->info.timecond;
237
255
    break;
 
256
  case CURLINFO_RTSP_SESSION_ID:
 
257
    *param_charp = data->set.str[STRING_RTSP_SESSION_ID];
 
258
    break;
 
259
  case CURLINFO_RTSP_CLIENT_CSEQ:
 
260
    *param_longp = data->state.rtsp_next_client_CSeq;
 
261
    break;
 
262
  case CURLINFO_RTSP_SERVER_CSEQ:
 
263
    *param_longp = data->state.rtsp_next_server_CSeq;
 
264
    break;
 
265
  case CURLINFO_RTSP_CSEQ_RECV:
 
266
    *param_longp = data->state.rtsp_CSeq_recv;
 
267
    break;
 
268
 
238
269
  default:
239
270
    return CURLE_BAD_FUNCTION_ARGUMENT;
240
271
  }