import React, { Component } from 'react' import classnames from 'classnames' import { RequestUtils, ResponseUtils } from '../../flow/utils.js' import { formatSize, formatTimeDelta } from '../../utils.js' export function TLSColumn({ flow }) { return ( ) } TLSColumn.headerClass = 'col-tls' TLSColumn.headerName = '' export function IconColumn({ flow }) { return (
) } IconColumn.headerClass = 'col-icon' IconColumn.headerName = '' IconColumn.getIcon = flow => { if (!flow.response) { return 'resource-icon-plain' } var contentType = ResponseUtils.getContentType(flow.response) || '' // @todo We should assign a type to the flow somewhere else. if (flow.response.status_code === 304) { return 'resource-icon-not-modified' } if (300 <= flow.response.status_code && flow.response.status_code < 400) { return 'resource-icon-redirect' } if (contentType.indexOf('image') >= 0) { return 'resource-icon-image' } if (contentType.indexOf('javascript') >= 0) { return 'resource-icon-js' } if (contentType.indexOf('css') >= 0) { return 'resource-icon-css' } if (contentType.indexOf('html') >= 0) { return 'resource-icon-document' } return 'resource-icon-plain' } export function PathColumn({ flow }) { return ( {flow.request.is_replay && ( )} {flow.intercepted && ( )} {RequestUtils.pretty_url(flow.request)} ) } PathColumn.headerClass = 'col-path' PathColumn.headerName = 'Path' export function MethodColumn({ flow }) { return ( {flow.request.method} ) } MethodColumn.headerClass = 'col-method' MethodColumn.headerName = 'Method' export function StatusColumn({ flow }) { return ( {flow.response && flow.response.status_code} ) } StatusColumn.headerClass = 'col-status' StatusColumn.headerName = 'Status' export function SizeColumn({ flow }) { return ( {formatSize(SizeColumn.getTotalSize(flow))} ) } SizeColumn.getTotalSize = flow => { let total = flow.request.contentLength if (flow.response) { total += flow.response.contentLength || 0 } return total } SizeColumn.headerClass = 'col-size' SizeColumn.headerName = 'Size' export function TimeColumn({ flow }) { return ( {flow.response ? ( formatTimeDelta(1000 * (flow.response.timestamp_end - flow.request.timestamp_start)) ) : ( '...' )} ) } TimeColumn.headerClass = 'col-time' TimeColumn.headerName = 'Time' export default [ TLSColumn, IconColumn, PathColumn, MethodColumn, StatusColumn, SizeColumn, TimeColumn, ] cgit/xen/xen/plain/tools/libxen/Makefile.dist?h=4.1.1-rc2&id=f49717baeabf71c2e93ad7bac0c5989a6cf37354'>plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# Copyright (c) 2006-2007, XenSource Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#

MAJOR = 1.0
MINOR = 0

CFLAGS = -Iinclude                     \
         $(shell xml2-config --cflags) \
         $(shell curl-config --cflags) \
         -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC

LDFLAGS = $(shell xml2-config --libs) \
          $(shell curl-config --libs)

# -h for Solaris
SONAME_LDFLAG ?= -soname
# -R /usr/sfw/$(LIBDIR) -shared for Solaris
SHLIB_CFLAGS ?= -shared

# ginstall for Solaris
INSTALL      = install
INSTALL_DIR  = $(INSTALL) -d -m0755 -p
INSTALL_DATA = $(INSTALL) -m0644 -p

LIBXENAPI_HDRS = $(wildcard include/*.h)
LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))

TEST_PROGRAMS = test/test_bindings test/test_event_handling