~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to test/plugin/plugin_as_origin/http_connect_bridge.c

  • Committer: Bazaar Package Importer
  • Author(s): Arno Toell
  • Date: 2011-01-13 11:49:18 UTC
  • Revision ID: james.westby@ubuntu.com-20110113114918-vu422h8dknrgkj15
Tags: upstream-2.1.5-unstable
ImportĀ upstreamĀ versionĀ 2.1.5-unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
2
 
 
3
  A brief file description
 
4
 
 
5
  @section license License
 
6
 
 
7
  Licensed to the Apache Software Foundation (ASF) under one
 
8
  or more contributor license agreements.  See the NOTICE file
 
9
  distributed with this work for additional information
 
10
  regarding copyright ownership.  The ASF licenses this file
 
11
  to you under the Apache License, Version 2.0 (the
 
12
  "License"); you may not use this file except in compliance
 
13
  with the License.  You may obtain a copy of the License at
 
14
 
 
15
      http://www.apache.org/licenses/LICENSE-2.0
 
16
 
 
17
  Unless required by applicable law or agreed to in writing, software
 
18
  distributed under the License is distributed on an "AS IS" BASIS,
 
19
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
20
  See the License for the specific language governing permissions and
 
21
  limitations under the License.
 
22
 */
 
23
 
 
24
/*   http_connect_bridge.c - Test program for TSHttpConnect() interface.
 
25
 *     Listens on a port and forwards all traffic to http system
 
26
 *     allowing the use all existing test & load tools
 
27
 *
 
28
 *
 
29
 */
 
30
 
 
31
#include <stdio.h>
 
32
#include <string.h>
 
33
#include <ctype.h>
 
34
#include <limits.h>
 
35
#include "ts.h"
 
36
#include <sys/types.h>
 
37
#include <sys/stat.h>
 
38
#include <fcntl.h>
 
39
#include <errno.h>
 
40
 
 
41
#define DEBUG_TAG "http_connect_bridge-dbg"
 
42
/* #define DEBUG 1 */
 
43
 
 
44
/**************************************************
 
45
   Log macros for error code return verification
 
46
**************************************************/
 
47
#define PLUGIN_NAME "http_connect_bridge"
 
48
#define VALID_POINTER(X) ((X != NULL) && (X != TS_ERROR_PTR))
 
49
#define LOG_SET_FUNCTION_NAME(NAME) const char * FUNCTION_NAME = NAME
 
50
#define LOG_ERROR(API_NAME) { \
 
51
    TSDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "APIFAIL", \
 
52
             FUNCTION_NAME, __FILE__, __LINE__); \
 
53
}
 
54
#define LOG_ERROR_NEG(API_NAME) { \
 
55
    TSDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "NEGAPIFAIL", \
 
56
             FUNCTION_NAME, __FILE__, __LINE__); \
 
57
}
 
58
#define LOG_ERROR_AND_RETURN(API_NAME) { \
 
59
    LOG_ERROR(API_NAME); \
 
60
    return -1; \
 
61
}
 
62
#define LOG_ERROR_AND_CLEANUP(API_NAME) { \
 
63
  LOG_ERROR(API_NAME); \
 
64
  goto Lcleanup; \
 
65
}
 
66
#define LOG_ERROR_AND_REENABLE(API_NAME) { \
 
67
  LOG_ERROR(API_NAME); \
 
68
  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE); \
 
69
}
 
70
 
 
71
/* Global variables */
 
72
TSAction *accept_action;
 
73
static int plugin_port = 2499;
 
74
static unsigned int plugin_ip = 0;
 
75
 
 
76
/* static char* doc_buf = NULL; */
 
77
/* static int   doc_size; */
 
78
 
 
79
struct pvc_state_t
 
80
{
 
81
 
 
82
  TSVConn http_vc;
 
83
  TSVIO h_read_vio;
 
84
  TSVIO h_write_vio;
 
85
 
 
86
  TSVConn net_vc;
 
87
  TSVIO n_read_vio;
 
88
  TSVIO n_write_vio;
 
89
 
 
90
  TSIOBuffer req_buffer;
 
91
  TSIOBufferReader req_reader;
 
92
 
 
93
  TSIOBuffer resp_buffer;
 
94
  TSIOBufferReader resp_reader;
 
95
 
 
96
  int req_finished;
 
97
  int resp_finished;
 
98
 
 
99
};
 
100
typedef struct pvc_state_t pvc_state;
 
101
 
 
102
static void
 
103
pvc_cleanup(TSCont contp, pvc_state * my_state)
 
104
{
 
105
  LOG_SET_FUNCTION_NAME("pvc_cleanup");
 
106
 
 
107
  if (my_state->req_buffer) {
 
108
    if (TSIOBufferDestroy(my_state->req_buffer) == TS_ERROR) {
 
109
      LOG_ERROR("TSIOBufferDestroy");
 
110
    }
 
111
    my_state->req_buffer = NULL;
 
112
  }
 
113
 
 
114
  if (my_state->resp_buffer) {
 
115
    if (TSIOBufferDestroy(my_state->resp_buffer) == TS_ERROR) {
 
116
      LOG_ERROR("TSIOBufferDestroy");
 
117
    }
 
118
    my_state->resp_buffer = NULL;
 
119
  }
 
120
 
 
121
  TSfree(my_state);
 
122
  if (TSContDestroy(contp) == TS_ERROR) {
 
123
    LOG_ERROR("TSContDestroy");
 
124
  }
 
125
}
 
126
 
 
127
static void
 
128
pvc_check_done(TSCont contp, pvc_state * my_state)
 
129
{
 
130
  LOG_SET_FUNCTION_NAME("pvc_check_done");
 
131
 
 
132
  if (my_state->req_finished && my_state->resp_finished) {
 
133
    if (TSVConnClose(my_state->http_vc) == TS_ERROR) {
 
134
      LOG_ERROR("TSVConnClose");
 
135
    }
 
136
    if (TSVConnClose(my_state->net_vc) == TS_ERROR) {
 
137
      LOG_ERROR("TSVConnClose");
 
138
    }
 
139
    pvc_cleanup(contp, my_state);
 
140
  }
 
141
}
 
142
 
 
143
static void
 
144
pvc_process_n_read(TSCont contp, TSEvent event, pvc_state * my_state)
 
145
{
 
146
  LOG_SET_FUNCTION_NAME("pvc_process_n_read");
 
147
 
 
148
  int bytes;
 
149
 
 
150
  TSDebug(DEBUG_TAG, "plugin called: pvc_process_n_read with event %d", event);
 
151
 
 
152
  switch (event) {
 
153
  case TS_EVENT_VCONN_READ_READY:
 
154
    if (TSVIOReenable(my_state->h_write_vio) == TS_ERROR) {
 
155
      LOG_ERROR("TSVIOReenable");
 
156
    }
 
157
    break;
 
158
  case TS_EVENT_VCONN_READ_COMPLETE:
 
159
  case TS_EVENT_VCONN_EOS:
 
160
  case TS_EVENT_ERROR:
 
161
    {
 
162
      /* We're finished reading from the net vc */
 
163
      int ndone = TSVIONDoneGet(my_state->n_read_vio);
 
164
      int todo;
 
165
 
 
166
      if (ndone == TS_ERROR) {
 
167
        LOG_ERROR("TSVIONDoneGet");
 
168
      }
 
169
      my_state->n_read_vio = NULL;
 
170
      if (TSVIONBytesSet(my_state->h_write_vio, ndone) == TS_ERROR) {
 
171
        LOG_ERROR("TSVIONBytesSet");
 
172
      }
 
173
      if (TSVConnShutdown(my_state->net_vc, 1, 0) == TS_ERROR) {
 
174
        LOG_ERROR("TSVConnShutdown");
 
175
      }
 
176
 
 
177
      todo = TSVIONTodoGet(my_state->h_write_vio);
 
178
      if (todo == TS_ERROR) {
 
179
        LOG_ERROR("TSVIONTodoGet");
 
180
        /* Error so set it to 0 to cleanup */
 
181
        todo = 0;
 
182
      }
 
183
 
 
184
      if (todo == 0) {
 
185
        my_state->req_finished = 1;
 
186
        if (TSVConnShutdown(my_state->http_vc, 0, 1) == TS_ERROR) {
 
187
          LOG_ERROR("TSVConnShutdown");
 
188
        }
 
189
        pvc_check_done(contp, my_state);
 
190
      } else {
 
191
        if (TSVIOReenable(my_state->h_write_vio) == TS_ERROR) {
 
192
          LOG_ERROR("TSVIOReenable");
 
193
        }
 
194
      }
 
195
 
 
196
      break;
 
197
    }
 
198
  default:
 
199
    TSReleaseAssert(!"Unexpected Event");
 
200
    break;
 
201
  }
 
202
}
 
203
 
 
204
static void
 
205
pvc_process_h_write(TSCont contp, TSEvent event, pvc_state * my_state)
 
206
{
 
207
  LOG_SET_FUNCTION_NAME("pvc_process_h_write");
 
208
 
 
209
  int bytes;
 
210
 
 
211
  TSDebug(DEBUG_TAG, "plugin called: pvc_process_h_write with event %d", event);
 
212
 
 
213
  switch (event) {
 
214
  case TS_EVENT_VCONN_WRITE_READY:
 
215
    if (my_state->n_read_vio) {
 
216
      if (TSVIOReenable(my_state->n_read_vio) == TS_ERROR) {
 
217
        LOG_ERROR("TSVIOReenable");
 
218
      }
 
219
    }
 
220
    break;
 
221
  case TS_EVENT_ERROR:
 
222
    if (my_state->n_read_vio) {
 
223
      if (TSVConnShutdown(my_state->net_vc, 1, 0) == TS_ERROR) {
 
224
        LOG_ERROR("TSVConnShutdown");
 
225
      }
 
226
      my_state->n_read_vio = NULL;
 
227
    }
 
228
    /* FALL THROUGH */
 
229
  case TS_EVENT_VCONN_WRITE_COMPLETE:
 
230
    /* We should have already shutdown read pvc side */
 
231
    TSAssert(my_state->n_read_vio == NULL);
 
232
    if (TSVConnShutdown(my_state->http_vc, 0, 1) == TS_ERROR) {
 
233
      LOG_ERROR("TSVConnShutdown");
 
234
    }
 
235
    my_state->req_finished = 1;
 
236
    pvc_check_done(contp, my_state);
 
237
    break;
 
238
  default:
 
239
    TSReleaseAssert(!"Unexpected Event");
 
240
    break;
 
241
  }
 
242
}
 
243
 
 
244
static void
 
245
pvc_process_h_read(TSCont contp, TSEvent event, pvc_state * my_state)
 
246
{
 
247
  LOG_SET_FUNCTION_NAME("pvc_process_h_read");
 
248
 
 
249
  int bytes;
 
250
 
 
251
  TSDebug(DEBUG_TAG, "plugin called: pvc_process_h_read with event %d", event);
 
252
 
 
253
  switch (event) {
 
254
  case TS_EVENT_VCONN_READ_READY:
 
255
    if (TSVIOReenable(my_state->n_write_vio) == TS_ERROR) {
 
256
      LOG_ERROR("TSVIOReenable");
 
257
    }
 
258
    break;
 
259
  case TS_EVENT_VCONN_READ_COMPLETE:
 
260
  case TS_EVENT_VCONN_EOS:
 
261
  case TS_EVENT_ERROR:
 
262
    {
 
263
      /* We're finished reading from the http vc */
 
264
      int ndone;
 
265
      int todo;
 
266
 
 
267
      if ((ndone = TSVIONDoneGet(my_state->h_read_vio)) == TS_ERROR) {
 
268
        LOG_ERROR("TSVIONDoneGet");
 
269
      }
 
270
 
 
271
      my_state->h_read_vio = NULL;
 
272
      if (TSVIONBytesSet(my_state->n_write_vio, ndone) == TS_ERROR) {
 
273
        LOG_ERROR("TSVIONBytesSet");
 
274
      }
 
275
      if (TSVConnShutdown(my_state->http_vc, 1, 0) == TS_ERROR) {
 
276
        LOG_ERROR("TSVConnShutdown");
 
277
      }
 
278
 
 
279
      todo = TSVIONTodoGet(my_state->n_write_vio);
 
280
      if (todo == TS_ERROR) {
 
281
        LOG_ERROR("TSVIONTodoGet");
 
282
        /* Error so set it to 0 to cleanup */
 
283
        todo = 0;
 
284
      }
 
285
 
 
286
      if (todo == 0) {
 
287
        my_state->resp_finished = 1;
 
288
        if (TSVConnShutdown(my_state->net_vc, 0, 1) == TS_ERROR) {
 
289
          LOG_ERROR("TSVConnShutdown");
 
290
        }
 
291
        pvc_check_done(contp, my_state);
 
292
      } else {
 
293
        if (TSVIOReenable(my_state->n_write_vio) == TS_ERROR) {
 
294
          LOG_ERROR("TSVIOReenable");
 
295
        }
 
296
      }
 
297
 
 
298
      break;
 
299
    }
 
300
  default:
 
301
    TSReleaseAssert(!"Unexpected Event");
 
302
    break;
 
303
  }
 
304
}
 
305
 
 
306
static void
 
307
pvc_process_n_write(TSCont contp, TSEvent event, pvc_state * my_state)
 
308
{
 
309
  LOG_SET_FUNCTION_NAME("pvc_process_n_write");
 
310
 
 
311
  int bytes;
 
312
 
 
313
  TSDebug(DEBUG_TAG, "plugin called: pvc_process_n_write with event %d", event);
 
314
 
 
315
  switch (event) {
 
316
  case TS_EVENT_VCONN_WRITE_READY:
 
317
    if (my_state->h_read_vio) {
 
318
      if (TSVIOReenable(my_state->h_read_vio) == TS_ERROR) {
 
319
        LOG_ERROR("TSVIOReenable");
 
320
      }
 
321
    }
 
322
    break;
 
323
  case TS_EVENT_ERROR:
 
324
    if (my_state->h_read_vio) {
 
325
      if (TSVConnShutdown(my_state->http_vc, 1, 0) == TS_ERROR) {
 
326
        LOG_ERROR("TSVConnShutdown");
 
327
      }
 
328
      my_state->h_read_vio = NULL;
 
329
    }
 
330
    /* FALL THROUGH */
 
331
  case TS_EVENT_VCONN_WRITE_COMPLETE:
 
332
    /* We should have already shutdown read http side */
 
333
    TSAssert(my_state->h_read_vio == NULL);
 
334
    if (TSVConnShutdown(my_state->net_vc, 0, 1) == TS_ERROR) {
 
335
      LOG_ERROR("TSVConnShutdown");
 
336
    }
 
337
    my_state->resp_finished = 1;
 
338
    pvc_check_done(contp, my_state);
 
339
    break;
 
340
  default:
 
341
    TSReleaseAssert(!"Unexpected Event");
 
342
    break;
 
343
  }
 
344
}
 
345
 
 
346
static int
 
347
pvc_plugin(TSCont contp, TSEvent event, void *edata)
 
348
{
 
349
  LOG_SET_FUNCTION_NAME("pvc_plugin");
 
350
 
 
351
  pvc_state *my_state = TSContDataGet(contp);
 
352
  if (my_state == TS_ERROR_PTR) {
 
353
    LOG_ERROR("TSContDataGet");
 
354
  }
 
355
 
 
356
  if (edata == my_state->h_read_vio) {
 
357
    pvc_process_h_read(contp, event, my_state);
 
358
  } else if (edata == my_state->h_write_vio) {
 
359
    pvc_process_h_write(contp, event, my_state);
 
360
  } else if (edata == my_state->n_read_vio) {
 
361
    pvc_process_n_read(contp, event, my_state);
 
362
  } else if (edata == my_state->n_write_vio) {
 
363
    pvc_process_n_write(contp, event, my_state);
 
364
  } else {
 
365
    TSAssert(0);
 
366
  }
 
367
 
 
368
  return 0;
 
369
}
 
370
 
 
371
static void
 
372
pvc_process_accept(TSVConn net_vc)
 
373
{
 
374
  LOG_SET_FUNCTION_NAME("pvc_process_accept");
 
375
 
 
376
  TSMutex mutexp;
 
377
  TSCont contp;
 
378
  pvc_state *my_state = (pvc_state *) TSmalloc(sizeof(pvc_state));
 
379
  unsigned int remote_ip;
 
380
 
 
381
  mutexp = TSMutexCreate();
 
382
  if (mutexp == TS_ERROR_PTR) {
 
383
    LOG_ERROR("TSMutexCreate");
 
384
    return;
 
385
  }
 
386
  contp = TSContCreate(pvc_plugin, mutexp);
 
387
  if (contp == TS_ERROR_PTR) {
 
388
    LOG_ERROR("TSContCreate");
 
389
    return;
 
390
  }
 
391
 
 
392
  /* We need to lock the mutex to prevent I/O callbacks before
 
393
     we set everything up */
 
394
  if (TSMutexLock(mutexp) == TS_ERROR) {
 
395
    LOG_ERROR("TSMutexLock");
 
396
  }
 
397
 
 
398
  my_state->net_vc = net_vc;
 
399
 
 
400
  my_state->req_finished = 0;
 
401
  my_state->resp_finished = 0;
 
402
 
 
403
  my_state->req_buffer = TSIOBufferCreate();
 
404
  my_state->req_reader = TSIOBufferReaderAlloc(my_state->req_buffer);
 
405
  my_state->resp_buffer = TSIOBufferCreate();
 
406
  my_state->resp_reader = TSIOBufferReaderAlloc(my_state->resp_buffer);
 
407
  if ((my_state->req_buffer == TS_ERROR_PTR) || (my_state->req_reader == TS_ERROR_PTR) ||
 
408
      (my_state->resp_buffer == TS_ERROR_PTR) || (my_state->resp_reader == TS_ERROR_PTR)) {
 
409
    if (TSVConnClose(my_state->net_vc) == TS_ERROR) {
 
410
      LOG_ERROR("TSVConnClose");
 
411
    }
 
412
    pvc_cleanup(contp, my_state);
 
413
    LOG_ERROR_AND_CLEANUP("TSIOBufferCreate || TSIOBufferReaderAlloc");
 
414
  }
 
415
 
 
416
  if (TSNetVConnRemoteIPGet(my_state->net_vc, &remote_ip) == TS_ERROR) {
 
417
    LOG_ERROR_AND_CLEANUP("TSNetVConnRemoteIPGet");
 
418
  }
 
419
/*     if (TSHttpConnect(ntohl(remote_ip), 0, &(my_state->http_vc)) == TS_ERROR) { */
 
420
/*      LOG_ERROR_AND_CLEANUP("TSHttpConnect"); */
 
421
/*     } */
 
422
  if (TSHttpConnect(remote_ip, plugin_port, &(my_state->http_vc)) == TS_ERROR) {
 
423
    LOG_ERROR_AND_CLEANUP("TSHttpConnect");
 
424
  }
 
425
 
 
426
/* Negative test for TSHttpConnect */
 
427
#ifdef DEBUG
 
428
  if (TSHttpConnect(plugin_ip, plugin_port, NULL) != TS_ERROR) {
 
429
    LOG_ERROR_NEG("TSHttpConnect");
 
430
  }
 
431
#endif
 
432
 
 
433
  if (TSContDataSet(contp, my_state) == TS_ERROR) {
 
434
    LOG_ERROR_AND_CLEANUP("TSHttpConnect");
 
435
  }
 
436
 
 
437
  my_state->h_read_vio = TSVConnRead(my_state->http_vc, contp, my_state->resp_buffer, INT64_MAX);
 
438
  if (my_state->h_read_vio == TS_ERROR_PTR) {
 
439
    LOG_ERROR_AND_CLEANUP("TSVConnRead");
 
440
  }
 
441
  my_state->h_write_vio = TSVConnWrite(my_state->http_vc, contp, my_state->req_reader, INT64_MAX);
 
442
  if (my_state->h_write_vio == TS_ERROR_PTR) {
 
443
    LOG_ERROR_AND_CLEANUP("TSVConnWrite");
 
444
  }
 
445
 
 
446
  my_state->n_read_vio = TSVConnRead(my_state->net_vc, contp, my_state->req_buffer, INT64_MAX);
 
447
  if (my_state->n_read_vio == TS_ERROR_PTR) {
 
448
    LOG_ERROR_AND_CLEANUP("TSVConnRead");
 
449
  }
 
450
  my_state->n_write_vio = TSVConnWrite(my_state->net_vc, contp, my_state->resp_reader, INT64_MAX);
 
451
  if (my_state->n_write_vio == TS_ERROR_PTR) {
 
452
    LOG_ERROR_AND_CLEANUP("TSVConnWrite");
 
453
  }
 
454
 
 
455
Lcleanup:
 
456
  if (TSMutexUnlock(mutexp) == TS_ERROR) {
 
457
    LOG_ERROR("TSMutexUnlock");
 
458
  }
 
459
}
 
460
 
 
461
 
 
462
static int
 
463
accept_func(TSCont contp, TSEvent event, void *edata)
 
464
{
 
465
  LOG_SET_FUNCTION_NAME("accept_func");
 
466
 
 
467
  switch (event) {
 
468
  case TS_EVENT_NET_ACCEPT:
 
469
    pvc_process_accept((TSVConn) edata);
 
470
    break;
 
471
 
 
472
  case TS_EVENT_NET_ACCEPT_FAILED:
 
473
    LOG_ERROR("TS_EVENT_NET_ACCEPT_FAILED");
 
474
    TSError("Accept failed\n");
 
475
    break;
 
476
 
 
477
  default:
 
478
    TSDebug(PLUGIN_NAME, "Bad event %d", event);
 
479
    TSReleaseAssert(!"Unexpected event");
 
480
    break;
 
481
  }
 
482
 
 
483
  return 0;
 
484
}
 
485
 
 
486
int
 
487
check_ts_version()
 
488
{
 
489
 
 
490
  const char *ts_version = TSTrafficServerVersionGet();
 
491
  int result = 0;
 
492
 
 
493
  if (ts_version) {
 
494
    int major_ts_version = 0;
 
495
    int minor_ts_version = 0;
 
496
    int patch_ts_version = 0;
 
497
 
 
498
    if (sscanf(ts_version, "%d.%d.%d", &major_ts_version, &minor_ts_version, &patch_ts_version) != 3) {
 
499
      return 0;
 
500
    }
 
501
 
 
502
    /* Since this is an TS-SDK 2.0 plugin, we need at
 
503
       least Traffic Server 2.0 to run */
 
504
    if (major_ts_version >= 2) {
 
505
      result = 1;
 
506
    }
 
507
  }
 
508
 
 
509
  return result;
 
510
}
 
511
 
 
512
void
 
513
TSPluginInit(int argc, const char *argv[])
 
514
{
 
515
  LOG_SET_FUNCTION_NAME("TSPluginInit");
 
516
 
 
517
  TSMLoc field_loc;
 
518
  const char *p;
 
519
  int i;
 
520
  TSPluginRegistrationInfo info;
 
521
  TSCont accept_cont;
 
522
  TSMutex mutex;
 
523
  int port;
 
524
 
 
525
  info.plugin_name = "test-pos";
 
526
  info.vendor_name = "MyCompany";
 
527
  info.support_email = "ts-api-support@MyCompany.com";
 
528
 
 
529
  if (!TSPluginRegister(TS_SDK_VERSION_3_0, &info)) {
 
530
    TSError("Plugin registration failed.\n");
 
531
  }
 
532
 
 
533
  if (!check_ts_version()) {
 
534
    TSError("Plugin requires Traffic Server 3.0 or later\n");
 
535
    return;
 
536
  }
 
537
 
 
538
  if (argc != 2) {
 
539
    TSError("No accept port specified\n");
 
540
    return;
 
541
  }
 
542
  port = atoi(argv[1]);
 
543
 
 
544
  if (port <= 0) {
 
545
    TSError("Bad port specified\n");
 
546
  } else if (port <= 1024) {
 
547
    TSError("Priveledged port specified\n");
 
548
  }
 
549
 
 
550
  mutex = TSMutexCreate();
 
551
  if (mutex == TS_ERROR_PTR) {
 
552
    LOG_ERROR("TSMutexCreate");
 
553
    return;
 
554
  }
 
555
  accept_cont = TSContCreate(accept_func, mutex);
 
556
  if (accept_cont == TS_ERROR_PTR) {
 
557
    LOG_ERROR("TSContCreate");
 
558
    return;
 
559
  }
 
560
  accept_action = TSNetAccept(accept_cont, port);
 
561
  if (accept_action == TS_ERROR_PTR) {
 
562
    LOG_ERROR("TSNetAccept");
 
563
    return;
 
564
  }
 
565
}