nth_client.c File Reference


Detailed Description

HTTP Client implementhtion.

Copyright (c) 2002 Nokia Research Center. All rights reserved.

This source file has been divided into following sections: 1) engine 2) tport handling 3) client transactions

Author:
Pekka Pessi <Pekka.Pessi@nokia-email.address.hidden>
Date:
Created: Tue Jun 13 02:57:51 2000 ppessi

#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <errno.h>
#include <sofia-sip/string0.h>
#include "sofia-sip/nth.h"
#include <sofia-sip/http_header.h>
#include <sofia-sip/http_tag.h>
#include <sofia-sip/http_status.h>
#include <sofia-sip/hostdomain.h>
#include <sofia-sip/msg_addr.h>
#include <sofia-sip/su_tagarg.h>
#include <sofia-sip/auth_client.h>
#include <sofia-sip/tport.h>
#include <sofia-sip/htable.h>
#include <sofia-sip/su_debug.h>

Include dependency graph for nth_client.c:


Defines

#define NTH_INTERNAL_MSG
 http_flag telling that this message is internally generated.

Functions

msg_tnth_engine_msg_create (nth_engine_t *he, int flags)
 Create a new message.
void nth_client_destroy (nth_client_t *hc)
 Destroy client request.
int nth_client_status (nth_client_t const *hc)
 Gets client status.
http_method_t nth_client_method (nth_client_t const *hc)
 Gets client method.
url_t const * nth_client_url (nth_client_t const *hc)
 Get original Request-URI.
msg_tnth_client_request (nth_client_t *hc)
 Get request message.
msg_tnth_client_response (nth_client_t const *hc)
 Get response message.
int nth_client_is_streaming (nth_client_t const *hc)
 Is client streaming response?

Variables

char const NTH_DEBUG []
 Environment variable determining the debug log level for nth module.
su_log_t nth_client_log []
 Debug log for nth module.
tagi_t nth_client_tags []
 List of all nth tags.

Define Documentation

#define NTH_INTERNAL_MSG

http_flag telling that this message is internally generated.


Function Documentation

void nth_client_destroy ( nth_client_t hc  ) 

Destroy client request.

http_method_t nth_client_method ( nth_client_t const *  hc  ) 

Gets client method.

Parameters:
hc pointer to a nth client object
Returns:
Returns the HTTP method from the request. If hc is NULL, returns http_method_invalid.

msg_t* nth_client_request ( nth_client_t hc  ) 

Get request message.

msg_t* nth_client_response ( nth_client_t const *  hc  ) 

Get response message.

int nth_client_status ( nth_client_t const *  hc  ) 

Gets client status.

Parameters:
hc pointer to a nth client object
Returns:
Returns the status code from the response message if it has been received. A status code below 100 indicates that no response has been received. If request timeouts, the connection is closed and the status code is set to 408. If hc is NULL, returns 400 (Bad Request).

msg_t* nth_engine_msg_create ( nth_engine_t he,
int  flags 
)

Create a new message.


Variable Documentation

su_log_t nth_client_log[]

Debug log for nth module.

The nth_client_log is the log object used by nth client. The level of nth_client_log is set using NTH_DEBUG environment variable.

NTH_DEBUG

Environment variable determining the debug log level for nth module.

The NTH_DEBUG environment variable is used to determine the debug logging level for nth module. The default level is 1.

See also:
<su_debug.h>, nth_client_log, SOFIA_DEBUG


Sofia-SIP 1.12.6 - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.