• Home
  • Raw
  • Download

Lines Matching +full:test +full:- +full:sequencer

2  * lws-api-test-lws_sequencer
9 * This api test uses the lws_sequencer api to make five http client requests
32 * sequencer when that is created.
34 * You'd put everything your sequencer needs to do its job in here.
41 int state; /* which test we're on */
45 /* sequencer messages specific to this sequencer */
70 * This is the sequencer-aware http protocol handler. It monitors the client
71 * http action and queues messages for the sequencer when something definitive
93 s->http_resp = (int)lws_http_client_http_response(wsi); in callback_http()
94 lwsl_info("Connected with server response: %d\n", s->http_resp); in callback_http()
104 while (len--) in callback_http()
118 int lenx = sizeof(buffer) - LWS_PRE; in callback_http()
121 return -1; in callback_http()
153 * We only inform the sequencer of a definitive outcome for our step. in callback_http()
155 * So once we have informed it, we detach ourselves from the sequencer in callback_http()
156 * and the sequencer from ourselves. Wsi may want to live on but after in callback_http()
157 * we got our result and moved on to the next test or completed, the in callback_http()
158 * sequencer doesn't want to hear from it again. in callback_http()
164 s->cwsi = NULL; in callback_http()
172 { "seq-test-http", callback_http, 0, 0, 0, NULL, 0 },
185 lws_strncpy(uri, url_paths[s->state], sizeof(uri)); in sequencer_start_client()
201 lws_strncpy(&path[n], path1, sizeof(path) - 1); in sequencer_start_client()
207 i.vhost = s->vhost; in sequencer_start_client()
212 i.pwsi = &s->cwsi; in sequencer_start_client()
229 s->cwsi, prot, i.address, i.port, path); in sequencer_start_client()
235 * The sequencer callback handles queued sequencer messages in the order they
247 case LWSSEQ_CREATED: /* our sequencer just got started */ in sequencer_cb()
248 s->state = SEQ1; /* first thing we'll do is the first url */ in sequencer_cb()
253 * This sequencer is about to be destroyed. If we have any in sequencer_cb()
256 if (s->cwsi) in sequencer_cb()
257 lws_set_wsi_user(s->cwsi, NULL); in sequencer_cb()
263 if (s->state == SEQ4_TIMEOUT) { in sequencer_cb()
264 lwsl_user("%s: test %d got expected timeout\n", in sequencer_cb()
265 __func__, s->state); in sequencer_cb()
268 lwsl_user("%s: seq timed out at step %d\n", __func__, s->state); in sequencer_cb()
272 if (s->state == SEQ5_BAD_ADDRESS) { in sequencer_cb()
276 lwsl_user("%s: test %d failed as expected\n", in sequencer_cb()
277 __func__, s->state); in sequencer_cb()
281 lwsl_user("%s: seq failed at step %d\n", __func__, s->state); in sequencer_cb()
286 if (s->state >= SEQ4_TIMEOUT) { in sequencer_cb()
292 s->state); in sequencer_cb()
297 s->state, s->http_resp); in sequencer_cb()
301 s->state++; in sequencer_cb()
302 if (s->state == LWS_ARRAY_SIZE(url_paths)) { in sequencer_cb()
337 if ((p = lws_cmdline_option(argc, argv, "-d"))) in main()
370 * Create the sequencer... when the event loop starts, it will in main()
383 lwsl_err("%s: unable to create sequencer\n", __func__); in main()
386 s->vhost = vh; in main()