Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.13.12 ]​[ nginx-1.12.2 ]​

0001 
0002 /*
0003  * Copyright (C) Igor Sysoev
0004  * Copyright (C) Nginx, Inc.
0005  */
0006 
0007 
0008 #ifndef _NGX_EVENT_CONNECT_H_INCLUDED_
0009 #define _NGX_EVENT_CONNECT_H_INCLUDED_
0010 
0011 
0012 #include <ngx_config.h>
0013 #include <ngx_core.h>
0014 #include <ngx_event.h>
0015 
0016 
0017 #define NGX_PEER_KEEPALIVE           1
0018 #define NGX_PEER_NEXT                2
0019 #define NGX_PEER_FAILED              4
0020 
0021 
0022 typedef struct ngx_peer_connection_s  ngx_peer_connection_t;
0023 
0024 typedef ngx_int_t (*ngx_event_get_peer_pt)(ngx_peer_connection_t *pc,
0025     void *data);
0026 typedef void (*ngx_event_free_peer_pt)(ngx_peer_connection_t *pc, void *data,
0027     ngx_uint_t state);
0028 typedef void (*ngx_event_notify_peer_pt)(ngx_peer_connection_t *pc,
0029     void *data, ngx_uint_t type);
0030 typedef ngx_int_t (*ngx_event_set_peer_session_pt)(ngx_peer_connection_t *pc,
0031     void *data);
0032 typedef void (*ngx_event_save_peer_session_pt)(ngx_peer_connection_t *pc,
0033     void *data);
0034 
0035 
0036 struct ngx_peer_connection_s {
0037     ngx_connection_t                *connection;
0038 
0039     struct sockaddr                 *sockaddr;
0040     socklen_t                        socklen;
0041     ngx_str_t                       *name;
0042 
0043     ngx_uint_t                       tries;
0044     ngx_msec_t                       start_time;
0045 
0046     ngx_event_get_peer_pt            get;
0047     ngx_event_free_peer_pt           free;
0048     ngx_event_notify_peer_pt         notify;
0049     void                            *data;
0050 
0051 #if (NGX_SSL || NGX_COMPAT)
0052     ngx_event_set_peer_session_pt    set_session;
0053     ngx_event_save_peer_session_pt   save_session;
0054 #endif
0055 
0056     ngx_addr_t                      *local;
0057 
0058     int                              type;
0059     int                              rcvbuf;
0060 
0061     ngx_log_t                       *log;
0062 
0063     unsigned                         cached:1;
0064     unsigned                         transparent:1;
0065 
0066                                      /* ngx_connection_log_error_e */
0067     unsigned                         log_error:2;
0068 
0069     NGX_COMPAT_BEGIN(2)
0070     NGX_COMPAT_END
0071 };
0072 
0073 
0074 ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc);
0075 ngx_int_t ngx_event_get_peer(ngx_peer_connection_t *pc, void *data);
0076 
0077 
0078 #endif /* _NGX_EVENT_CONNECT_H_INCLUDED_ */