[Libwebsockets] POST client

Karl Vogel karl.vogel at gmail.com
Fri Mar 6 14:32:09 CET 2020


On Fri, Mar 6, 2020 at 2:07 PM Andy Green <andy at warmcat.com> wrote:
> On 3/6/20 12:29 PM, Karl Vogel wrote:
> > I'm trying to issue a POST with a msgpack payload to fluent. However I'm
> > always getting back an error in the LWS_CALLBACK_CLIENT_CONNECTION_ERROR
> > callback with error message "HS: URI missing", while the post is
> > correctly being received by fluent and it's replying with an HTTP-200.
>
> So you are succeeding to "issue a POST...".
>
> > The LWS_CALLBACK_CLIENT_HTTP_WRITEABLE just does an lws_write of the
> > msgpack payload, with LWS_WRITE_HTTP_FINAL set. I am setting the
> > Content-Type and Content-Length headers in the handshake callback.
>
> As you mentioned above, your peer is getting it OK, so that part should
> be OK.
>
> > The callback sequence is:
> >  >>>>>>>>>>>>>> LWS_CALLBACK_PROTOCOL_INIT
> >  >>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_HTTP_BIND_PROTOCOL
> >  >>>>>>>>>>>>>> LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED
> >  >>>>>>>>>>>>>> LWS_CALLBACK_WSI_CREATE
> >  >>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER
> > setting headers
> >  >>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_HTTP_WRITEABLE
> >   writing payload 55 bytes
> >  >>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_CONNECTION_ERROR
> > LWS_CALLBACK_CLIENT_CONNECTION_ERROR: HS: URI missing
>
> HS: URI missing means there's a problem with lws interpreting the http
> response from the peer.  Specifically, lws wants to see
>
> "http/1.1 " or "http/1.0 "
>
> in what comes back; if it was an h2 connection it'd insist to see
> ":status" and give a different error if it was missing.

This is the wireshark capture:
----
POST /host/fa0993ea75c3 HTTP/1.1
Pragma: no-cache
Cache-Control: no-cache
Host: agent-server
Origin: http://agent-server
content-type: application/msgpack
content-length: 55

...time.^a.{.loadavg..load1.0.35.load15.0.52.load5.0.54HTTP/1.1 200 OK
Date: Thu, 05 Mar 2020 14:49:41 GMT
Content-Type: text/plain
Content-Length: 0
Connection: close
----

> You can crank up the lws logging by cmake .. -DCMAKE_BUILD_TYPE=DEBUG
> and give debug filter like 1151, it will show you a char-by-char attempt
> to parse what your peer sent back.

[2020/03/06 14:27:45:1392] I: Initial logging level 1151
[2020/03/06 14:27:45:1393] I: Libwebsockets version: 4.0.0 v4.0.0
[2020/03/06 14:27:45:1393] I: IPV6 compiled in and enabled
[2020/03/06 14:27:45:1393] I:  LWS_DEF_HEADER_LEN    : 4096
[2020/03/06 14:27:45:1393] I:  LWS_MAX_SMP           : 1
[2020/03/06 14:27:45:1393] I:  sizeof (*info)        : 680
[2020/03/06 14:27:45:1393] I:  SYSTEM_RANDOM_FILEPATH: '/dev/urandom'
[2020/03/06 14:27:45:1393] I:  HTTP2 support         : not configured
[2020/03/06 14:27:45:1394] D: _realloc: size 5944: context
[2020/03/06 14:27:45:1394] I: context created
[2020/03/06 14:27:45:1394] I: Using event loop: libevent
[2020/03/06 14:27:45:1394] I: Default ALPN advertisment: http/1.1
[2020/03/06 14:27:45:1394] I:  default timeout (secs): 20
[2020/03/06 14:27:45:1394] I:  Threads: 1 each 5 fds
[2020/03/06 14:27:45:1395] I:  mem: context:          5224 B (1128 ctx
+ (1 thr x 4096))
[2020/03/06 14:27:45:1395] I:  mem: http hdr size:   (4096 + 816), max count 5
[2020/03/06 14:27:45:1395] D: _realloc: size 40: fds table
[2020/03/06 14:27:45:1395] I:  mem: pollfd map:         40 B
[2020/03/06 14:27:45:1395] D: _realloc: size 40: lws_lookup
[2020/03/06 14:27:45:1395] I:  mem: platform fd map:    40 B
[2020/03/06 14:27:45:1395] I: elops_init_pt_event: loop 0x23762e0
[2020/03/06 14:27:45:1395] D: _realloc: size 720: event pipe wsi
[2020/03/06 14:27:45:1395] D: lws_role_transition: 0x23a0b30: wsistate
0x200, ops pipe
[2020/03/06 14:27:45:1396] D: event pipe fd 9
[2020/03/06 14:27:45:1396] D: __insert_wsi_socket_into_fds: 0x23a0b30:
tsi=0, sock=9, pos-in-fds=0
[2020/03/06 14:27:45:1396] I:  Compiled with OpenSSL support
[2020/03/06 14:27:45:1396] I:  SSL disabled: no
LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
[2020/03/06 14:27:45:1396] D: _realloc: size 656: create vhost
[2020/03/06 14:27:45:1396] D: _realloc: size 112: vhost-specific plugin table
[2020/03/06 14:27:45:1396] D: _realloc: size 24: same vh list
[2020/03/06 14:27:45:1396] I: Creating Vhost 'default' (serving
disabled), 1 protocols, IPv6 on
[2020/03/06 14:27:45:1396] I:  mem: per-conn:          720 bytes +
protocol rx buf
[2020/03/06 14:27:45:1397] I: lws_plat_drop_app_privileges: not changing group
[2020/03/06 14:27:45:1397] I: lws_plat_drop_app_privileges: not changing user
[2020/03/06 14:27:45:1397] I: lws_cancel_service
>>>>>>>>>>>>>> LWS_CALLBACK_EVENT_WAIT_CANCELLED
connecting to host agent-server port 9898
[2020/03/06 14:27:45:1399] I: lws_protocol_init
>>>>>>>>>>>>>> LWS_CALLBACK_PROTOCOL_INIT
[2020/03/06 14:27:45:1399] D: _realloc: size 720: client wsi
[2020/03/06 14:27:45:1399] D: lws_vhost_bind_wsi: vh default: wsi
none/none, count_bound_wsi 1
[2020/03/06 14:27:45:1399] D: lws_role_transition: 0x23976c0: wsistate
0x10000200, ops h1
[2020/03/06 14:27:45:1400] I: lws_client_connect_via_info: role binding to h1
[2020/03/06 14:27:45:1400] I: lws_client_connect_via_info: protocol
binding to http
[2020/03/06 14:27:45:1400] D: _realloc: size 8: user space
>>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_HTTP_BIND_PROTOCOL
[2020/03/06 14:27:45:1400] I: lws_client_connect_via_info: wsi
0x23976c0: h1 http entry
[2020/03/06 14:27:45:1400] D: _realloc: size 140: client stash
[2020/03/06 14:27:45:1400] I: lws_header_table_attach: wsi 0x23976c0:
ah (nil) (tsi 0, count = 0) in
[2020/03/06 14:27:45:1400] D: _realloc: size 816: ah struct
[2020/03/06 14:27:45:1400] D: _realloc: size 4096: ah data
[2020/03/06 14:27:45:1401] I: _lws_create_ah: created ah 0x239ba00
(size 4096): pool length 1
[2020/03/06 14:27:45:1401] I: lws_header_table_attach: did attach wsi
0x23976c0: ah 0x239ba00: count 1 (on exit)
[2020/03/06 14:27:45:1401] D: __lws_set_timeout: 0x23976c0: 10 secs, reason 25
[2020/03/06 14:27:45:1401] D: lws_http_client_connect_via_info2:
0x23976c0 (stash 0x23979c0)
[2020/03/06 14:27:45:1401] D: _realloc: size 13: strdup
[2020/03/06 14:27:45:1401] I: lws_client_connect_2_dnsreq: adding
active conn 0x23976c0
[2020/03/06 14:27:45:1401] D: lwsi_set_state(0x23976c0, 0x10000201)
[2020/03/06 14:27:45:1401] I: lws_client_connect_2_dnsreq: 0x23976c0:
lookup agent-server:9898
[2020/03/06 14:27:45:1406] I: lws_getaddrinfo46: getaddrinfo
'agent-server' says 0
[2020/03/06 14:27:45:1406] D: lws_client_connect_3_connect: result
0x23a0750 result->ai_next (nil)
[2020/03/06 14:27:45:1406] I: lws_client_connect_3_connect:
agent-server ipv6 2001:db8::1
[2020/03/06 14:27:45:1407] D: lws_client_connect_3_connect: 0x23976c0:
WAITING_CONNECT
[2020/03/06 14:27:45:1407] D: lwsi_set_state(0x23976c0, 0x10000202)
[2020/03/06 14:27:45:1407] D: __insert_wsi_socket_into_fds: 0x23976c0:
tsi=0, sock=10, pos-in-fds=1
[2020/03/06 14:27:45:1407] D: _lws_change_pollfd: wsi 0x23976c0: fd 10
events 1 -> 1
[2020/03/06 14:27:45:1407] D: __lws_set_timeout: 0x23976c0: 20 secs, reason 2
[2020/03/06 14:27:45:1410] D: lws_client_connect_3_connect: connect
says errno: 115
[2020/03/06 14:27:45:1410] D: _lws_change_pollfd: wsi 0x23976c0: fd 10
events 1 -> 5
[2020/03/06 14:27:45:1411] D: lws_client_connect_via_info: wsi
0x23976c0: adoption cb 19 to h1 http
>>>>>>>>>>>>>> LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED
[2020/03/06 14:27:45:1411] D: _lws_change_pollfd: wsi 0x23976c0: fd 10
events 5 -> 1
[2020/03/06 14:27:45:1411] I: lws_client_connect_3_connect: getsockopt
check: conn OK
[2020/03/06 14:27:45:1411] I: lws_client_connect_3_connect: Connection
started 0x23a0750
>>>>>>>>>>>>>> LWS_CALLBACK_WSI_CREATE
[2020/03/06 14:27:45:1411] I: lws_client_connect_4_established: wsi
0x23976c0: h1 http client created own conn (raw 0) vh default
[2020/03/06 14:27:45:1411] D: lwsi_set_state(0x23976c0, 0x10000012)
[2020/03/06 14:27:45:1412] D: __lws_set_timeout: 0x23976c0: 20 secs, reason 8
[2020/03/06 14:27:45:1412] D: _lws_change_pollfd: wsi 0x23976c0: fd 10
events 1 -> 1
[2020/03/06 14:27:45:1412] D: lwsi_set_state(0x23976c0, 0x10000013)
[2020/03/06 14:27:45:1412] D: __lws_set_timeout: 0x23976c0: 20 secs, reason 11
>>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER
[2020/03/06 14:27:45:1412] D: _lws_change_pollfd: wsi 0x23976c0: fd 10
events 1 -> 5
[2020/03/06 14:27:45:1412] D: _lws_change_pollfd: wsi 0x23976c0: fd 10
events 5 -> 5
[2020/03/06 14:27:45:1412] I: lws_client_socket_service: HANDSHAKE2:
0x23976c0: sending headers (wsistate 0x10000013), w sock 10
[2020/03/06 14:27:45:1413] D: body pending
[2020/03/06 14:27:45:1413] D: lwsi_set_state(0x23976c0, 0x10000014)
[2020/03/06 14:27:45:1413] D: __lws_set_timeout: 0x23976c0: 20 secs, reason 18
[2020/03/06 14:27:45:1413] D: _lws_change_pollfd: wsi 0x23976c0: fd 10
events 5 -> 1
[2020/03/06 14:27:45:1413] D: lws_handle_POLLOUT_event: 0x23976c0: non
mux: wsistate 0x10000014, ops h1
>>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_HTTP_WRITEABLE
writing payload 55 bytes
[2020/03/06 14:27:45:1414] I: lws_issue_raw: ssl_capable_write (55) says 55
[2020/03/06 14:27:45:1414] D: lwsi_set_state(0x23976c0, 0x1000020b)
[2020/03/06 14:27:45:1414] D: __lws_set_timeout: 0x23976c0: 20 secs, reason 4
[2020/03/06 14:27:45:1425] D: lws_event_idle_timer_cb: wait
[2020/03/06 14:27:45:1426] D: _lws_state_transition: system: changed 1
'CONTEXT_CREATED' -> 2 'INITIALIZED'
[2020/03/06 14:27:45:1426] D: _lws_state_transition: system: changed 2
'INITIALIZED' -> 3 'IFACE_COLDPLUG'
[2020/03/06 14:27:45:1426] D: _lws_state_transition: system: changed 3
'IFACE_COLDPLUG' -> 4 'DHCP'
[2020/03/06 14:27:45:1426] D: _lws_state_transition: system: changed 4
'DHCP' -> 5 'TIME_VALID'
[2020/03/06 14:27:45:1426] D: _lws_state_transition: system: changed 5
'TIME_VALID' -> 6 'POLICY_VALID'
[2020/03/06 14:27:45:1426] D: _lws_state_transition: system: changed 6
'POLICY_VALID' -> 7 'REGISTERED'
[2020/03/06 14:27:45:1426] D: _lws_state_transition: system: changed 7
'REGISTERED' -> 8 'AUTH1'
[2020/03/06 14:27:45:1426] D: _lws_state_transition: system: changed 8
'AUTH1' -> 9 'AUTH2'
[2020/03/06 14:27:45:1427] D: _lws_state_transition: system: changed 9
'AUTH2' -> 10 'OPERATIONAL'
[2020/03/06 14:27:45:1427] I: lws_state_transition_steps:
CONTEXT_CREATED -> OPERATIONAL
[2020/03/06 14:27:45:1431] I: lws_buflist_aware_read: wsi 0x23976c0:
lws_client_socket_service: ssl_capable_read 120
[2020/03/06 14:27:45:1431] D: lws_client_socket_service:
buflist-aware-read 0 120
[2020/03/06 14:27:45:1431] P: WSI_TOKEN_NAME_PART 'H' 0x48
(role=0x10000000) wsi->lextable_pos=0
[2020/03/06 14:27:45:1431] P: WSI_TOKEN_NAME_PART 'T' 0x54
(role=0x10000000) wsi->lextable_pos=87
[2020/03/06 14:27:45:1431] P: WSI_TOKEN_NAME_PART 'T' 0x54
(role=0x10000000) wsi->lextable_pos=173
[2020/03/06 14:27:45:1431] P: WSI_TOKEN_NAME_PART 'P' 0x50
(role=0x10000000) wsi->lextable_pos=174
[2020/03/06 14:27:45:1431] P: WSI_TOKEN_NAME_PART '/' 0x2F
(role=0x10000000) wsi->lextable_pos=175
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART '1' 0x31
(role=0x10000000) wsi->lextable_pos=947
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART '.' 0x2E
(role=0x10000000) wsi->lextable_pos=948
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART '1' 0x31
(role=0x10000000) wsi->lextable_pos=949
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART ' ' 0x20
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART '2' 0x32
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART '0' 0x30
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART '0' 0x30
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART ' ' 0x20
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART 'O' 0x4F
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART 'K' 0x4B
(role=0x10000000) wsi->lextable_pos=-1
' 0x0D (role=0x10000000) wsi->lextable_pos=-1PART '
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART '
' 0x0A (role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1432] P: WSI_TOKEN_NAME_PART 'D' 0x44
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 'a' 0x61
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 't' 0x74
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 'e' 0x65
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART ':' 0x3A
(role=0x10000000) wsi->lextable_pos=-1
[2020/03/06 14:27:45:1433] D: lws_parse: unk header 22 'http/1.1 200 ok
date:'
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 'C' 0x43
(role=0x10000000) wsi->lextable_pos=0
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 'o' 0x6F
(role=0x10000000) wsi->lextable_pos=102
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 'n' 0x6E
(role=0x10000000) wsi->lextable_pos=109
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 't' 0x74
(role=0x10000000) wsi->lextable_pos=116
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 'e' 0x65
(role=0x10000000) wsi->lextable_pos=356
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 'n' 0x6E
(role=0x10000000) wsi->lextable_pos=357
[2020/03/06 14:27:45:1433] P: WSI_TOKEN_NAME_PART 't' 0x74
(role=0x10000000) wsi->lextable_pos=358
[2020/03/06 14:27:45:1434] P: WSI_TOKEN_NAME_PART '-' 0x2D
(role=0x10000000) wsi->lextable_pos=359
[2020/03/06 14:27:45:1434] P: WSI_TOKEN_NAME_PART 'T' 0x54
(role=0x10000000) wsi->lextable_pos=360
[2020/03/06 14:27:45:1434] P: WSI_TOKEN_NAME_PART 'y' 0x79
(role=0x10000000) wsi->lextable_pos=393
[2020/03/06 14:27:45:1434] P: WSI_TOKEN_NAME_PART 'p' 0x70
(role=0x10000000) wsi->lextable_pos=394
[2020/03/06 14:27:45:1434] P: WSI_TOKEN_NAME_PART 'e' 0x65
(role=0x10000000) wsi->lextable_pos=395
[2020/03/06 14:27:45:1434] P: WSI_TOKEN_NAME_PART ':' 0x3A
(role=0x10000000) wsi->lextable_pos=396
[2020/03/06 14:27:45:1434] P: known hdr 19
[2020/03/06 14:27:45:1434] P: WSI_TOK_(19) ' '
[2020/03/06 14:27:45:1434] P: WSI_TOK_(19) 't'
[2020/03/06 14:27:45:1434] P: WSI_TOK_(19) 'e'
[2020/03/06 14:27:45:1434] P: WSI_TOK_(19) 'x'
[2020/03/06 14:27:45:1434] P: WSI_TOK_(19) 't'
[2020/03/06 14:27:45:1435] P: WSI_TOK_(19) '/'
[2020/03/06 14:27:45:1435] P: WSI_TOK_(19) 'p'
[2020/03/06 14:27:45:1435] P: WSI_TOK_(19) 'l'
[2020/03/06 14:27:45:1435] P: WSI_TOK_(19) 'a'
[2020/03/06 14:27:45:1435] P: WSI_TOK_(19) 'i'
[2020/03/06 14:27:45:1435] P: WSI_TOK_(19) 'n'
'2020/03/06 14:27:45:1435] P: WSI_TOK_(19) '
[2020/03/06 14:27:45:1435] P: *
[2020/03/06 14:27:45:1435] P: WSI_TOKEN_SKIPPING_SAW_CR '
'
[2020/03/06 14:27:45:1435] P: WSI_TOKEN_NAME_PART 'C' 0x43
(role=0x10000000) wsi->lextable_pos=0
[2020/03/06 14:27:45:1435] P: WSI_TOKEN_NAME_PART 'o' 0x6F
(role=0x10000000) wsi->lextable_pos=102
[2020/03/06 14:27:45:1435] P: WSI_TOKEN_NAME_PART 'n' 0x6E
(role=0x10000000) wsi->lextable_pos=109
[2020/03/06 14:27:45:1435] P: WSI_TOKEN_NAME_PART 't' 0x74
(role=0x10000000) wsi->lextable_pos=116
[2020/03/06 14:27:45:1435] P: WSI_TOKEN_NAME_PART 'e' 0x65
(role=0x10000000) wsi->lextable_pos=356
[2020/03/06 14:27:45:1435] P: WSI_TOKEN_NAME_PART 'n' 0x6E
(role=0x10000000) wsi->lextable_pos=357
[2020/03/06 14:27:45:1436] P: WSI_TOKEN_NAME_PART 't' 0x74
(role=0x10000000) wsi->lextable_pos=358
[2020/03/06 14:27:45:1436] P: WSI_TOKEN_NAME_PART '-' 0x2D
(role=0x10000000) wsi->lextable_pos=359
[2020/03/06 14:27:45:1436] P: WSI_TOKEN_NAME_PART 'L' 0x4C
(role=0x10000000) wsi->lextable_pos=360
[2020/03/06 14:27:45:1436] P: WSI_TOKEN_NAME_PART 'e' 0x65
(role=0x10000000) wsi->lextable_pos=376
[2020/03/06 14:27:45:1436] P: WSI_TOKEN_NAME_PART 'n' 0x6E
(role=0x10000000) wsi->lextable_pos=386
[2020/03/06 14:27:45:1436] P: WSI_TOKEN_NAME_PART 'g' 0x67
(role=0x10000000) wsi->lextable_pos=387
[2020/03/06 14:27:45:1436] P: WSI_TOKEN_NAME_PART 't' 0x74
(role=0x10000000) wsi->lextable_pos=388
[2020/03/06 14:27:45:1436] P: WSI_TOKEN_NAME_PART 'h' 0x68
(role=0x10000000) wsi->lextable_pos=389
[2020/03/06 14:27:45:1436] P: WSI_TOKEN_NAME_PART ':' 0x3A
(role=0x10000000) wsi->lextable_pos=390
[2020/03/06 14:27:45:1436] P: known hdr 18
[2020/03/06 14:27:45:1436] P: WSI_TOK_(18) ' '
[2020/03/06 14:27:45:1436] P: WSI_TOK_(18) '0'
'2020/03/06 14:27:45:1436] P: WSI_TOK_(18) '
[2020/03/06 14:27:45:1436] P: *
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_SKIPPING_SAW_CR '
'
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 'C' 0x43
(role=0x10000000) wsi->lextable_pos=0
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 'o' 0x6F
(role=0x10000000) wsi->lextable_pos=102
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 'n' 0x6E
(role=0x10000000) wsi->lextable_pos=109
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 'n' 0x6E
(role=0x10000000) wsi->lextable_pos=116
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 'e' 0x65
(role=0x10000000) wsi->lextable_pos=123
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 'c' 0x63
(role=0x10000000) wsi->lextable_pos=124
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 't' 0x74
(role=0x10000000) wsi->lextable_pos=125
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 'i' 0x69
(role=0x10000000) wsi->lextable_pos=126
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 'o' 0x6F
(role=0x10000000) wsi->lextable_pos=133
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART 'n' 0x6E
(role=0x10000000) wsi->lextable_pos=134
[2020/03/06 14:27:45:1437] P: WSI_TOKEN_NAME_PART ':' 0x3A
(role=0x10000000) wsi->lextable_pos=135
[2020/03/06 14:27:45:1437] P: known hdr 4
[2020/03/06 14:27:45:1438] P: WSI_TOK_(4) ' '
[2020/03/06 14:27:45:1438] P: WSI_TOK_(4) 'c'
[2020/03/06 14:27:45:1438] P: WSI_TOK_(4) 'l'
[2020/03/06 14:27:45:1438] P: WSI_TOK_(4) 'o'
[2020/03/06 14:27:45:1438] P: WSI_TOK_(4) 's'
[2020/03/06 14:27:45:1438] P: WSI_TOK_(4) 'e'
'2020/03/06 14:27:45:1438] P: WSI_TOK_(4) '
[2020/03/06 14:27:45:1438] P: *
[2020/03/06 14:27:45:1438] P: WSI_TOKEN_SKIPPING_SAW_CR '
'
' 0x0D (role=0x10000000) wsi->lextable_pos=0_PART '
[2020/03/06 14:27:45:1438] P: WSI_TOKEN_NAME_PART '
' 0x0A (role=0x10000000) wsi->lextable_pos=170
[2020/03/06 14:27:45:1438] P: known hdr 7
[2020/03/06 14:27:45:1438] D: lws_client_interpret_server_handshake:
0x23976c0: transitioning to h1 client
[2020/03/06 14:27:45:1439] D: lws_role_transition: 0x23976c0: wsistate
0x10000119, ops h1
[2020/03/06 14:27:45:1439] I: no URI
>>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_CONNECTION_ERROR
LWS_CALLBACK_CLIENT_CONNECTION_ERROR: HS: URI missing
[2020/03/06 14:27:45:1439] I: closing connection (prot http) due to
bail2 connection error: HS: URI missing
[2020/03/06 14:27:45:1439] I: __lws_close_free_wsi: 0x23976c0: caller:
c hs interp
>>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_HTTP_DROP_PROTOCOL
[2020/03/06 14:27:45:1439] D: __lws_close_free_wsi: real
just_kill_connection: 0x23976c0 (sockfd 10)
[2020/03/06 14:27:45:1439] D: lwsi_set_state(0x23976c0, 0x10000020)
>>>>>>>>>>>>>> LWS_CALLBACK_CLOSED_CLIENT_HTTP
 ** FAILED (-1) **


> >  >>>>>>>>>>>>>> LWS_CALLBACK_CLIENT_HTTP_DROP_PROTOCOL
> >  >>>>>>>>>>>>>> LWS_CALLBACK_CLOSED_CLIENT_HTTP
> >   ** FAILED (-1) **
> >
> > I had a look at the minimal post example, but that one is using
> > multipart body parts, while my code is just posting the raw msgpack
> > message. Is this supported? How should the writeable callback end the post?
>
> I don't think it's relevent if the peer actually got your POST content.
>
> > Using the master branch.
>
> Make sure you're using today's current master HEAD, it's
> 1289b0a0ef6fde60cb2d765c380a67167ca522f2 at the moment, or v4.0-stable
> that's out today.  Under some conditions http headers were broken a few
> days ago briefly on master due to changes allowing chopping them down if
> h2, ws, or "uncommon headers" are disabled for build in cmake, for very
> small footprint case.

Pulled in the last few commits, but same issue. The included debug log
is versus the
1289b0a0ef6fde60cb2d765c380a67167ca522f2 commit.


More information about the Libwebsockets mailing list