[Libwebsockets] lwsts[7873]: ****** ec017ca0 Sending new, pending truncated ...

Andy Green andy at warmcat.com
Sun Jun 19 22:01:06 CEST 2016



On June 20, 2016 2:23:18 AM GMT+08:00, satya gowtham kudupudi <satyagowtham.k at gmail.com> wrote:
>Now I have switched to 2.0-stable and increased the rx_buffer_size to
>1024
>and the pending truncated message is gone but still I'm getting
>forbidden
>response.
>HTTP/1.0 403 Forbidden\\r\\nserver: libwebsockets\\r\\ncontent-type:
>text/html\\r\\ncontent-length:
>38\\r\\n\\r\\n<html><body><h1>403</h1></body></html>
>
>sudo dist/Debug/GNU-Linux/ferrymediaserver -s normal
>
>[sudo] password for gowtham:
>
>[2016/06/19 23:47:07:2594] NOTICE: Built to support server operations
>
>[2016-06-19 23:47:07 NTC run]: waiting for a connection on 92711 ...
>
>lwsts[8840]: libwebsockets echo test - (C) Copyright 2010-2013 Andy
>Green <
>andy at warmcat.com> - licensed under LGPL2.1
>
>lwsts[8840]: Running in server mode
>
>lwsts[8840]: Initial logging level 65535
>
>lwsts[8840]: Libwebsockets version: 2.0.2
>gowtham at ubuntu-v2.0.2-5-gc1e14e7
>
>lwsts[8840]: IPV6 not compiled in
>
>lwsts[8840]: libev support not compiled in
>
>lwsts[8840]: libuv support not compiled in
>
>lwsts[8840]:  LWS_DEF_HEADER_LEN    : 1024
>
>lwsts[8840]:  LWS_MAX_PROTOCOLS     : 5
>
>lwsts[8840]:  LWS_MAX_SMP           : 32
>
>lwsts[8840]:  SPEC_LATEST_SUPPORTED : 13
>
>lwsts[8840]:  sizeof (*info)        : 280
>
>lwsts[8840]:  SYSTEM_RANDOM_FILEPATH: '/dev/urandom'
>
>lwsts[8840]:  default timeout (secs): 20
>
>lwsts[8840]:  Threads: 1 each 1024 fds
>
>lwsts[8840]:  mem: context:          9512 bytes (5416 ctx + (1 thr x
>4096))
>
>lwsts[8840]:  mem: http hdr rsvd:   68224 bytes (1 thr x (1024 + 3240)
>x
>16))
>
>lwsts[8840]:  mem: pollfd map:       8192
>
>lwsts[8840]:  mem: platform fd map:  8192 bytes
>
>lwsts[8840]:  Compiled with OpenSSL support
>
>lwsts[8840]:  SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
>
>lwsts[8840]: Creating Vhost 'default' port 80, 2 protocols
>
>lwsts[8840]: insert_wsi_socket_into_fds: 0x7fd6f4017ab0: tsi=0, sock=9,
>pos-in-fds=1
>
>lwsts[8840]:  Listening on port 80
>
>lwsts[8840]:  LWS_MAX_EXTENSIONS_ACTIVE: 2
>
>lwsts[8840]:  mem: per-conn:          488 bytes + protocol rx buf
>
>lwsts[8840]:  canonical_hostname = ubuntu
>
>lwsts[8840]: lws_protocol_init
>
>lwsts[8840]: fd=9, revents=1
>
>lwsts[8840]: accepted new conn  port 57104 on fd=10
>
>lwsts[8840]: Accepted 0x7fd6f4017ca0 to tsi 0
>
>lwsts[8840]: lws_adopt_socket_vhost: new wsi 0x7fd6f4017ca0, sockfd 10
>
>lwsts[8840]: lws_set_timeout: 0x7fd6f4017ca0: 20 secs
>
>lwsts[8840]: insert_wsi_socket_into_fds: 0x7fd6f4017ca0: tsi=0,
>sock=10,
>pos-in-fds=2
>
>lwsts[8840]: lws_header_table_attach: wsi 0x7fd6f4017ca0: ah (nil) (tsi
>0)
>
>lwsts[8840]: lws_header_table_attach: wsi 0x7fd6f4017ca0: ah
>0x7fd6f4006e10: count 1 (on exit)
>
>lwsts[8840]: Attached ah immediately
>
>lwsts[8840]: fd=10, revents=1
>
>lwsts[8840]: lws_server_socket_service: 0x7fd6f4017ca0: rxpos:0 rxlen:0
>
>lwsts[8840]: lws_server_socket_service: wsi 0x7fd6f4017ca0, ah->rxlen =
>295
>
>lwsts[8840]: lws_read: incoming len 295  state 0
>
>lwsts[8840]: issuing 295 bytes to parser
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'P' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'O' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'S' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'T' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART ' ' (mode=0)
>
>lwsts[8840]: known hdr 1
>
>lwsts[8840]: WSI_TOK_(1) ' '

Are you sending POST HTTP/1.1 ?  That's not legal http afaik.

Like I said the second way to get forbidden is your uri doesn't start with /

-Andy


>lwsts[8840]: WSI_TOK_(1) 'H'
>
>lwsts[8840]: WSI_TOK_(1) 'T'
>
>lwsts[8840]: WSI_TOK_(1) 'T'
>
>lwsts[8840]: WSI_TOK_(1) 'P'
>
>lwsts[8840]: WSI_TOK_(1) '/'
>
>lwsts[8840]: WSI_TOK_(1) '1'
>
>lwsts[8840]: WSI_TOK_(1) '.'
>
>lwsts[8840]: WSI_TOK_(1) '1'
>
>'wsts[8840]: WSI_TOK_(1) '
>
>lwsts[8840]: *
>
>lwsts[8840]: WSI_TOKEN_SKIPPING_SAW_CR '
>
>'
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'U' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 's' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'e' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'r' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART '-' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'A' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'g' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'e' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'n' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 't' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART ':' (mode=0)
>
>lwsts[8840]: known hdr 69
>
>lwsts[8840]: WSI_TOK_(69) ' '
>
>lwsts[8840]: WSI_TOK_(69) 'M'
>
>lwsts[8840]: WSI_TOK_(69) 'y'
>
>lwsts[8840]: WSI_TOK_(69) 'C'
>
>lwsts[8840]: WSI_TOK_(69) 'U'
>
>lwsts[8840]: WSI_TOK_(69) 'R'
>
>lwsts[8840]: WSI_TOK_(69) 'L'
>
>'wsts[8840]: WSI_TOK_(69) '
>
>lwsts[8840]: *
>
>lwsts[8840]: WSI_TOKEN_SKIPPING_SAW_CR '
>
>'
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'C' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'o' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'n' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 't' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'e' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'n' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 't' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART '-' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'T' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'y' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'p' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'e' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART ':' (mode=0)
>
>lwsts[8840]: known hdr 28
>
>lwsts[8840]: WSI_TOK_(28) ' '
>
>lwsts[8840]: WSI_TOK_(28) 't'
>
>lwsts[8840]: WSI_TOK_(28) 'e'
>
>lwsts[8840]: WSI_TOK_(28) 'x'
>
>lwsts[8840]: WSI_TOK_(28) 't'
>
>lwsts[8840]: WSI_TOK_(28) '/'
>
>lwsts[8840]: WSI_TOK_(28) 'j'
>
>lwsts[8840]: WSI_TOK_(28) 's'
>
>lwsts[8840]: WSI_TOK_(28) 'o'
>
>lwsts[8840]: WSI_TOK_(28) 'n'
>
>lwsts[8840]: WSI_TOK_(28) ';'
>
>lwsts[8840]: WSI_TOK_(28) ' '
>
>lwsts[8840]: WSI_TOK_(28) 'c'
>
>lwsts[8840]: WSI_TOK_(28) 'h'
>
>lwsts[8840]: WSI_TOK_(28) 'a'
>
>lwsts[8840]: WSI_TOK_(28) 'r'
>
>lwsts[8840]: WSI_TOK_(28) 's'
>
>lwsts[8840]: WSI_TOK_(28) 'e'
>
>lwsts[8840]: WSI_TOK_(28) 't'
>
>lwsts[8840]: WSI_TOK_(28) '='
>
>lwsts[8840]: WSI_TOK_(28) 'u'
>
>lwsts[8840]: WSI_TOK_(28) 't'
>
>lwsts[8840]: WSI_TOK_(28) 'f'
>
>lwsts[8840]: WSI_TOK_(28) '-'
>
>lwsts[8840]: WSI_TOK_(28) '8'
>
>'wsts[8840]: WSI_TOK_(28) '
>
>lwsts[8840]: *
>
>lwsts[8840]: WSI_TOKEN_SKIPPING_SAW_CR '
>
>'
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'H' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'o' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 's' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 't' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART ':' (mode=0)
>
>lwsts[8840]: known hdr 3
>
>lwsts[8840]: WSI_TOK_(3) ' '
>
>lwsts[8840]: WSI_TOK_(3) 'f'
>
>lwsts[8840]: WSI_TOK_(3) 'a'
>
>lwsts[8840]: WSI_TOK_(3) 'i'
>
>lwsts[8840]: WSI_TOK_(3) 'r'
>
>lwsts[8840]: WSI_TOK_(3) 'p'
>
>lwsts[8840]: WSI_TOK_(3) 'l'
>
>lwsts[8840]: WSI_TOK_(3) 'a'
>
>lwsts[8840]: WSI_TOK_(3) 'y'
>
>lwsts[8840]: WSI_TOK_(3) '.'
>
>lwsts[8840]: WSI_TOK_(3) 'u'
>
>lwsts[8840]: WSI_TOK_(3) 'b'
>
>lwsts[8840]: WSI_TOK_(3) 'u'
>
>lwsts[8840]: WSI_TOK_(3) 'n'
>
>lwsts[8840]: WSI_TOK_(3) 't'
>
>lwsts[8840]: WSI_TOK_(3) 'u'
>
>lwsts[8840]: WSI_TOK_(3) '.'
>
>lwsts[8840]: WSI_TOK_(3) 'l'
>
>lwsts[8840]: WSI_TOK_(3) 'o'
>
>lwsts[8840]: WSI_TOK_(3) 'c'
>
>lwsts[8840]: WSI_TOK_(3) 'a'
>
>lwsts[8840]: WSI_TOK_(3) 'l'
>
>'wsts[8840]: WSI_TOK_(3) '
>
>lwsts[8840]: *
>
>lwsts[8840]: WSI_TOKEN_SKIPPING_SAW_CR '
>
>'
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'C' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'o' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'n' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 't' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'e' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'n' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 't' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART '-' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'L' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'e' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'n' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'g' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 't' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'h' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART ':' (mode=0)
>
>lwsts[8840]: known hdr 27
>
>lwsts[8840]: WSI_TOK_(27) ' '
>
>lwsts[8840]: WSI_TOK_(27) '1'
>
>lwsts[8840]: WSI_TOK_(27) '4'
>
>lwsts[8840]: WSI_TOK_(27) '3'
>
>'wsts[8840]: WSI_TOK_(27) '
>
>lwsts[8840]: *
>
>lwsts[8840]: WSI_TOKEN_SKIPPING_SAW_CR '
>
>'
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'C' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'o' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'n' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'n' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'e' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'c' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 't' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'i' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'o' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART 'n' (mode=0)
>
>lwsts[8840]: WSI_TOKEN_NAME_PART ':' (mode=0)
>
>lwsts[8840]: known hdr 4
>
>lwsts[8840]: WSI_TOK_(4) ' '
>
>lwsts[8840]: WSI_TOK_(4) 'K'
>
>lwsts[8840]: WSI_TOK_(4) 'e'
>
>lwsts[8840]: WSI_TOK_(4) 'e'
>
>lwsts[8840]: WSI_TOK_(4) 'p'
>
>lwsts[8840]: WSI_TOK_(4) '-'
>
>lwsts[8840]: WSI_TOK_(4) 'A'
>
>lwsts[8840]: WSI_TOK_(4) 'l'
>
>lwsts[8840]: WSI_TOK_(4) 'i'
>
>lwsts[8840]: WSI_TOK_(4) 'v'
>
>lwsts[8840]: WSI_TOK_(4) 'e'
>
>'wsts[8840]: WSI_TOK_(4) '
>
>lwsts[8840]: *
>
>lwsts[8840]: WSI_TOKEN_SKIPPING_SAW_CR '
>
>'
>
>' (mode=0)]: WSI_TOKEN_NAME_PART '
>
>lwsts[8840]: WSI_TOKEN_NAME_PART '
>
>' (mode=0)
>
>lwsts[8840]: known hdr 8
>
>lwsts[8840]: lws_handshake_server: lws_parse sees parsing complete
>
>lwsts[8840]: lws_handshake_server: wsi->more_rx_waiting=1
>
>lwsts[8840]: lws_set_timeout: 0x7fd6f4017ca0: 0 secs
>
>lwsts[8840]: No upgrade
>
>lwsts[8840]: lws_union_transition: 0x7fd6f4017ca0: mode 2
>
>lwsts[8840]: lws_handshake_server: wsi 0x7fd6f4017ca0: ah
>0x7fd6f4006e10
>
>lwsts[8840]: lws_ensure_user_space: 0x7fd6f4017ca0 protocol 0xf1d660
>
>lwsts[8840]: Method: POST request for 'HTTP/1.1'
>
>lwsts[8840]: lws_header_table_detach: wsi 0x7fd6f4017ca0: ah
>0x7fd6f4006e10
>(tsi=0, count = 1)
>
>lwsts[8840]: closing connection at lws_read bail:
>
>lwsts[8840]: lws_close_free_wsi: shutting down connection:
>0x7fd6f4017ca0
>(sock 10, state 0)
>
>lwsts[8840]: lws_set_timeout: 0x7fd6f4017ca0: 20 secs
>
>lwsts[8840]: fd=10, revents=17
>
>lwsts[8840]: lws_server_socket_service: wsi 0x7fd6f4017ca0 read 0
>
>lwsts[8840]: lws_server_socket_service: read 0 len
>
>lwsts[8840]: lws_close_free_wsi: real just_kill_connection:
>0x7fd6f4017ca0
>(sockfd 10)
>
>lwsts[8840]: remove_wsi_socket_from_fds: removing same prot wsi
>0x7fd6f4017ca0
>
>lwsts[8840]: remove_wsi_socket_from_fds: wsi=0x7fd6f4017ca0, sock=10,
>fds
>pos=2, end guy pos=3, endfd=0
>
>lwsts[8840]: calling back CLOSED_HTTP
>
>lwsts[8840]: lws_header_table_detach: wsi 0x7fd6f4017ca0: ah (nil)
>(tsi=0,
>count = 0)
>
>lwsts[8840]: lws_free_wsi: 0x7fd6f4017ca0, remaining wsi 1
>
>I'm unable to decipher the log.
>
>
>On Sat, Jun 18, 2016 at 9:59 PM, Andy Green <andy at warmcat.com> wrote:
>
>>
>>
>> On June 18, 2016 11:49:00 AM GMT+08:00, satya gowtham kudupudi <
>> satyagowtham.k at gmail.com> wrote:
>> >This is the log I got but I couldn't figure out the issue. Please
>help
>> >me
>> >one more time Andy.
>>
>> What you wote in your original email was
>>
>> >> Response I got is "Forbidden request"
>> >>
>> >> I think the mistake is in User-Agent header field. Please help me.
>>
>> That's not what's going on there in the logs.
>>
>> >$ sudo dist/Debug/GNU-Linux/ferrymediaserver -s normal
>> >
>> >[2016/05/18 08:39:21:0388] NOTICE: Built to support server
>operations
>> >
>> >[2016-06-18 08:39:21 NTC run]: waiting for a connection on 92711 ...
>> >
>> >lwsts[18585]: libwebsockets echo test - (C) Copyright 2010-2013 Andy
>> >Green <
>> >andy at warmcat.com> - licensed under LGPL2.1
>> >
>> >lwsts[18585]: Running in server mode
>> >
>> >lwsts[18585]: Initial logging level 65535
>> >
>> >lwsts[18585]: Libwebsockets version: 2.0.1
>> >gowtham at ubuntu-v2.0.1-4-g7d259d8
>>
>> You should update to current v2.0-stable
>>
>> >...
>> >lwsts[18585]: lws_handshake_server: lws_parse sees parsing complete
>>
>> Parsing for the transaction is fine, there's no 'forbidden'.
>>
>> >lwsts[18585]: lws_handshake_server: wsi->more_rx_waiting=1
>> >
>> >lwsts[18585]: lws_set_timeout: 0x7f8054017ca0: 0 secs
>> >
>> >lwsts[18585]: No upgrade
>> >
>> >lwsts[18585]: lws_union_transition: 0x7f8054017ca0: mode 2
>> >
>> >lwsts[18585]: lws_handshake_server: wsi 0x7f8054017ca0: ah
>> >0x7f8054006e10
>> >
>> >lwsts[18585]: lws_ensure_user_space: 0x7f8054017ca0 protocol
>0x874680
>> >
>> >lwsts[18585]: Method: POST request for 'HTTP/1.1'
>> >
>> >lwsts[18585]: 0x7f8054017ca0 new partial sent 20 from 94 total
>>
>> This is coming because your protocols[0] that deals with http has an
>> unrealistic rx_buffer_size of 20 bytes, currently we also use that
>number
>> to limit the tx size.  Just increase it to more than the size of your
>max
>> headers, say 1024 or 4096 or whatever.
>>
>> -Andy
>>
>> >lwsts[18585]: ****** 54017ca0 Sending new, pending truncated ...
>> >
>> >ferrymediaserver:
>> >/home/gowtham/workspace/libwebsockets/lib/output.c:113:
>> >lws_issue_raw: Assertion `0' failed.
>> >
>> >Aborted
>> >
>> >--
>> >Gowtham
>> >
>> >On Thu, Jun 16, 2016 at 12:07 PM, Andy Green <andy at warmcat.com>
>wrote:
>> >
>> >>
>> >>
>> >> On 06/16/2016 12:52 PM, satya gowtham kudupudi wrote:
>> >>
>> >>> I have cranked up the debug level but I got no extra log
>> >>>
>> >>
>> >> The extra logging is not compiled in with a release build.
>> >>
>> >> $ cmake .. -DCMAKE_BUILD_TYPE=DEBUG
>> >>
>> >> -Andy
>> >>
>> >> lwsts[15448]: libwebsockets echo test - (C) Copyright 2010-2013
>Andy
>> >>> Green <andy at warmcat.com <mailto:andy at warmcat.com>> - licensed
>under
>> >>> LGPL2.1
>> >>>
>> >>> lwsts[15448]: Running in server mode
>> >>>
>> >>> lwsts[15448]: Initial logging level 65535
>> >>>
>> >>> lwsts[15448]: Libwebsockets version: 2.0.1
>> >>> gowtham at ubuntu-v2.0.1-4-g7d259d8
>> >>>
>> >>> lwsts[15448]: IPV6 not compiled in
>> >>>
>> >>> lwsts[15448]: libev support not compiled in
>> >>>
>> >>> lwsts[15448]: libuv support not compiled in
>> >>>
>> >>> lwsts[15448]:  Threads: 1 each 1024 fds
>> >>>
>> >>> lwsts[15448]:  mem: platform fd map:  8192 bytes
>> >>>
>> >>> lwsts[15448]:  Compiled with OpenSSL support
>> >>>
>> >>> lwsts[15448]:  SSL disabled: no
>LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
>> >>>
>> >>> lwsts[15448]: Creating Vhost 'default' port 80, 2 protocols
>> >>>
>> >>> lwsts[15448]:  Listening on port 80
>> >>>
>> >>> lwsts[15448]:  mem: per-conn:          488 bytes + protocol rx
>buf
>> >>>
>> >>> lwsts[15448]:  canonical_hostname = ubuntu
>> >>>
>> >>> lwsts[15448]: lws_protocol_init
>> >>>
>> >>> lwsts[15448]: ****** f4017ca0 Sending new, pending truncated ...
>> >>>
>> >>>
>> >>> --
>> >>> Gowtham
>> >>>
>> >>> On Wed, Jun 15, 2016 at 2:17 AM, Andy Green <andy at warmcat.com
>> >>> <mailto:andy at warmcat.com>> wrote:
>> >>>
>> >>>
>> >>>
>> >>>     On June 15, 2016 1:00:18 AM GMT+08:00, satya gowtham kudupudi
>> >>>     <satyagowtham.k at gmail.com <mailto:satyagowtham.k at gmail.com>>
>> >wrote:
>> >>>     >I'm making http request to libwebsocket server using raw
>> >sockets.
>> >>>     >I'm sending below headers
>> >>>     >
>> >>>     >"POST /index.html HTTP/1.1\r\n"
>> >>>     >"User-Agent: myagent\r\n"
>> >>>     >"Content-Type: text/json; charset=utf-8\r\n"
>> >>>     >"Host: myhost\r\n"
>> >>>     >"Content-Length: " + ccl + "\r\n"
>> >>>     >"Connection: Keep-Alive\r\n\r\n"
>> >>>     >
>> >>>     >Response I got is "Forbidden request"
>> >>>
>> >>>     There are two ways to literally get "Forbidden", which is 403
>> >>>     response code
>> >>>
>> >>>     1) Unknown method, or something illegal about what is
>supposed
>> >to be
>> >>>     urlencoded uri args.  So % followed by non-hex chars, % and
>less
>> >>>     than 2 chars remaining, ? inappropriately etc
>> >>>
>> >>>     2) url after method didn't begin with /
>> >>>
>> >>>     If 1), it will log "forbidding on uri sanitation"
>> >>>
>> >>>     >I think the mistake is in User-Agent header field. Please
>help
>> >me.
>> >>>
>> >>>     Crank up the debug level to 65535 and look at the logs, it
>> >should
>> >>>     show in detail where the parsing stops.
>> >>>
>> >>>     -Andy
>> >>>
>> >>>     >Regards
>> >>>     >Gowtham
>> >>>     >
>> >>>     >
>> >>>
>> >>>
>>
>>>------------------------------------------------------------------------
>> >>>     >
>> >>>     >_______________________________________________
>> >>>     >Libwebsockets mailing list
>> >>>     >Libwebsockets at ml.libwebsockets.org
>> >>>     <mailto:Libwebsockets at ml.libwebsockets.org>
>> >>>     >http://libwebsockets.org/mailman/listinfo/libwebsockets
>> >>>
>> >>>
>> >>>
>>
>>




More information about the Libwebsockets mailing list